The curious incident of the clock in the night-time or: Clock not oscillating - Page 1
Forum section: electronics / projects

author: ChristofferB
author_rank: Frequent Contributor
timestamp: April 20, 2015, 05:33:15 pm
content: 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 aIC 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

author: lincoln
author_rank: Regular Contributor
timestamp: April 21, 2015, 09:59:41 pm
content: 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),

author: dom0
author_rank: Super Contributor
timestamp: April 21, 2015, 10:13:30 pm
content: (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.

author: bookaboo
author_rank: Frequent Contributor
timestamp: April 21, 2015, 10:27:04 pm
content: 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.

author: joeqsmith
author_rank: Super Contributor
timestamp: April 22, 2015, 12:40:58 am
content: Looking good!Agree about the scope probe loading. May have the wrong xtal.

author: moffy
author_rank: Super Contributor
timestamp: April 22, 2015, 02:15:01 am
content: 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.

author: amyk
author_rank: Super Contributor
timestamp: April 22, 2015, 02:59:43 am
content: Quote from: moffy on April 22, 2015, 02:15:01 amThat'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.

author: ChristofferB
author_rank: Frequent Contributor
timestamp: April 22, 2015, 06:29:04 am
content: 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

author: bookaboo
author_rank: Frequent Contributor
timestamp: April 22, 2015, 07:32:00 am
content: 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.

author: dom0
author_rank: Super Contributor
timestamp: April 22, 2015, 07:44:50 am
content: In series - ohms, maybe 200 maxIn parallel - 1 meg to 10 meg, value isn't critical

author: Unknown
author_rank: Unknown
timestamp: April 22, 2015, 08:09:27 am
content: hi; what freq is the crystal?

author: ChristofferB
author_rank: Frequent Contributor
timestamp: April 22, 2015, 10:43:59 am
content: 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

author: moffy
author_rank: Super Contributor
timestamp: April 22, 2015, 11:47:42 pm
content: Quote from: amyk on April 22, 2015, 02:59:43 amPower 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.

author: ChristofferB
author_rank: Frequent Contributor
timestamp: April 23, 2015, 05:58:24 am
content: 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

author: moffy
author_rank: Super Contributor
timestamp: April 28, 2015, 01:37:37 am
content: Noticed from the datasheet that the RS232 is 8data, 0parity, 2 stop bits, the last one being unusual.

author: tggzzz
author_rank: Super Contributor
timestamp: April 28, 2015, 08:15:27 am
content: Quote from: ChristofferB on April 22, 2015, 06:29:04 amIn 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 athttps://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 thatsignificantlyworse. 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.

author: ChristofferB
author_rank: Frequent Contributor
timestamp: April 28, 2015, 03:27:53 pm
content: 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