# Enabling PLL in PIC18F

1. ## Enabling PLL in PIC18F

Hi,

I am having 16 MHz X-Tal crystal and I would like to get 40 MHz FOSC for higher baud rate. I guess PLL in PIC18F2550 can generate 4 times the crystal frequency but then it will be 64 MHz which device does not support as it is designed to support up to 48 MHz, right ?

Is there any way to get 40 MHz from 16 MHz X-Tal crystal ?

•

2. ## Re: Enabling PLL in PIC18F

PLLDIV = 4
USDDIV = 2
CPUDIV = HS, divided by 3

These will give you 48 MHz CPU clock.

Edit:

Or

PLLDIV = 4
USBDIV = 2
CPUDIV = HSPLL, divided by 2.
FOSC3...0 = 1

•

3. ## Re: Enabling PLL in PIC18F

In a word: No!
The issue with that MCU is that the PLL only multiples by 24 and must have an input frequency of 4MHz. (The reason is that this gives the 96/2 = 48MHz required for USB operation).
Once you have a 96MHz clock, the only post-scalar divider options are divide by 2, 3, 4 or 6. To get 40MHz from 96MHz would require a division of 2.4!
If you must have 40MHz then your only option is to use a 40MHz external oscillator, use EC mode and the 'divide by 1' option for the oscillator postscalar.
On the other hand, as @baileychic has pointed out, you can easily get 48MHz, or 32MHz using the PLL and dividing by 3.
As you are only wanting a faster Fosc for UART Baud rate purposes, then use the formula in the data sheet to find something that is close - but remember that a UART really need to be within 1-2% to be reliable.
Susan

•

4. ## Re: Enabling PLL in PIC18F

PLL only multiples by 24 or 4 ? How about getting 40 MHz using PLL from internal 8 HMz ?

5. ## Re: Enabling PLL in PIC18F

Im under the impression, you are trying to drag on the thread without ever looking into the 18F2550 datasheet…

Simply notice that the PLL has fixed 96 MHz frequency. Possible CPU clock frequencies are integer parts (2,3,4,6) of 96 MHz.

--[[ ]]--