• The NOP test

    twodogstar12/18/2025 at 07:37 0 comments

    The goal of this test is to verify that the Z80 CPU is functioning correctly. By wiring the CPU up in a basic circuit I can force the CPU to execute the same NOP(no operation) instruction repeatedly and observe as LED's increment. As it increments we see a visual representation of binary counting up on the LEDs.

    Here is the basic circuit:

    As shown the data bus is tied to ground through pull down resistors. The first 8 address lines are wired up with LEDs and current limiting resistors in the schematic. We need a reset switch, several lines tied to the V+ and a clock signal to make the CPU work. Some folks use a crystal oscillator or 555 timer circuit for a clock signal. For my test I used an Arduino Mega to output the clock. It wouldn't be stable and clean enough at high speeds. For visually checking the LEDs though I ran the circuit bteween 5-10Hz and the Arduino worked fine. 

    As mentioned in the schematic it's good to put a capacitor across the power pins. I did not do this for my NOP test. I had no issues. If you do have issues try that as it filters and smooths out the power preventing a voltage drop causing the CPU to miss clock pulses and other stability issues. This can be especially troublesome if you breadboard the circuit as the connectors in the breadboard can cause issues. I believe running my circuit at such a slow speed for this test prevented the issue. As I continue building my system on the breadboards and increasing to higher clock speeds I will be adding decoupling capacitors, 

    Here is the circuit on the breadboard:


    As seen I only wired LEDs to the first five address lines A0-A4. I also wired LEDs to the M1 and RD lines which go through low and high states depending on what action the CPU is taking. Kind of like the heartbeat of the CPU!

    Once everything is hooked up we hook up +5V, push the reset button(in my case I just used a wire I couldn't find my buttons) and then if everything is hooked up correctly and your CPU is functional you should see the address lines incrementing up in binary!

    Here is what it looks like when it passes the test:

    Next steps will be to test the RAM and ROM chips. I will use the Mega as a ROM emulator at first with just the CPU and RAM and then build a circuit so I can flash programs to the ROM with the Mega. Currently waiting on a Ziff socket so I can easily remove and program the ROM chip as I go along building out my system.