Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: frank26080115 on July 02, 2007, 08:38:25 PM

Title: Clock Source Not Working
Post by: frank26080115 on July 02, 2007, 08:38:25 PM
I'm trying to use a 4.5mHz ceramic resonator (with center ground pin) as a clock source for my PIC16F877A.

When the first pin is connected to the CLKI and the last pin is connected to CLKO, the center pin is connected to the ground, it does not work with any oscillator configuration (I tried all 4, RC, LP, XT, HS). Flipping the resonator does not help, neither does adding some 0.1uF capacitors from both pins to the ground.

I also tried the first pin to Vdd, middle to ground and last to CLKI, nothing happens. I also tried to not use the ground pin like you would with a crystal, nothing happens.

The program works when I use a RC clock source.

How do I resolve this?
Title: Re: Clock Source Not Working
Post by: KambeiX on July 02, 2007, 09:18:22 PM
Make sure configuration bits are being programmed. If the program works with RC then it must be that or the resonator isn't working.

Title: Re: Clock Source Not Working
Post by: frank26080115 on July 02, 2007, 10:06:05 PM
If the configuration bits are missing then PICkit will tell me they are missing, my PICkit 2 is awesome

This is what I put in C

// configuration
#pragma DATA 0x2007, _CP_OFF & _BODEN_ON & _PWRTE_OFF & _WDT_OFF & _(change me)_OSC

This is how it's always been done and so far it has worked for microcontrollers with internal oscillators, this is the first time I've used an external clock.
Should I enable the 2 timers?