Jump to content
  • Advertisement
  • entries
    222
  • comments
    606
  • views
    592871

Z80 Light-flasher

Sign in to follow this  
benryves

2244 views

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", $)
Sign in to follow this  


4 Comments


Recommended Comments

Nice stuff [cool]. 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 [smile]

Share this comment


Link to comment
Cheers! [smile] 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!

Share this comment


Link to comment
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.

Share this comment


Link to comment
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. [smile] 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. [smile]

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!