PDA

View Full Version : Oscillator Troubles



CocaColaKid
- 13th December 2007, 16:47
This is baffling me to know end. I have a circuit that used the internal oscillator and now I wish to put in an external one instead. After adding the external oscillator the circuit will not work at all. If I revert the code back to using the internal one it works fine. I checked the output from the oscillator and its showing me a nice square wave running at 4 MHz. Any ideas? The pic is the 16F628A. Could it possibly be a bad oscillator?



orignial internal oscillator config fuses
@ __CONFIG _BOREN_ON & _CP_OFF & _DATA_CP_OFF & _PWRTE_ON & _LVP_OFF & _WDT_ON & _INTOSC_OSC_NOCLKOUT & _MCLRE_OFF

external oscillator config fuses
@ __CONFIG _BOREN_ON & _CP_OFF & _DATA_CP_OFF & _PWRTE_ON & _LVP_OFF & _WDT_ON & _XT_OSC & _MCLRE_OFF

Dave
- 13th December 2007, 17:04
CocaColaKid , What are you using for a crystal? Does it have the right caps? Do you have a 1 Meg resistor across the crystal?

Dave Purola,
N8NTA

CocaColaKid
- 13th December 2007, 17:15
I found the source of my problem. It appears this chip requires an external source setting for its oscillator type when a TTL oscillator is used. Learned something new today :) Switch to using _EXTCLK_OSC and all is well.