Go Down

Topic: Wiring a Z80 to Arduino... (Read 27269 times) previous topic - next topic


I'm talking about the Z80 of course, no offense.
But maybe it's a joke !?  :)
Sorry, english is not my mother-tongue.


May 10, 2011, 03:05 pm Last Edit: May 10, 2011, 03:07 pm by Graynomad Reason: 1
I take back some of what I said before, given that we've determined the chip is static you could probably make a sort of CPU emulator that controlled the clock and looked at addresses then supplied data. A sort of hardware-based simulator.

Here's a good reference page


Rob Gray aka the GRAYnomad www.robgray.com


May 10, 2011, 03:25 pm Last Edit: May 10, 2011, 06:15 pm by bozgrul35 Reason: 1
Rob, that's exactly what I had in mind.
In fact, I read a blog page a few days ago,
where the author gave good explanations about the Z80.
And he did the same page about the 6502 (I'm expecting one,
bought on ebay) but explained the difference, because of dynamic  registers.
"... It is worth noting that the Z80 is the only major computer CPU in the history of microelectronics that does not use any dynamic registers. Dynamic registers function much like dynamic RAM (DRAM) in that they must be constantly refreshed, or they lose their contents. Virtually every other CPU that was widely used, from the 6502 to the 80x86 family, uses these dynamic registers, and so they have a minimum clock speed which must be maintained for them, or their dynamic registers will lose their contents. The Z80 is so stable that it can actually be stopped at a standstill and still not lose its data. In fact, you can even set up a circuit to hand-clock it with a push-button switch. (If you do so, however, you must connect the button to the clock input pin through some stabilizing circuitry so that it produces a clean rise and fall, instead of a ragged, unsteady rise and fall.) ..."

I didn't find this site (http://www.z80.info/) before, even if I have searched a whole lot of ones the last few days.
Looks promising!


It is worth noting that the Z80 is the only major computer CPU in the history of microelectronics that does not use any dynamic registers.

Not so; the 6800 and the 6809 were both also fully static.


May 10, 2011, 05:10 pm Last Edit: May 10, 2011, 05:18 pm by Grumpy_Mike Reason: 1
Also the Signetics 2650 was fully static and pre dates the Z80 by a couple of years.
It was used in the first Phillips games consoles and was the first Micro computer I built in 1975. I used it in a couple of embedded systems as well, including the first micro processor controlled ham radio repeater in the U.K. in 1976.

My first computer - home built and designed


Remember the days of stacking eight 1 x n bit RAM chips and bending out the data pin sideways to save on sockets and wire-wrap joints?

<oxbridge Yorkshire accent> And you tell that t'young people today; they won't believe you. </oya>


Luxury we used to dream about eight 1 x n bit RAM chips.


Just found an unused Z80B in my parts box!
I know somewhere in my "filing system", I have a diagram for a five chip Z80 board (processor, EPROM, 6116 RAM, UART and PIO).

Hmmm, this could be a long night.


This has been a pretty fun thread to read; I've got a handful of Z80 processors scored from my favorite haunt, Apache Reclamation, here in Phoenix. They've got a back room (full of NOS vaccuum tubes) with these drawers filled with various ICs in tube carriers - I'm sure in one of them is a cache of Z80 processors (found some 6809P once). Heh - in one of the bins there they had a wire-wrap prototyping board - pretty large, lots of area on the top-side, tons of gold plated pins sticking out from the bottom. I wanted to buy it, but they wanted something close to $100.00 for it - well beyond what I was willing to pay (interestingly, years ago they sold me an Altair for about the same amount).

What I don't understand from the OP - is why did he remove the Z80 from the Amstrad CPC? That was his Z80 computer right there; he would've been better off fixing/restoring that machine (its not like they're making more - and these old PCs and such are only climbing in value as the years go by - I was perusing Apple IIe hardware the other day, and saw that while the prices for a system weren't high - they weren't that low, either; still - cheap compared to an Altair system, which is why I consider myself lucky to own one - albeit in non-working condition right now).

I'm sure somewhere on the internet is an Amstrad club or users group of some sort...maybe.

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


After I got bored toggling in programs (no cassette storage and no UV-EPROM programmer), I bought a Nascom 1, but still couldn't afford an assembler, so I became very adept at hand-assembly - I still remember that "INC HL" is 0x23.
How sad is that?

Not sad at all. Hey, I still think back fondly on my days writing Macro-11 on PDPs. How can you not like an instruction set that contains SOB (Subtract One and Branch). Back then, we worked pretty hard to write really good, clean, elegant, efficient code. I'm guessing any newer embedded system these days has more RAM than we did, and we ran the OS and DECnet, plus our applications. Those were (mostly) fun times.
... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier


It's very late, I've spent a lot of time trying to make that thing work,
but... it doesn't!
This is how I connected the whole thing: (sorry, didn't find time to draw
a schematic, and I have no dedicated software. Do you know good, open-source ones?)

- not connected:
A4-A15 (I only watch A0-A3)
- to Arduino 5V :
- to GND:
Vss, D0-D7
- to arduino:

When I power this on, without any resistor before GND, the CPU overheats
very fast (even if I clock the CPU at 1 Hz... it seems strange to me), and I unplug
it 'cause I'm not sure it won't break.
If I use a resistor, it takes time to heat, but enventually will. And it doesn't work the same.

My sketch is the following :
setup :
set arduino clk & reset to output, arduino A0-A3 to input
reset <- low
clock <- low
every 500 ms, switch the clock output from low to high or high to low
after 3 s, reset <- hi
read A0-A3. if result is different than previously read, display.

When I use a resistor, I've got a fixed 1111 result from A0-A3.
When I don't, it alternates very quickly between 1111 and 0111. (faster
than the clock). But I didn't think of MREQ, maybe I have to check its
value too before displaying A0-A3.

So, still I'm stucked... but I go on searching.
BTW, Rob, thanx for the http://www.z80.info website, I think I will try to
setup the minimum Z80 CPU test circuit (http://www.z80.info/z80test0.htm),
seems a good way to find if the CPU is still OK, and if there is any problem with
the heat...

Time to sleep, I will just try the MREQ thingy before (or I won't be able to sleep!). See ya.




You can't supply a clock signal to the Z80 from an IO port, you need a high frequency, about 2-4MHz.

You can generate upto 8MHz with any of  the timers on the ATmega  by directly programming them.  

The original Z80 should get hot, its NMOS!  Max current 150mA so nearly a watt of heat dissipation (at any clock frequency).  The datasheet says static by design but parts only tested down to 5kHz.  Have you measured the supply current - if its greater than 150mA you can be sure its fried or overloaded.

I suspect any replacement Z80 you can find these days is CMOS and much less power hungry.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


Well, MREQ is alway low (active), A0-A3 is always 1111...
Time to go to bed !



Hello !

So, I've tried a new circuit, the Z80 test circuit from z80.info (http://www.z80.info/z80test0.htm),
to be sure that the Z80 was working correctly by itself, before going on.
And the result is... the circuit is not working. But I can't tell right now if it's the Z80 that's not working
or a mistake of mine, during the assembly.
A lot of heat, no LED on.... (btw, I assume that the Z80 can overheat even if it's broken. Is it right ?)
I've made a few checks with my voltmeter, and found some weird results : the resistors next to D0-D4 (or D3, not
sure) show something around 1V, the next one (D5 or D4) is 2.5V, and the remaining ones (D6-D7 or D5-D7) are 0V.
It doesn't seem right, but what can it mean, I cannot tell...
I've orderded a few Z80s from Jameco, because I don't know french shops that sell Z80s. So I'll have to wait a few
weeks maybe... (btw, do you know european shops, where shipping might be quicker - and cheaper ?)

During this time, I will try to do the same thing with a 6502 I've just received from eBay. I have more confidence
in it, so maybe I'll be able to make it work (even if it works differently, the clock for instance...).

I'll tell you as soon as I have any interesting results (w/ the arduino, of course!).



Sorry I don't get the D0-7, there are only 3 diodes on that schematic and they are LEDs.

I assume that the Z80 can overheat even if it's broken. Is it right ?

Yep, it could go either way depending on what's cactus.
Rob Gray aka the GRAYnomad www.robgray.com

Go Up