Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help debugging a simple Z80 tester circuit

Status
Not open for further replies.
I'm trying to build this circuit: http://www.z80.info/z80test0.htm

I can't for the life of me get this to work. I have among other things tried 7 different CPUs and various switches. If anyone could please look for obvious mistakes or something weird I'd be grateful. I'd really like to get this to work after spending so much time with it. It shouldn't be that hard.

The idea with this circuit, which I fully understand, is to give the CPU the same instruction all the time and watch the address bus increment. This is realized through that the data bus lines are all pulled low. This makes the CPU read a NOP (No Operation) opcode, execute it, and increment the address bus. Again it will fetch a NOP, since the data bus is always hard-wired to give it NOPs. Yet, the address bus will increment, and eventually wrap around.

Expected results:

The address bus should start counting. The LEDs should flash when this happens. A0 should blink at 12 Hz (since I'm giving it 12 Hz) and A1 should blink at 12/2 Hz, A2 at 12/4 Hz.

Actual results:

All address lines are pulled high! The LEDs light up, and stay lit. But it is not limited to just A0, A1, and A2, all of them are like this. I've checked.


This is my progress/circuit so far:

I have a two-transistor oscillator circuit on the right, and the Z80 on the left, with three LEDs attached to the address bus. The data bus is all pulled to ground by 470 ohm resistors as in the original circuit. The two wires running off screen are for the switch. +5 volts is given on the upper rail, ground is on the bottom rail, both by wires running off screen to a power supply.

I have verified that the clock signal from the oscillator circuit appears good at around 12 Hz as seen in one of the attached images.

**broken link removed**

**broken link removed**

**broken link removed**

**broken link removed**

I have tried 7 different Z80 CPUs (6 from a batch from eBay, 1 from a parts bin), all have the same result. I have tried 3 different switches, all with the same result. I have tried a clock signal at less than 1 Hz and around 12 Hz (by changing the capacitors in the oscillator circuit), again there is no difference. With < 1 Hz it takes some seconds before the LEDs turn on, but once they do, there is again no counting.

I have tried to start the circuit and hold RESET both low and high, it doesn't matter. It should be noted that when powering the circuit on while holding RESET low, the LEDs will turn on for a brief second, then turn off again.

I = 106.7 mA (starts at 108.7 and gets reduced over time)
U = 5.13 volts

Without Z80:

I = 10.97 mA
U = 5.13 volts

A11 (pin 1): Floating.
A12 (pin 2): Floating.
A13 (pin 3): Floating.
A14 (pin 4): Floating.
A15 (pin 5): Floating.
CLK (pin 6): Connected to 12 Hz square wave, verified to be good on oscilloscope.
D4 (pin 7): Connected directly to ground.
D3 (pin 8): Connected directly to ground.
D5 (pin 9): Connected directly to ground.
D6 (pin 10): Connected directly to ground.
+5V (pin 11): Connected to +5 volts.
D2 (pin 12): Connected directly to ground.
D7 (pin 13): Connected directly to ground.
D0 (pin 14): Connected directly to ground.
D1 (pin 15): Connected directly to ground.
INT (pin 16): Connected to +5 volts.
NMI (pin 17): Connected to +5 volts.
HALT (pin 18): Floating. (Note: HALT is an output pin!)
MREQ (pin 19): Floating.
IRQ (pin 20): Floating.
RD (pin 21): Floating.
WR (pin 22): Floating.
BUSAK (pin 23): Floating.
WAIT (pin 24): Connected to +5 volts.
BUSRQ (pin 25): Connected to +5 volts.
RESET (pin 26): Connected to +5 volts via 470 ohm resistor, pulled to ground when a switch is toggled.
M1 (pin 27): Floating.
REFSH (pin 28): Floating.
GND (pin 29): Connected to ground.
A0 (pin 30): Connected to LED via 470 ohm resistor.
A1 (pin 31): Connected to LED via 470 ohm resistor.
A2 (pin 32): Connected to LED via 470 ohm resistor.
A3 (pin 33): Floating.
A4 (pin 34): Floating.
A5 (pin 35): Floating.
A6 (pin 36): Floating.
A7 (pin 37): Floating.
A8 (pin 38): Floating.
A9 (pin 39): Floating.
A10 (pin 40): Floating.

Again, what am I doing wrong?

Do I need to reset it in some specific way? Should I hold down RESET when I give it power, or not? As mentioned I've tried both.
 
Last edited:
One thing occurred to me , The BB doesn't have a split power rails ( half way ) check each side the red paint ...
 
Look a this image.
Links in Black.
E
Whats your location.?
 

Attachments

  • index.jpeg
    index.jpeg
    15.1 KB · Views: 261
A good suggestion, but this is not the problem.

I've just checked, and there is full continuity along both rails that are in use, +5 and ground. I've drawn one red (for +5 volt rail) and black line (for ground rail) to show what pins on the rails are actually verified to have continuity.

**broken link removed**

ericgibbs: My location is in Norway.
 
The BB looks exactly the same make as the one I have in my photos it has no connection between holes 32 - 34 on the + and - rails both sides . did you take out all the +- wires to test it ? could be paths through the chip , 100mA is going somewhere Is the BB back visible ?
 
I managed to find 5 Z80 CPUs so I built the test circuit again. I still did not fit the 470 ohm resistors tying the data lines to ground (Just tied then straight to ground.) I did build the oscillator with the 4093 this time rather than use an external pulse generator as I did last time I built it. The circuit worked with all 5 CPUs but most of them consumed more current than I expected.
Here is a table of the CPUs and the current that they consumed.

Sample 1 Consumes about 20 mA
Manufacturer ST
Z84C00AB6
Z80ACPU
29113Z

-------
Sample 2 Consumes about 80 mA
Manufacturer SGS
Z8400AB1
Z80ACPU
28309 ITALY

-------
Sample 3 Consumes about 80 mA
Manufacturer MOSTEK
MK3880N-4IRL
Z80-CPU

-------
Sample 4 Consumes about 80 mA
Manufacturer ZILOG
Z8400 PS
Z80 CPU
8408

-------
Sample 5 Consumes about 130 mA
Manufacturer Zilog
Z0840004PSC
Z80 CPU
8809

I suspect that sample 1 is a CMOS version.

Les.
 
The BB looks exactly the same make as the one I have in my photos it has no connection between holes 32 - 34 on the + and - rails both sides . did you take out all the +- wires to test it ? could be paths through the chip , 100mA is going somewhere Is the BB back visible ?

I truly wish the problem was as simple as this.

I've checked once without removing all the wires, then just to make sure I checked with removing all wires as well after I read your comment.

I tested every single hole on both rails, everything is connected to everything. I especially tested holes 32 - 34 extra thoroughly, I also got a tone on everything from 1 to 63 on both rails.

It seems your BB has a slightly wider gap between hole 34 and 35. The line should be broken there to make it clear and intuitive, but my BB has no such wider gap, everything is connected.
 
I managed to find 5 Z80 CPUs so I built the test circuit again. I still did not fit the 470 ohm resistors tying the data lines to ground (Just tied then straight to ground.) I did build the oscillator with the 4093 this time rather than use an external pulse generator as I did last time I built it. The circuit worked with all 5 CPUs but most of them consumed more current than I expected.
Here is a table of the CPUs and the current that they consumed.

Sample 1 Consumes about 20 mA
Manufacturer ST
Z84C00AB6
Z80ACPU
29113Z

-------
Sample 2 Consumes about 80 mA
Manufacturer SGS
Z8400AB1
Z80ACPU
28309 ITALY

-------
Sample 3 Consumes about 80 mA
Manufacturer MOSTEK
MK3880N-4IRL
Z80-CPU

-------
Sample 4 Consumes about 80 mA
Manufacturer ZILOG
Z8400 PS
Z80 CPU
8408

-------
Sample 5 Consumes about 130 mA
Manufacturer Zilog
Z0840004PSC
Z80 CPU
8809

I suspect that sample 1 is a CMOS version.

Les.

Great effort, thank you.

Mine are Zilog Z84C0020PEC and ST Z8400AB1.

I will find an identical model of the CPU and see if that makes any difference.

What kind of switch did you use for the reset line?
 
RESET (pin 26): Connected to +5 volts, pulled to ground via pull-down resistor when a switch is toggled.
If this is the case you are not reseting it ... ( cant quite make it out from the photo)...
This should be ... Reset ( pin 26 ) Pulled up to 5v via a resistor . grounded by the switch. ( a small capacitor ( pin to GND ) would help with debounce)

According to DS , 20mA is about right correct for a CMOS Z80 running at < 1Mhz, NMOS 4 times !
 
Last edited:
I agree with granddad. If the reset pin is tied to 5 volts then you can't reset the CPU. Why did you not wire it as in the schematic ? The switch I used was one of the square tactile switches about (About 6.2mm square.) If you use one of these with 4 pins you have to make sure it is not rotated by 90 degrees as this will make it permenantly closed. The switch is not critical. just shorting the reset pin to ground with a screwdriver or bit of wire works.
I found a sixth Z80 CPU this morning.

Sample 6 Consumes about 20 mA
Manufacturer SGS
Z84C00AB6Y
Z80ACPU
28732

I also fitted the 8 470 ohm resistors tying the data lines to ground. My circuit is now exactly the same as the diagram and all 6 CPUs work.

Les.
 
Les Jones and granddad, I'm sorry I made a mistake in the pinout listing I wrote, but not in the circuit itself. It is connected as in the schematic and always has been. It is not connected directly to +5 volts but via a 470 ohm resistor. It gets pulled to ground when the switch is toggled.

I have updated the pinout listing. Sorry about that.
 
I've tried to label where the reset line is connected here:

**broken link removed**

It is not connected directly to +5 volts but via the resistor as in the original schematic. I've also verified that it (the reset pin) is +4.8 volts or so when the switch is not pushed, when the switch is pushed the reset pin is 0 volts.

Here I'm using a switch that I think might be similar to what Les Jones is describing:

**broken link removed**
 
Hi HE . Frequency is not the question , your CMOS Z84C0020 will go from DC to 20Mhz , I question the oscillator you have is not providing fast rise and fall times ( green arrow 4 also 5 ) I dont have timings for 20Mhz chip but 10M is 10ns ... your transistors need a logic gate like 74HC14 ... Or use a 4093 as in original circuit...
zclk.png
 
Hi HE . Frequency is not the question , your CMOS Z84C0020 will go from DC to 20Mhz , I question the oscillator you have is not providing fast rise and fall times ( green arrow 4 also 5 ) I dont have timings for 20Mhz chip but 10M is 10ns ... your transistors need a logic gate like 74HC14 ... Or use a 4093 as in original circuit...
View attachment 100110

Good suggestion, thank you. I will try something else.

I have just ordered some 4093's. Will update once I have tried.
 
Hi granddad,
I think you have the solution to the problem with the rise time of the clock waveform. I did an experiment by slowing the edges of the clock waveform down with a CR network. The circuit worked with a rise time of up to about 300 nS but stopped working with any more than that. (I only tried with one of the CPUs) I thought that the OP had originally built the circuit to the diagram. The picture of the clock waveform in post #1 of this thread shows the slow edges. Even with the rise time slowed down to about 3 uS the slope is not visible when showing a full cycle of the waveform.

Les.
 
Until receiving those 4093's the OP could implement a simple 2-transistors Schmitt trigger to keep going with his test.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top