PDA

View Full Version : Weird Oscillator Problems



CocaColaKid
- 1st July 2005, 17:27
This is a really weird problem. I have a circuit that has a serial output to monitor temperatures and functions and noticed the display is going totally wonky. Random character from hell actually, locks up, resets etc. After some time I have narrowed the problem to the oscillator section. The oscillator I'm using is a 4.000MHz crystal and a pair of 22pF capacitors. This is the really strange part, if I remove the capacitors from the circuit the board works prefect. If I leave on cap in it still works perfect. The traces between the PIC and the crystal are extremely short, the crystal is right beside the micro. I don't understand how this can be happening. Anyone have any ideas what might be causing this? If I install a resonator is works fine as well.

CocaColaKid
- 1st July 2005, 17:38
The PIC's that I'm working with are the 18F452 and 16F877. I just removed the caps from a different board and the same result. However this board works fine with or without the caps.

NavMicroSystems
- 1st July 2005, 17:57
CocaColaKid,

I have seen this problem once some time ago.

The cause was a bad PCB.
(see attachment)

Take a Magnifying Glass and inspect your PCB.

Other possible causes:

If you have your PIC or Crystal on a Socket, it could be a bad socket.

Also people have been reporting similar problems with Breadboards.
(Search the Forum for "Breadboard")

And last but not least:
The Crystal itself, have you tried a different brand?

CocaColaKid
- 1st July 2005, 18:24
I just talked with Jeff and ME Labs and asked him if he has seen this problem and he said yes. I guess some people don't even run caps. I checked the clkout and noticed a lot of noise when the caps were in circuit. Once removed the wave was nice and smooth. I tried this will about 8 different boards and all of them had the same results. I guess it really depends on the crystals charateristics if you need the caps or not. I tried a resonator and noticed a big difference in the clkout signal. The crystal is so much more accurate.

Mike, K8LH
- 28th August 2005, 18:16
'Kid,

I've seen similar symptoms with LVP enabled in the configuration fuses and the PGM pin left floating...

Regards, Mike

Ron Marcus
- 2nd September 2005, 23:19
You might be overdriving the crystal when set up properly. In the Microchip books, they talk about putting a resistor between Osc2 pin and the crystal. Unless it is a specially cut crystal, or your Uncle owns the crystal company, find one that works reliably.

Hope this helps,
Ron