Electronics > Electronics

Clock Source Not Working


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?

Make sure configuration bits are being programmed. If the program works with RC then it must be that or the resonator isn't working.

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?


[0] Message Index

Go to full version