Author Topic: The curious incident of the clock in the night-time or: Clock not oscillating  (Read 4629 times)

0 Members and 1 Guest are viewing this topic.

Offline ChristofferBTopic starter

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: dk
  • Chemistry phd student!
    • My channel:
Hello!

So I've been making a small single board computer, these past weeks, and it doesn't work! at all! - That's a bit undescriptive, I know.
The board won't talk to the serial terminal (an arduino and terminal emulator), and the culprit seems to be the processor clock.
It's not running. It has two pins for crystal and two capacitors to gnd, as it is seen with modern microcontrollers as well, and two things sprung to mind: I'd placed the Xtal and capacitors in a
IC socket, because that's how you mount non-IC components with wirewrap, and wired them to the appropriate legs on the processor. The distance and thin wiring might not be ideal for an oscillator, and the crystal was old and salvaged, so i replaced the xtal and caps, and soldered them directly to the pins on the wirewrap socket. still nothing.
I have little experience with debugging oscillators, but if you keep distances very short, then no matter what the rest of the circuit is doing, the clock should be running, right?
Once or twice, when i applied power to the circuit board, the terminal received a single character, but a nonsensical one, like [รค]. I assumed (hoped) that it was the basic prompt, and I'd chosen a wrong baudrate on either device. but i couldn't replicate it by resetting the computer. -Is that just noise from the power-in being sent?
-The processor, Z8671, gets fairly warm, but I'm not sure if it's a bad chip, or just because older processors DID so.

On the XTAL legs on the processor: both legs exhibit a approx. 5V DC voltage, and one leg some HF wave, though it's not very squarewave-y and only 100 mV peak-peak.

Does anyone have a suggestion? Is it simply a bad CPU? - I don't have a replacement, since it's a Z8 with internal 2k mask rom holding Tinybasic. - could i try with a romless Z8 processor with identical pinout and see if it oscillates?

Here's a photo of the board, just because I prefer threads with visual content:



Thanks in advance,

-- Christoffer
--Christoffer //IG:Chromatogiraffery
Check out my scientific instruments diy (GC, HPLC, NMR, etc) Channel: https://www.youtube.com/channel/UCZ8l6SdZuRuoSdze1dIpzAQ
 

Offline lincoln

  • Regular Contributor
  • *
  • Posts: 155
  • Country: us
First off, you build is off to a very nice start! By this time most of mine look like they were ingested by a vacuum cleaner.

what kind of o scope? what is your bandwidth? what is the bandwidth of the probes? can you probe the serial line and see if it is just a baud rate thing?

probing the crystal you will see the analog side of the oscillator, It gets squared inside the chip. You could always build an oscillator / crystal tester and send the clock into the input pin. The crystal connections, one is an input and one is an inverted output. ( or i think it is),
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
(x10 probes will often "kill off" a crystal oscillator due to their high input capacitance (usually about 15 pF). Many MCUs have an optional, buffered clock output where you can check if the crystal oscillator runs smoothly or not.)

First thing you can try is to remove the two load capacitors from the crystal. Often enough stray capacitances in such a layout suffice to load the oscillator enough.
,
 

Offline bookaboo

  • Frequent Contributor
  • **
  • Posts: 758
  • Country: ie
I recall some time ago at college a friend was using some vintage chip (I cant recall the exact type) for his project, I know very little of older processors but he had a similar problem to yours, we solved it with a resistor in series to the xtal.
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11897
  • Country: us
Looking good! 

Agree about the scope probe loading.     May have the wrong xtal. 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
The processor should not get very warm especially without a proper clock. Check your supplies, properly decoupled at each chip? No shorts, or outputs connected together? The idea of feeding in an external clock sounds good too. If you put a 100k resistor in series with a DMM lead and measure the DC voltage on either of the clock pins you should get about Vcc/2.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8413
The processor should not get very warm especially without a proper clock. Check your supplies, properly decoupled at each chip? No shorts, or outputs connected together? The idea of feeding in an external clock sounds good too. If you put a 100k resistor in series with a DMM lead and measure the DC voltage on either of the clock pins you should get about Vcc/2.
That's an NMOS part. They do get rather warm even with no clock - according to the datasheet power consumption can be up to 180mA, or 900mW.
 

Offline ChristofferBTopic starter

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: dk
  • Chemistry phd student!
    • My channel:
Wow! Thanks for the suggestions!
- The scope bandwidth shouldn't be an issue (20MHz), but my probe is pretty bad- basically cut off before the probe head: it's a length of RG174 with an alligator clip lead soldered on the shield and a pin header as probe tip ( I ran over it with an office chair; it didn't take it well).
-On a processor, I should really just probe the address lines. Or some other lines that are likely to do "something" - They're buffered, and running at a fraction of clock speed, of course, no guarantee they SHOULD be changing; the thing could be executing halts or something.
When I get home I'll try removing the capacitors from the crystal.
-If adding a series resistor to the XTAL leads, should it be both leads? and which scale of R are we talking? Megohms or ohms?

--Christoffer
--Christoffer //IG:Chromatogiraffery
Check out my scientific instruments diy (GC, HPLC, NMR, etc) Channel: https://www.youtube.com/channel/UCZ8l6SdZuRuoSdze1dIpzAQ
 

Offline bookaboo

  • Frequent Contributor
  • **
  • Posts: 758
  • Country: ie
If my memory serves me is was 100k we used in series on just one leg*. Also I agree with others regarding the load caps, keep experimenting with those.
One other long shot is that the 0V connection to your OSC caps is connected to one of your 74 logic chips, I've seen some weird stuff happen there with grounds to logic and xtals. Try wiring the 0V to the xtal with its own dedicated (thick) wire.

*I have seen microchip reference designs with 1M Ohm in parallel too.
« Last Edit: April 22, 2015, 07:33:51 am by bookaboo »
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
In series - ohms, maybe 200 max
In parallel - 1 meg to 10 meg, value isn't critical
,
 

jucole

  • Guest
hi;  what freq is the crystal?
 

Offline ChristofferBTopic starter

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: dk
  • Chemistry phd student!
    • My channel:
The crystal is 7,3728 MHz, to provide the correct baudrates.

That did the trick! removed the load capacitors and it sprung to life as a.. lifespring!
Found another error, though on the schematic; the reset (active low) is low until reset is pressed. then it builds over 3 seconds to high, and turns low again upon release. So you have to hold the reset switch down for the processor to run! - Might want to improve that.
Thanks again, for the aid.

--Christoffer
--Christoffer //IG:Chromatogiraffery
Check out my scientific instruments diy (GC, HPLC, NMR, etc) Channel: https://www.youtube.com/channel/UCZ8l6SdZuRuoSdze1dIpzAQ
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
The processor should not get very warm especially without a proper clock. Check your supplies, properly decoupled at each chip? No shorts, or outputs connected together? The idea of feeding in an external clock sounds good too. If you put a 100k resistor in series with a DMM lead and measure the DC voltage on either of the clock pins you should get about Vcc/2.
That's an NMOS part. They do get rather warm even with no clock - according to the datasheet power consumption can be up to 180mA, or 900mW.

Power down mode consumption is 10ma, which is typically achieved by turning the clock off to sections: 50mW, but let's assume 100mW for arguments sake with no clock. That won't be very warm at all, note the "very". But if it is very warm then either a.) The clock is running or b.)You have an output shorted or c) a defective chip.
 

Offline ChristofferBTopic starter

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: dk
  • Chemistry phd student!
    • My channel:
Well the clock is running now, and i can see the data bus flickering along happily on scope, so it does seem to be running. Still can't get the TTL serial out to work properly. I can see the data transmit line idling being high, as it should, and then sending something occationally, Vhigh about 3V - but neither my logic analyzer or serial terminal can see anything.
hmm..

--Christoffer
--Christoffer //IG:Chromatogiraffery
Check out my scientific instruments diy (GC, HPLC, NMR, etc) Channel: https://www.youtube.com/channel/UCZ8l6SdZuRuoSdze1dIpzAQ
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Noticed from the datasheet that the RS232 is 8data, 0parity, 2 stop bits, the last one being unusual.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 20683
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
- The scope bandwidth shouldn't be an issue (20MHz), but my probe is pretty bad- basically cut off before the probe head: it's a length of RG174 with an alligator clip lead soldered on the shield and a pin header as probe tip ( I ran over it with an office chair; it didn't take it well).

In that case your probe will be loading the circuit with roughly 100pF and 150nH. Do the calculations of what the impedance will be at the clock frequency and 3rd harmonic, and what the probes resonant frequency will be. Have a look at https://entertaininghacks.wordpress.com/library-2/scope-probe-reference-material/ for basic information, and especially the low-impedance Z0 probes.

If you get intermittant operation, think about adding decoupling capacitors to remove Vcc/GND glitches - especially on devices where all outputs change simultaneously.

Realise that a 20MHz probe will have a risetime of 17ns, and that your piece of wet string will make that significantly worse. 74LS devices will have risetimes <20ns (clock frequency is irrelevant), and corresponding Vcc/GND transients and signal glitches may be <10ns. A 100MHz scope is sufficient for 74LS devices, but you can still use a 20MHz scope provided you are aware of its limitations.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline ChristofferBTopic starter

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: dk
  • Chemistry phd student!
    • My channel:
Tggzzz: Of course, could probably add more decoupling. Only have bulk decoupling on the rail and local decoupling on the CPU and SRAM.
- Solved the scope issues by probing at the data/address/address strobe lines - they move a bit slower, and are TTL compatible. And they do change now, so the clock seemsn't to be the issue anymore.

The serial communications runs straight out of the processor, as i don't have an RS232 terminal yet, I'm using an arduino uno board as usb/serial. maybe i should buffer the serial out of the processor first..

--Christoffer
--Christoffer //IG:Chromatogiraffery
Check out my scientific instruments diy (GC, HPLC, NMR, etc) Channel: https://www.youtube.com/channel/UCZ8l6SdZuRuoSdze1dIpzAQ
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf