• Please review our updated Terms and Rules here

z80 NMOS / CMOS differences

Joined
Jul 3, 2009
Messages
21
Location
Hebden Bridge, UK
Hello all,

I've just acquired a CMOS z84c0008PEC hoping to use it as a direct replacement for the Z0840004PSC in my homebrew project.

It works but only at reduced (<2MHz speeds) whereas the NMOS part works ok up to about 5MHz

Any ideas? Is the CMOS part more fussy about loadings / timings?

Cheers

Dom
 
Without knowing more about your project, it's hard to say. One aspect of the CMOS part, however, is that the output capacitance is about 50% higher than the NMOS part. Depending on how you're loading the output pins, that could be very significant.
 
Hi Chuck,

Thanks for responding.

I've just posted the latest schema to http://z80homebrew.blogspot.com/ (sorry its a bit crowded but I don't know how to cut and paste to heirarchical sheets in Kicad!)

The only thing I can think of at the moment is that the D[0..7] lines between the processor and the buffers haven't got pull-ups. I'll try adding these as this was an oversight! (The bus lines and the buffered memory card have got pull ups).

I'm pretty new to all this proper digital stuff I usually make things with tubes (radio valves)!

Dom
 
Well, I just tried adding some 4k7 pullups and the situation has got worse!

It now will only run at 1MHz! The NMOS part still goes fine at 4MHz....I am now officially confused :crazy:

Would 4k7 be too big a pull up?

Dom
 
It doesn't look too bad, but then I've always been suspicious of the duty cycle of a simple inverter-based crystal oscillator. When I've had to use one, I've always made it for 2x or 4x the frequency needed and then used a high-speed flip flop (e.g. 74AS74 if we wanted to be period-authentic) to generate a clock with a 50% duty cycle. ( I note that you have a clock divider notated, but not included on the schematic.) I'd also buffer the off-board clock separately from the clock used to feed on-board logic.

I also know nothing of your layout, so take everything I've said with a couple kilos of sodium chloride.

No, a 4k7 pullup would not be too large, but if you were having noise issues, might make the problem worse. What's your decoupling situation?
 
The 8Mhz part should work fine. I've got all sorts of Z80 chips and can drop any of them into a circuit. You certainly can run an 8Mhz at any frequency less than 8Mhz. Max 2Mhz is very odd.

If it won't work at higher speeds there are lots of possibilities.

First, a CRO on the xtal oscillator will help determine if it is a square wave. I used to use those osc circuits built around nand gates, but Andrew Lynch of N8VEM fame has got me to really like the osc modules http://www.futurlec.com/ICCrystalsOscillators.shtml Use a 14 pin socket and you can drop in different modules easily.

Second, there are the wires and layout. Long wires = problems. Is this a PCB or a breadboard layout or a point to point layout?

Chuck's suggestion of decoupling caps is the next one. 0.1uF physically next to each chip? And what does the power supply schematic look like?

Would you be interested in joining the N8VEM group? We have been building boards for the last few years and there are designs that work (Andrew's, and *some* of mine), and there are ones that don't (the rest of mine). The designs that don't work have been very useful in their way. One thing for instance is to put the big chips in the middle and put the support chips around them. Also, after two years of using Eagle, I worked out how to make the tracks a lot closer, and keep the vias away from the IC sockets (avoids solder bridges) and so the chips can end up much closer together and that not only makes the board smaller, but also makes the tracks shorter.

I haven't found a need for ground planes or anything fancy like that. At least up to 8Mhz anyway. And you don't need pull-ups on data and address lines.

Is it possible to post the entire schematic and also a photo of the board?

Addit: I just thought of another thing - the other gates on U9 - are they floating or used somewhere else?
 
First, a CRO on the xtal oscillator will help determine if it is a square wave. I used to use those osc circuits built around nand gates, but Andrew Lynch of N8VEM fame has got me to really like the osc modules

I find that it's easier nowadays to find them in odd frequencies than similar crystals. I like the half-size ones that fit in an 8-pin DIP socket. With the prices, it doesn't make much sense to do it any other way. Saves bother and real estate. And they're available in SMT.
 
It doesn't look too bad, but then I've always been suspicious of the duty cycle of a simple inverter-based crystal oscillator.

I'd suspected duty cycle too but I thought as the CMOS z80 will go from DC->8MHz it should be ok, anyway I don't now think its duty cycle...more later

When I've had to use one, I've always made it for 2x or 4x the frequency needed and then used a high-speed flip flop (e.g. 74AS74 if we wanted to be period-authentic) to generate a clock with a 50% duty cycle. ( I note that you have a clock divider notated, but not included on the schematic.) I'd also buffer the off-board clock separately from the clock used to feed on-board logic.

The divider is a simple 4 bit counter, to give /2, /4, /8, /16 and /32 clock rates for testing. 2..16 are 50% duty whereas /32 is a carry out so has odd characteristic of 1:32 duty cycle.

Good point, I'll buffer the off board clock line through a spare '244 line.

I also know nothing of your layout, so take everything I've said with a couple kilos of sodium chloride.

Its pretty hairy wirewrap. See attached pictures, though it works nice and reliably at 4MHz on the NMOS part....

What's your decoupling situation?

Each chip has a 100nf ceramic decoupler soldered to the power pins, the CPU in addition has a 100uF electrolytic cap (though that made no difference to current problems).

I've also tried various power supplies. At the moment the whole thing is running of a large "Farnell" Linear power supply - not sure of its output rating but at a guess looking at the circuit I'd say at least 5A and this only draws <500mA when the LED board is disabled.

...

First, a CRO on the xtal oscillator will help determine if it is a square wave. I used to use those osc circuits built around nand gates, but Andrew Lynch of N8VEM fame has got me to really like the osc modules http://www.futurlec.com/ICCrystalsOscillators.shtml Use a 14 pin socket and you can drop in different modules easily.

The only scope I've got is pretty useless, it shows huge spikes and ringing but I've no idea whether its the scope or the circuit! I'll try and get a better scope!

...
Would you be interested in joining the N8VEM group?

I've joined and am watching, but I'd already started in on this project. I really want to design my own thing this time round though hope to join in later, I'm aiming to add a bus adapter at some point so I can plug in your cards though...

...
Is it possible to post the entire schematic and also a photo of the board?

Addit: I just thought of another thing - the other gates on U9 - are they floating or used somewhere else?

I'll post updated schematics to my blog later but the only bit missing from the CPU board is the clock divider

All the gates that are unused are tied to 5V, not marked on the updated schema is that I used the last NAND left as a buffer but it made no difference...

I changed the circuit last night to try and get and improvement in how the buffering works as using /WR for both the input and output buffers means that they "fight" during the transition period. I now use /RD or /M1 to enable input instead.

This made no difference to running at 4MHz the NMOS part is now ok but the CMOS part is still no go.

However it will run, albeit very unreliably with random crashes, at 6MHz now or at 2 or 3MHz - curiousor and curioser!

I'm beginning to suspect the clock now is putting out noise or some such as the CMOS part will not work at all at any speed if any of the clock or divided clock lines is being scoped (even the low speed ones when running at another low speed).

So far I've avoided "modules" for clocks as I like to build as much as I can myself and understand what is going on, but I agree now that I may have to bite the bullet and actually buy something! Though I would still like to track down the actual problem...

Cheers

Dom
 

Attachments

  • DSCF0018-s.jpg
    DSCF0018-s.jpg
    68.3 KB · Views: 2
  • DSCF0017-s.jpg
    DSCF0017-s.jpg
    91 KB · Views: 2
  • clockdiv.jpg
    clockdiv.jpg
    10.1 KB · Views: 2
  • procboard.jpg
    procboard.jpg
    27.5 KB · Views: 2
Board looks fine. I've not seen that particular osc circuit before, though I've used one that is rather similar. I guess it should be a square wave if you run it through one more gate as a buffer. Any gate really.

Is the NAND LS or HC? Not that it should really matter. My board are mainly HC but I've dropped in random LS chips with no problems. I guess the more LS, the more you need to watch the power supply wires - eg bring both 5V and 0V to a common central point rather than loop them between chips.

Hmm - I'm running out of suggestions. Maybe the clock circuit. I guess it is worth adding that I've not had any problems with the cmos Z80s. Indeed, they probably are better in terms of putting spikes on the supply rail as they use less power than nmos.
 
Must say I'm pretty stumped, I just sneaked down to the workshop - one benefit of working from home :) and tried a few more things out.

I tried on a slightly better scope and with it hooked up properly all the signals look good to me though a bit slow at 10MHz, but this is a forty year old scope!

Next I spotted one floating input on the '04 and a few on the schmidt (shouldn't matter?) and tied those and triple checked all the decouplers.

Next I robbed a 10MHz oscillator module from an old router.

The results: I now get the following:

10MHz
Neither works! (as expected)
5MHz
NMOS unreliable
CMOS no joy
2.5MHz
NMOS reliable
CMOS unreliable
1.25MHz
Both reliable

Unreliable - enough to work for several seconds, boot to monitor and load program but then program usually crashes
Reliable - runs program for at least a few minutes - not had time to do proper soak test.

It's starting to look to me like either there's some timings that are different for CMOS/NMOS that I'm running into or that I've got a broken CMOS chip! Trouble is I've got nothing to test either in.

Dom
 
Just done a bit more work on the clock circuits. I've now got seperate buffering for the bus and other devices and there is some improvement.

I can now get:

10MHz
Occassionally starts drawing boot screen
6MHz
Works unreliably < 2mins
5MHz
Works unreliably < 10mins
4MHz
Seemingly reliable > 20mins

Thanks for everyones advice - still not sure _why_ the CMOS is so much fussier than the NMOS in this situation though....

Dom
 
The seeming reliability wasn't real! It depended on what program was run anything that used the CTC and the SIO together would crash fairly quickly.

After more testing the CMOS chip was still no good at 4MHz whereas the NMOS was rock solid.

I turned my attention to the memory decoding logic - which was a bit of a mess, with two cascaded '138s and a lot of NORs and NOTs in the path. I've now got this to a more reasonable configuaration (diagram here) and the test programs all seem to run for a good few hours with no problems. So looks like the settle time of the memory is more critical for the CMOS part?

So to answer the initial question: there does seem to be a difference in timings between CMOS and NMOS but not really sure what...

Dom
 
Great to hear a progress update.

Not so great to hear the problems. I'm intrigued by the cmos vs nmos problem though, because with the chips I have it is the opposite. I can't get the nmos ones to go over about 2Mhz (4Mhz chips). But a cmos 6Mhz chip will run fine on the same board. Also some cmos chips run warm and some run cold, and I've even wondered if there are fake chips out there, eg nmos ones marked as cmos (not from zilog I'm sure, but how would you spot a clone from somewhere else?)

Thanks for the link to the N8VEM project on your blog. As an aside I've just had an order for 30 boards arrive today. Mind you, this is version 8 of the board, and each iteration of the design cost about $200 in boards. Later designs have done what you have done and tried to minimise the number of glue chips a signal passes through.

I've had boards that would not work, and then you need to go throough each chip and mark the good ones and swap them in and out. It helps to have a few spares of every chip.

The CTC and SIO thing is very strange. Others may have a comment on these as the N8VEM doesn't have a CTC and the serial comms is done with a 16C450 or 16C550.

Keep us all posted!
 
Back
Top