| Wednesday, August 13, 2008 |
 Z80 Light-flasher |
Posted - 8/13/2008 9:40:50 PM | Now armed with a flash programmer, I thought it about time to try and build a Z80-based system.

Click for video (829KB WMV)
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", $)
| |
Comments
 |  cameni
Member since: 4/18/2000 From: Bratislava, Bratislava |
Posted - 8/14/2008 3:05:29 AM | Nice stuff . This reminds me I still have a Z80 CPU and its peripheral chips somewhere, I wish I could sort all my projects to make space for another, HW one, again. Someday ..
Thanks for the reminiscences 
| |
 |  benryves GDNet+
Member since: 9/4/2003 From: Purley, Greater London |
Posted - 8/14/2008 6:50:50 AM | Cheers! Having written software for the Z80 for many years, it's nice to be able to try and experiment with the hardware rather than just using hardware someone else has built. If only wiring up these circuits wasn't so tedious!
| |
 |  Scet GDNet+
Member since: 8/3/2002 From: Mississauga, Ontario |
Posted - 8/14/2008 5:27:53 PM | First, this is awesome. Second, where do you order these Z80s from? I have a large school project that'll require building something like this and it would be nice to find someplace to buy from other than eBay.
I own a 6502, but I'd rather eat dirt then program for that thing.
| |
 |  benryves GDNet+
Member since: 9/4/2003 From: Purley, Greater London |
Posted - 8/14/2008 7:23:17 PM | Quote:Original post by Scet
First, this is awesome. Second, where do you order these Z80s from? I have a large school project that'll require building something like this and it would be nice to find someplace to buy from other than eBay. |
For such a popular (if old) chip, a classic Z80 certainly is awkward to find!
The exact model I'm using is a Z84C0010PEG. The 10 stands for 10MHz, the fastest I could find for a decent price in the UK. There is a 20MHz version (Z84C0020PEG) if you can find it (I received a quote from a UK supplier, but the minimum order was 10 raising the overall cost to over £160). Digi-Key sell them, but shipping from the USA was rather expensive. I bought mine from Farnell. Rapid sell one that has a 6MHz part number but describes it as 4MHz, so not sure what's going on there.
Of course, what with me being in the UK, and you being in Canada, I'm probably not the right person to be answering this question. Faster Z180s seem easier to find, if you can deal with the SDIP 64 package, and they have various goodies built in (such as a 1MB MMU, ie 20-bit address bus, as well as integerated timers, clock generator, hardware multiplication and two UARTs). If this is for school you might have access to equipment suitable for such a package. I don't.

The pins are much closer together, making it difficult to use if all your tools have 0.1" pin spacing instead of 0.07".
I didn't have much luck on eBay either, myself, only one slow Z80 that was being sold as a spare part for a Speccy. You may also have better luck searching for a Z80 clone rather than the genuine ZiLOG article.
Cheers!
On the subject of eBay; the programmer I'm using is a Willem, purchased from this eBay seller, who I can strongly recommend. 
| |
|
| S | M | T | W | T | F | S | | | | 1 | 2 | 3 | 4 | | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | |
OPTIONS
Track this Journal
ARCHIVES
September, 2010
August, 2010
July, 2010
June, 2010
April, 2010
March, 2010
February, 2010
January, 2010
December, 2009
November, 2009
October, 2009
August, 2009
June, 2009
May, 2009
March, 2009
February, 2009
January, 2009
December, 2008
November, 2008
October, 2008
September, 2008
August, 2008
July, 2008
June, 2008
May, 2008
April, 2008
March, 2008
February, 2008
November, 2007
October, 2007
September, 2007
August, 2007
July, 2007
May, 2007
April, 2007
February, 2007
January, 2007
December, 2006
November, 2006
October, 2006
September, 2006
August, 2006
July, 2006
June, 2006
May, 2006
April, 2006
March, 2006
February, 2006
January, 2006
December, 2005
November, 2005
October, 2005
September, 2005
August, 2005
April, 2005
February, 2005
January, 2005
|