Author Topic: Z80 won't run  (Read 3013 times)

0 Members and 1 Guest are viewing this topic.

Offline SchwuuuuupTopic starter

  • Newbie
  • Posts: 7
  • Country: de
    • fullcircle.de
Z80 won't run
« on: July 30, 2024, 09:34:00 am »
Hi, I'm a noob (with retro computers as well with this forum) If I'm wrong here with the following question, please direct me where to go.

I decided to do an educational project with my trainee at work, where we both learn, how CPUs and Computers work. I'm way ahead of him on the theoretical side, but never did it in practice, so I thought, this might be fun and interesting for us both.

We picked the Z80 as a CPU for its easy single-stepability and are at the point where we try to let the CPU run for the first time.
So we
  • Connected GND and VCC
  • Pulled down all Datapins via 10K to GND (as a NOP-Generator)
  • Pulled up INT, NMI, RESET, WAIT, BUSREQ

There is a button to GND for Reset as well. (which works correctly - I checked, the pin at the CPU is HIGH and goes LOW when I press the Reset-Button)

We tried to clock it with another Button and tried the 1KHZ test-square-wave of my oscilloscope. (It's 3V so we also tried it using an Inverter, that produced a nice 5V square wave)

I expected M1 (or RFSH for that matter) to "do something" but as far as I can tell, they are just floating as if the CPU wasn't even powered on.

I have 4 used Z84C0008, for now I could only test 3 of them, but they all behaved the same. Maybe I got ripped off by the seller and got sent only dead ones. But as I am new to this hardware stuff, I really have no clue if I do something stupid.

Any clue, what I might do wrong, or a simple failsafe test, if the CPUs are working at all, would be appreciated.
 

Offline glenenglish

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: au
  • RF engineer. AI6UM / VK1XX . Aviation pilot. MTBr
Re: Z80 won't run
« Reply #1 on: July 30, 2024, 09:44:06 am »
1) Clock cannot be  not static (NMOS) - it has asynchronous paths
2) do you have bypass caps on the device ?
3) yes could be a scam.

 

Offline SchwuuuuupTopic starter

  • Newbie
  • Posts: 7
  • Country: de
    • fullcircle.de
Re: Z80 won't run
« Reply #2 on: July 30, 2024, 10:16:03 am »
No bypass caps yet - Thanks I'll try, but I doubt that will help... what I just remembered: I checkt if the CPU draws any power on the power pins... and there was nothing...

Will a functional Z80 draw at least some mA when connected to VCC and GND, regardless what else is connected? Than I'm sure the chips are dead.

The part about the clock seams strange to me. AFAIK the Z84C0008 has static ram registers and the datasheet states "DC to 8 MHz" for the CMOS version Z84C00 should be CMOS while Z08400 should be NMOS... But I'll verify that I have the correct version
 

Offline fchk

  • Frequent Contributor
  • **
  • Posts: 375
  • Country: de
Re: Z80 won't run
« Reply #3 on: July 30, 2024, 10:18:59 am »
Look here for a working system:

https://www.ndr-nkc.de/compo/z80/index.htm

+ Always put 100nF X7R ceramic between EACH VCC-GND pair using minimal wire/trace length.
+ no open CMOS inputs (TTL/NMOS may not be so sentitive)
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2270
Re: Z80 won't run
« Reply #4 on: July 30, 2024, 11:35:32 am »
The CMOS versions are static and can be clocked down to DC. However, the clock does require fast rise and fall times. The datasheet that I have specifies the clock rise and fall times of 10nS maximum, for the 8MHz part.
Other inputs may have similar requirements for correct operation. Have you debounced the reset switch ?

Will a functional Z80 draw at least some mA when connected to VCC and GND, regardless what else is connected?
The datasheet quotes a maximum "standby" current of 10\$\mu\$A for a stopped clock (other conditions may apply).
 
The following users thanked this post: Schwuuuuup

Offline pqass

  • Super Contributor
  • ***
  • Posts: 1087
  • Country: ca
Re: Z80 won't run
« Reply #5 on: July 30, 2024, 12:17:05 pm »
See here for a Z80 tester. 
Although, I'd try a faster (>100KHz) clock and move the LEDs to A15,A14,A13.
Also, adding a 100nF cap across the reset button will automatically reset the Z80 on power-up.

When you graduate from the tester stage, see Grant Searle minimalist Z80.
 
The following users thanked this post: radiolistener, horo

Offline glenenglish

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: au
  • RF engineer. AI6UM / VK1XX . Aviation pilot. MTBr
Re: Z80 won't run
« Reply #6 on: July 30, 2024, 10:13:46 pm »
No bypass caps yet - Thanks I'll try, but I doubt that will help...
why do you doubt that will help ? WHere are the high instantaneous currents for the CMOS logic going to come from otherwise without glitching ???
All logic, especially CMOS logic, must have low inductance power supplies, as they might draw 100x the max average current during internal logic switching from 1 to 0 and 0 to 1 all over the chip.
 
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5381
  • Country: Earth
Re: Z80 won't run
« Reply #7 on: July 30, 2024, 10:55:02 pm »
Using button to simulate clock is not reliable way, because button down/up produces a bunch of pulses with different length.
 

Offline rich t

  • Contributor
  • Posts: 49
  • Country: us
    • rtestardi's github pages site
Re: Z80 won't run
« Reply #8 on: July 30, 2024, 11:11:08 pm »
I found this which looked like what you are trying to do, image below.


Good for you -- this is the only way to really learn -- there is no substitute for watching an address bus and understanding stack layouts in binary.


The next step is to add DMA switches (address and data) and LEDs that can read and write RAM and then let the program rip!


You can find some simulators on line at that level as well, though the javascript ones I tried failed the most basic test of 0x3e, 0xaa, 0x76 (many of us still remember op-codes from those days!).


 
The following users thanked this post: MK14

Offline pqass

  • Super Contributor
  • ***
  • Posts: 1087
  • Country: ca
Re: Z80 won't run
« Reply #9 on: July 31, 2024, 02:21:48 am »
If you're into switch flipping, the project below wins on simplicity, ingenuity, and execution (wait for it until 1:50).
It's only a bit more complicated than the tester above but you'll learn a lot and be able to brag about doing sw dev "the hard way"TM.

See project overview here.




 
The following users thanked this post: rich t

Offline SteveThackery

  • Super Contributor
  • ***
  • Posts: 2066
  • Country: gb
  • 50 year novice
Re: Z80 won't run
« Reply #10 on: July 31, 2024, 04:31:51 pm »
When you graduate from the tester stage, see Grant Searle minimalist Z80.

Hey, cool, he has done a minimalist 6809 computer as well! I think the 6809 was the finest 8-bit micro ever made. Some useful 16-bit elements inside, plus a beautiful instruction set which was largely orthogonal and allowed for position-independent code. (Mind you, I never had much use for that. ;D)

Oh, and on the subject of religion (because that's what it felt like back then), he has also done one based on the 6502, which I think is the most over-rated 8-bit micro ever.
« Last Edit: July 31, 2024, 04:39:44 pm by SteveThackery »
 

Offline bson

  • Supporter
  • ****
  • Posts: 2662
  • Country: us
Re: Z80 won't run
« Reply #11 on: July 31, 2024, 10:01:24 pm »
You really want a capacitor on the reset so you get a proper reset on power-on.  Some might also put a resistor in series with the cap to debounce and reduce the discharge current, although millions of shipped boards out there have worked fine without it.

 

Offline glenenglish

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: au
  • RF engineer. AI6UM / VK1XX . Aviation pilot. MTBr
Re: Z80 won't run
« Reply #12 on: July 31, 2024, 11:59:07 pm »
even that can be a poor reset because the rise time is too slow.
That circuit is wayyyyyyy too slow

Suggest a 1nF cap and 1k resistor.

or use a RC one shot monostable cmos ic (4528, 4538 or 74xx123 etc) or a reset ic....
 

Offline bson

  • Supporter
  • ****
  • Posts: 2662
  • Country: us
Re: Z80 won't run
« Reply #13 on: August 01, 2024, 07:47:44 am »
Oh yeah, definitely use sensible values.  Like 0.1µF and a 1k resistor.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4548
  • Country: us
Re: Z80 won't run
« Reply #14 on: August 01, 2024, 08:39:48 am »
See also: https://hackaday.io/project/159973-z80-mbc2-a-4-ics-homebrew-z80-computer
4 chips, all readily available.  No difficult-to-program EPROMs, no rare IO chips.
Add an SD card module to simulate floppies, and it runs CP/M.  Also runs BASIC and/or Forth from "ROM."

Do let us know if you figure out what's going wrong with your current experiments.  They do seem worthwhile and educational.
 

Offline SchwuuuuupTopic starter

  • Newbie
  • Posts: 7
  • Country: de
    • fullcircle.de
Re: Z80 won't run
« Reply #15 on: August 01, 2024, 02:52:25 pm »
Hi folks,

thanks for all the good advice.

I had a colleague check my Z80 and know now that is in deed working.

A bypass cap did nothing, as i thought, becaus the was essentially nothing happening on the powerpin.

But thanks to you I realized how tight the requirements are for the edges of the clock. 10ns ... the Signalgenerator I was using gave 1000mn from 0 to 5v and 700ns from 0.5-2V ... so way too slow.

I followed a guide, in which a 7414 was used, but this was only called "HexInverter" and only was "for debouncing" the fact that it is a Schmitt-Triger inverter was not mentioned and escaped me.
I was using a HexInverter as well - mainly to be sure that the clock had a 5V high since my signal generator just gave 3V, so I did not think much about it. Unfortunatly I just had a CD4069 at hand which is much slower.

I will go to my parts bin later and see if there is anything resembling a schmitt-trigger later.... and then I will try again next week.

Thanks for all the helpful clues
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17049
  • Country: fr
Re: Z80 won't run
« Reply #16 on: August 01, 2024, 09:09:42 pm »
Ah yes for the clock you need fast enough edges whatever the frequency is. So yes, if you say control the clock with a pushbutton, you need debouncing and a schmitt trigger.

Even if it wasn't your issue, you should still use proper bypassing on the power supply pin(s).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf