Retro Z80: CPU Test Circuit

There is this simple test circuit that allows you to test your Z80 CPU in a very basic way. There are several incarnations and I have found several YouTube videos, but I will link in the site.

So I took out the bread board and set to work and got the NE555 running with a nice enough clock pulse. I put in a pot to be able to vary the clock frequency a bit. Then I plugged in the Z80 and connected all the wires and resistors. I used a segmented LED bar for visualizing the address lines, but initially only connected 3 address lines.

Then I turned it on and no lights… Doh! I always forget that the outer power tracks are divided in two on this bread board. So after placing a jumper wire, it worked.

I thought it would be cool to use all the LEDs in the LED bar so I connected the other address lines (A0-A9) too.

That worked nice and you could see the binary counting of the address lines… But wait, why is A7/LED 8 and higher blinking!?

Here is a YouTube video I made of my test circuit where you can see in action.

First it starts slow, then there’s a short segment that’s really  fast, then at the end, you can see the blinking.

So why do you think that is?

Remember that the Z80 also does DRAM refresh. For the NOPs we’re executing 2 clock cycles are spent using the address bus to access memory, and the last two cycles are used to refresh the DRAM. During the refresh the lower 7 bits of the address bus (A0-A6) is set using the contents of the R register. The other address lines are reset to zero (this is actually the I register and the I register is zeroed out on reset). The R register is incremented at every instruction (M1 cycle, the first 2 clock cycles) and so, in this case, are synchronous to the counting of the address lines.

The blinking red led on the left side on the video is on when the REFRESH line is active (low). It is perhaps a bit hard to see on the video, but if you slow it down, you can see the upper address lines (A7-A9) are on when REFRESH is off and visa versa.

You don’t realize that immediately (at least I didn’t) when you see the circuit and the video’s other people made. They usually have only 3 LEDs on there.

Learned something today.


Published in: on December 22, 2015 at 3:51 pm  Leave a Comment  

The URI to TrackBack this entry is:

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: