Z80 Light-flasher
Wednesday, 13th August 2008
Now armed with a flash programmer, I thought it about time to try and build a Z80-based system.
Not much to look at, and it doesn't do much either. The large IC in the bottom-left, prominently marked Z, is the Z80 itself. To its left is a 555, generating a ~220Hz clock signal (yes, Hz, not MHz or even kHz). Above the Z80 is another large chip - this is the 128KB flash ROM. The eight parallel wires between them are the address bus - only A0 to A7 are connected. This only lets the Z80 address 256 bytes, but that should be enough for testing.
To the right of the flash ROM is an octal latch. This is used to provide an 8-bit output port for the system, which is connected to the LEDs to its right. As the latch's latch enable pin is active high, unlike everything else in the system (which is active low - ie, it does something when you drive it low) I have to put a NOT gate - the final black IC to the right of the Z80 - between it and the Z80's /WR (write) pin. I do not do any address decoding or even check the /IORQ pin, so any value written to to any hardware device or memory address will end up on the LED display. Not that that really matters, as there is a conspicuous lack of RAM in the system!
The large physical size and tedium of wiring even such a primitive system as this makes me wonder whether it's worth jumping straight to stripboard for subsequent hardware revisions...
For the curious, the program running on the Z80 is as follows.
.for p = 0 to 7 .defpage p, kb(16), $0000 .loop .emptyfill $FF .page 0 im 1 di -- ld hl,LightSequence ld b,LightSequenceEnd-LightSequence - ld a,(hl) out (0),a inc hl djnz - jr -- LightSequence .db %00000001 .db %00000010 .db %00000100 .db %00001000 .db %00010000 .db %00100000 .db %01000000 .db %10000000 .db %01000000 .db %00100000 .db %00010000 .db %00001000 .db %00000100 .db %00000010 .db %00000001 .db %00000010 .db %00000100 .db %00001000 .db %00010000 .db %00100000 .db %01000000 .db %10000000 .db %01000000 .db %00100000 .db %00010000 .db %00001000 .db %00000100 .db %00000010 .db %00000001 .db %00000011 .db %00000111 .db %00001111 .db %00011111 .db %00111111 .db %01111111 .db %11111111 .db %11111111 .db %00000000 .db %11111111 .db %00000000 .db %11111111 .db %00000000 .db %11111111 .db %00000000 .db %11111111 .db %00000000 .db %11111111 .db %00000000 .db %11111111 .db %11111110 .db %11111100 .db %11111000 .db %11110000 .db %11100000 .db %11000000 .db %10000000 .db %00000000 .db %10000000 .db %11000000 .db %11100000 .db %11110000 .db %01111000 .db %00111100 .db %00011110 .db %00001111 .db %10000111 .db %11000011 .db %11100001 .db %11110000 .db %01111000 .db %00111100 .db %00011110 .db %00001111 .db %10000111 .db %11000011 .db %11100001 .db %11110000 .db %01111000 .db %00111100 .db %00011110 .db %00001111 .db %00000111 .db %00000011 .db %00000001 .db %00000000 LightSequenceEnd .echoln strformat("Size: {0} bytes", $)