Original page: http://www.seventransistorlabs.com/tmoranwms/Elec_Z80.html

The parallel port programming interface used: https://www.seventransistorlabs.com/tmoranwms/Elec_RamR.html

I don't have documentation for the entire circuit, unfortunately, so a description will have to do: the timer section was a one-shot timer, built from a chain of four 4-bit synchronous counters, with a bus pre-load function, and an interrupt output.

To generate a continuous square wave, the CPU loads the timer-high and timer-low registers, enables the count-down bit, and goes off doing its own thing. Some time later, the interrupt fires. The ISR complements an output bit (the square wave output pin), re-initializes the timer registers, and returns.

To generate music, the number of half-cycles is counted. When that finishes, the next entry in the music table is loaded, providing a new timer count and half-cycle count. When the table is finished, it loops back to the beginning, playing the song on loop.

With the tone generator code, it doesn't fit in 1k, so I'm providing that as information, and optional hardware. But the display stuff works great, and looks great, using well under 1k.

(To be precise, the 1k challenge part of this project is only what's on the web pages above: the circuit and code (which assembles to under 1KiB used code) are provided, as well as the means of programming.)