Author Topic: Z80 Homebrew Computer - fault finding  (Read 98086 times)

0 Members and 1 Guest are viewing this topic.

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #25 on: March 08, 2017, 03:46:44 pm »
The waveform on the 'scope looks fine, I'm guessing that you have it in the fastest horizontal setting which means (further guess) it is a 20MHz 'scope.

You, sir, are quite spot on.  I'm using a Hitachi V-212 20MHz scope.

Looking at an 8Mhz (or 10, or 11Mhz) square wave on a 20Mhz 'scope is going to allow you to say there is something there and it is oscillating - as the first odd harmonic is 24Mhz it is going to be more than 3dB down so you will get no fidelity in the waveform at all.

I wish I understood all that!  :o  I'm getting from it that there'll be no detail in waveform though, so other than roughly guesstimating frequency, I can't rely on much else?

As to frequency - well, I would not trust a 2nd hand 'scope off ebay (unless I happened to be selling it) to tell the difference between 8Mhz and 11Mhz. I think the possibility of use of the variable timebase knob (accidentally or otherwise) has been mentioned so it is worth checking that the 'scope is correctly set up.

I'll check that tonight but as far as I can tell, I've got Sweep Var and Position knobs - both are centered.  Here's an image of a V-212 - mine is identical, except the Volts/Div knob for Channel 2 is damaged:



I am a little surprised that the design calls for a 7.3728MHz clock. While this is the correct clock frequency for 115200 baud using the 68B50 in clock/64 mode it is too high for the spec which says the maximum Tx or Rx clock is 1.5MHz, it is also pretty high for a Z80 - you can get 8MHz Z80's (the Z80H) but you would have to be careful to order that part and not "just" a Z80.

The build notes provided by Grant Searle on his website quote the design as being 'overclocked', but apparently it has been tested with most variations of the Z80.  Mine is a Z84C0008PEG, so should be good for 8MHz at least.  I've ordered several 3.6864 MHz crystals so I can try to run the system at 'half speed' (obviously adjusting the USB/TTL baud rate accordingly) to see if that produces any results thanks to PA0PBZ's fault-finding ideas.  I'm currently trying to find two 47pF caps to see if I can adjust the timing in the oscillator circuit that way, but I don't think I have any!  :palm:

It is also a very ambitious frequency to have on a breadboard!

Perhaps. Maybe trying the slower clock with a 3.6864 MHz crystal will yield better results...

Finally, if you *do* have an 8Mhz crystal I am not too surprised that your serial comms don't work - compared with 7.3728Mhz that is nearly 8% high - generally RS232 needs the total timing error to be within 5%

On the breadboard I would drop the clock to 1 or 2MHz (divide the 7.37Mhz clock by 4 to give 1.8Mhz which is still over spec for the 8B50 but probably close enough).

No, that was just me being lazy and instead of writing 7.3728 MHz clock, I wrote 8 MHz clock. Sorry!

Okay, so my plan of attack is as follows:

1) Wait for the 3.6 MHz crystals to arrive and make the clock run 1/2 design speed.
2) Adjust serial comms baud rate accordingly (57600 baud?)
3) Fingers crossed.

Whilst waiting for the xtals to arrive, I'll see if I can check that all the chips are getting the right chip select signals and the 68B50 is actually trying to put information out.  ;D
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #26 on: March 08, 2017, 04:02:26 pm »
You, sir, are quite spot on.  I'm using a Hitachi V-212 20MHz scope.
Nothing wrong with that - I used to debug all of my Z80 systems with a 20MHz analogue 'scope (late 70's/early 80's) :)

Quote
I'll check that tonight but as far as I can tell, I've got Sweep Var and Position knobs - both are centered.  Here's an image of a V-212 - mine is identical, except the Volts/Div knob for Channel 2 is damaged:

Sweep Var needs to be fully clockwise so the pointer is in the "cal" position.

Quote
Perhaps. Maybe trying the slower clock with a 3.6864 MHz crystal will yield better results...

You might be better adding a 74LS74 using the two flip flop's as divide by 2 (to give a total division of 4) to give a 1.8Mhz clock from your existing Xtal.

Quote
No, that was just me being lazy and instead of writing 7.3728 MHz clock, I wrote 8 MHz clock. Sorry!

OK
« Last Edit: March 08, 2017, 04:33:49 pm by grumpydoc »
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #27 on: March 08, 2017, 04:22:26 pm »
Sweep Var needs to be fully clockwise so the pointer is in the "cal" position.

Done. Updated image attached (now looks more like an 8.5 MHz frequency...

uploading images

You might be better adding a 74LS74 using the two flip flop's as divide by 2 (to give a total division of 4) to give a 1.8Mhz clock from your existing Xtal.

D-type flip flop? Okay - I'm pretty sure I don't have any of those lying around, but will try to source some from somewhere as they look quite handy.  ;D
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #28 on: March 08, 2017, 04:32:36 pm »
Damnit, the breadboard is out, I've gone and dug out the big box of TTL and now I'm hunting Z80s in my junkbox.

Sometimes I love this forum, other times I sit and wonder what I could do with my life if it didn't keep giving me ideas.
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #29 on: March 08, 2017, 04:39:37 pm »
Damnit, the breadboard is out, I've gone and dug out the big box of TTL and now I'm hunting Z80s in my junkbox.

Sometimes I love this forum, other times I sit and wonder what I could do with my life if it didn't keep giving me ideas.

Haha! Happy to have given you inspiration!   ;D
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #30 on: March 08, 2017, 04:41:23 pm »
Sweep Var needs to be fully clockwise so the pointer is in the "cal" position.

Done. Updated image attached (now looks more like an 8.5 MHz frequency...
OK, I think we're at the point that we can say your clock is probably OK and your 'scope timebase is off 10% or so.

Quote
You might be better adding a 74LS74 using the two flip flop's as divide by 2 (to give a total division of 4) to give a 1.8Mhz clock from your existing Xtal.

D-type flip flop? Okay - I'm pretty sure I don't have any of those lying around, but will try to source some from somewhere as they look quite handy.  ;D

Much as I hate to send anybody to Maplin for anything, if you have one nearby they sell them for a not completely unreasonable 49p
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #31 on: March 08, 2017, 04:58:14 pm »
Much as I hate to send anybody to Maplin for anything, if you have one nearby they sell them for a not completely unreasonable 49p

Ah that's not a bad price at all. Farnell are coming in around the 43-odd pence mark for a 74HCT74.  But then they add a surcharge for orders under £20, which is always a bugbear if you want a single item in a hurry. I've got a Maplin 15 miles away, so a trip is in order as I could do with another breadboard too (though they are expensive from there.)

Do I need to worry about whether it's an HCT or an LS?  I've looked at 74HCT74s purely because I'm using HCT's for the glue logic elsewhere.  It seems I definitely don't have any in my poorly-equipped hobbyist's TTL drawer..  :'(
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #32 on: March 08, 2017, 05:07:16 pm »
Much as I hate to send anybody to Maplin for anything, if you have one nearby they sell them for a not completely unreasonable 49p

Ah that's not a bad price at all. Farnell are coming in around the 43-odd pence mark for a 74HCT74.  But then they add a surcharge for orders under £20, which is always a bugbear if you want a single item in a hurry. I've got a Maplin 15 miles away, so a trip is in order as I could do with another breadboard too (though they are expensive from there.)
They do occasionally scratch the "I need it now" itch, but check stock on the website before setting out.

Quote
Do I need to worry about whether it's an HCT or an LS?  I've looked at 74HCT74s purely because I'm using HCT's for the glue logic elsewhere.  It seems I definitely don't have any in my poorly-equipped hobbyist's TTL drawer..  :'(
Not really, 74LS is way more power hungry than 74HCT but for just a few gates it hardly matters, otherwise they are fairly similar in speed, propagation delay etc. A 74HCT output will drive 10 LS TTL inputs which is plenty.
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #33 on: March 08, 2017, 06:52:21 pm »
Ah that's not a bad price at all. Farnell are coming in around the 43-odd pence mark for a 74HCT74.  But then they add a surcharge for orders under £20,

Are rswww.com still offering free delivery for online orders? Always feel guilt ordering less than a tenner but they deliver for free anyway.
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #34 on: March 09, 2017, 01:35:53 pm »
Are rswww.com still offering free delivery for online orders? Always feel guilt ordering less than a tenner but they deliver for free anyway.

Yes, they are it would seem - didn't think to check them.  Mind you, they're asking £1.69 for a single 74HCT74.  There's your postage there (it's £1.20 more than the one I picked up from Maplin earlier..)

Well, I've got one now anyway (and an extra breadboard) so I'll have a go at dividing the clock by 4 and see if that changes anything, as well as checking the 68B50 to see if it's alive and kicking.  I don't have a logic probe though, but I guess the oscilloscope should pick up some comms via the TxD/RxD pins.
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #35 on: March 09, 2017, 01:40:37 pm »
This is still the 68B50 that you hooked up the wrong way around isn't it? - you might have fried it  :(
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #36 on: March 09, 2017, 01:45:14 pm »
This is still the 68B50 that you hooked up the wrong way around isn't it? - you might have fried it  :(

No, I did swap it out for a fresh one.
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #37 on: March 09, 2017, 02:41:26 pm »
Well, I've got one now anyway (and an extra breadboard) so I'll have a go at dividing the clock by 4 and see if that changes anything, as well as checking the 68B50 to see if it's alive and kicking.  I don't have a logic probe though, but I guess the oscilloscope should pick up some comms via the TxD/RxD pins.
One big benefit of slowing the clock to 4Mhz is that you can now use your 'scope more easily.

I assume that you have a way of writing the to the ROM

To debug write a loop of a few instructions, say just writing and reading back one of the 68B50 registers. Now hook up CH1 to, say, the M1 signal and adjust the timebase, holdoff & trigger level until you have a steady display, probably one or two complete iterations of the loop.

You can now probe around with CH2, you can reference back to the Z80 timing diagrams (if you don't have them they are easily found online) and look at what is going on. You can check the address, data and all the select signals one line at a time quite easily doing this.

Using a slower timebase and the x10 and horizontal position controls you can actually get quite long sequences of instructions captured.

 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #38 on: March 09, 2017, 03:02:33 pm »
I assume that you have a way of writing the to the ROM

Oh yes, and a couple of spare ROMS too.  I'll get right onto making a test program this afternoon to get some frequent comms with the 68B50 chip.

To debug write a loop of a few instructions, say just writing and reading back one of the 68B50 registers. Now hook up CH1 to, say, the M1 signal and adjust the timebase, holdoff & trigger level until you have a steady display, probably one or two complete iterations of the loop.

You can now probe around with CH2, you can reference back to the Z80 timing diagrams (if you don't have them they are easily found online) and look at what is going on. You can check the address, data and all the select signals one line at a time quite easily doing this.

Sounds like a plan.  I'll struggle with CH2 on the oscilloscope though as I only have one pair of (very basic) test leads, but I'll make do somehow.  Hopefully, using both flip-flops on the 74HCT74N, I can get the clock down to around 1.8 MHz which should make it more manageable.  :-+
« Last Edit: March 09, 2017, 03:05:29 pm by nockieboy »
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #39 on: March 09, 2017, 04:02:16 pm »
Okay, I've wired up the flip-flop to divide the clock signal by 4 and this is the oscilloscope trace I'm getting now:

image hosting free

As you can see, not only is the frequency quartered but it seems the voltage is much reduced too - I've had to drop the volts/div to .5 to get a clear trace.

If there's anything wrong with this signal please let me know (it looks absolutely awful to my untrained eye!) but in the meantime I'm going to get on with testing the 68B50 and rest of the circuit for errors.
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #40 on: March 09, 2017, 04:20:28 pm »
Yuk

Make sure you have decoupling caps 0.1uF as close to the flipflop VCC & ground pins as possible.

You have mentioned not having very good probes, are they the "crocodile clip on the end of a piece of coax" type things or do you have at least one x1/x10 (or x10 only) probe to use?
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #41 on: March 09, 2017, 04:29:41 pm »
Yuk

Make sure you have decoupling caps 0.1uF as close to the flipflop VCC & ground pins as possible.

You have mentioned not having very good probes, are they the "crocodile clip on the end of a piece of coax" type things or do you have at least one x1/x10 (or x10 only) probe to use?

Unfortunately they're literally crocodile clips on the end of a piece of co-ax...

[/url]image post[/img]

Though for the cost of a set of proper probes, I'm thinking of waiting until I can justify the extra £30 and maybe will get one of these:

[/url]upload pic[/img]
 


Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #43 on: March 09, 2017, 07:23:00 pm »
Nah, these will be fine:

http://www.ebay.co.uk/itm/2pcs-High-precision-100MHz-Oscilloscope-Test-Probe-1X-10X-Attenuation-Ratio-R1I7-/232139542147?hash=item360c984e83:g:e6YAAOSwcLxYJEk8

Awesome, thanks CJay.  How are you getting on with your new-found inspiration?  Did you dig out an old Z80 in the end?
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #44 on: March 09, 2017, 07:41:53 pm »

Though for the cost of a set of proper probes, I'm thinking of waiting until I can justify the extra £30 and maybe will get one of these:


The 6022BE is not that great a 'scope, it has a maximum sample rate of 48MS/s which is only barely adequate for the stated 20MHz bandwidth. Although Nyquist says you only need 2x bandwidth most people feel that a 'scope should have at least 5x bandwidth or, better, 10x bandwidth samle rate. Plus having to have a PC or laptop to look at the signal is not all that convenient.

Stick with your Hitachi.

I would see if we can figure out why that divided clock is, or looks, so awful before proceeding with it though. Check you have VCC and 5V connected and have a decoupling cap. 74HC(T) chips are notorious for powering themselves through gate inputs if you forget to connect the 5V which can cause odd behaviour, LSTTL don't tend to suffer from this but the amplitude that you are getting is very small.
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: Z80 Homebrew Computer - fault finding
« Reply #45 on: March 09, 2017, 07:50:51 pm »
Stick with your Hitachi.

Roger wilco.  :-+

I would see if we can figure out why that divided clock is, or looks, so awful before proceeding with it though. Check you have VCC and 5V connected and have a decoupling cap. 74HC(T) chips are notorious for powering themselves through gate inputs if you forget to connect the 5V which can cause odd behaviour, LSTTL don't tend to suffer from this but the amplitude that you are getting is very small.

I've added a decoupling cap since you mentioned it previously - haven't had a chance to test the circuit since that addition, however - will take another look tomorrow.  The scope leads are on order, so hopefully by early next week I'll be able to put up a much more accurate trace for the clock.

I was just wondering - the ROM chip is working fine, the Z80 seems fine as it's stepping through the instructions properly, no reason to think the RAM should be an issue, so I'm going to examine the 68B50 more closely tomorrow when I get a chance, make sure it's wired up correctly and confirm the serial port settings are right as well.  Even if the serial port settings aren't spot on, I'd imagine I'd be getting garbled information in the terminal window but I'm not getting anything...
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3787
  • Country: de
Re: Z80 Homebrew Computer - fault finding
« Reply #46 on: March 09, 2017, 07:55:36 pm »

The 6022BE is not that great a 'scope, it has a maximum sample rate of 48MS/s which is only barely adequate for the stated 20MHz bandwidth. Although Nyquist says you only need 2x bandwidth most people feel that a 'scope should have at least 5x bandwidth or, better, 10x bandwidth samle rate. Plus having to have a PC or laptop to look at the signal is not all that convenient.

Stick with your Hitachi.

The reason for the 5-10x bandwidth sample rate is that Nyquist being 1/2 of the sample rate is cool - for sinusoidal signal. Good luck looking at any other type of signal. It will be missing all the higher harmonics that give it its shape or, worse, they will alias. So a square wave will look like a badly distorted sine. 5-10x gives you the fundamental frequency + several harmonics, so you can actually see what is the signal like.
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #47 on: March 09, 2017, 08:33:32 pm »
The reason for the 5-10x bandwidth sample rate is that Nyquist being 1/2 of the sample rate is cool - for sinusoidal signal. Good luck looking at any other type of signal. It will be missing all the higher harmonics that give it its shape or, worse, they will alias. So a square wave will look like a badly distorted sine. 5-10x gives you the fundamental frequency + several harmonics, so you can actually see what is the signal like.
I think that this has been discussed at length on the forum in the past.

Well, yes but we tend to assume that "100MHz" 'scope has a bandwidth of 100MHz and, for a digital 'scope has an input filter with a 3dB point at that frequency (in practice a little higher) so you will loose the harmonics anyway. To show a reasonable "square wave" you need perhaps the 7th harmonic which looks like this when reconstructed.



Are you suggesting that a "100Mhz" 'scope requires a front end bandwidth of 500 or 700Mhz?

What sampling at 5-10x the bandwidth does do, as you briefly mentioned, is minimise aliasing where the input contains frequencies over, but close to, the bandwidth such that they have significant amplitude after filtering. Early DSO's were very susceptible to aliasing and this is the main reason modern 'scopes tend to be set up to sample at 5-10x bandwidth.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3787
  • Country: de
Re: Z80 Homebrew Computer - fault finding
« Reply #48 on: March 09, 2017, 09:16:14 pm »
Are you suggesting that a "100Mhz" 'scope requires a front end bandwidth of 500 or 700Mhz?

No, I am not suggesting that. My comment only concerned the sampling rate, which is terrible on that Hantek (vs the declared 20MHz bandwidth) and the higher harmonics of faster signals (but still within its declared bandwidth) simply won't "fit" under the Nyquist rate. So the limiting factor of usability will be both this and the frontend performance.
« Last Edit: March 09, 2017, 09:28:11 pm by janoc »
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2905
  • Country: gb
Re: Z80 Homebrew Computer - fault finding
« Reply #49 on: March 09, 2017, 09:20:43 pm »
Are you suggesting that a "100Mhz" 'scope requires a front end bandwidth of 500 or 700Mhz?

No, I am not suggesting that. My comment only concerned the sampling rate, which is terrible on that Hantek (vs the 20MHz bandwidth).
I think I said that as well :)

Quote
A common 100MHz scope is good to show decent square wave for up to 20-30MHz or so, then it starts getting distorted because of the front end attenuation (even though the frontends often have a lot more bandwidth than official specs). However, sample rate and aliasing is rarely an issue with even the cheap scopes having 1Gsa/s as standard today.
Absolutely.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf