PDA

View Full Version : XTAl using 18F4550



lerameur
- 28th February 2011, 01:19
HI,
I am trying to use external oscillation on a P18F4550. The spec sheet says to use 15pF caps. But it is not operating at 20Mhz. With the code I used below. the only config thats works and I can confirm on the oscilloscope is using a 10Mhz crystal with 20pF caps. ( but config at OSC 20)
Tried multitude of capacitors values with the 20Mhz crystals. Any ideas ?


OSCCON = %01111100
DEFINE OSC 20


K

Darrel Taylor
- 28th February 2011, 18:47
OSCCON only affects the internal oscillator.

With a 20Mhz crystal and the default configuration bits, the processor will be running at 48Mhz.

DEFINE OSC 48

lerameur
- 28th February 2011, 22:14
ok thank you, osc 48 works, but where does it say to write this when using a 20Mhz crystal ?

K

Darrel Taylor
- 1st March 2011, 01:04
It says it in the default configuration bits (18F4550.inc) when compared to the oscillator structure on those USB chips.

The only way to understand why, is to read (study) the datasheets Oscillator Configurations section.

The oscillators in the USB chips are very different from any of the other PIC families.

http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf