Page 1 of 1

PLL not working

Posted: Thu Oct 26, 2017 2:51 pm
by howard123
Hello all

I have a PIC18F46K22 running on the internal high frequency oscillator and producing 16MHz. I would like to increase the speed, using the PLL, up to a maximum speed of 64MHz but am not having success in doing this.

I have set the PLL Enable (PLLCFG) in the Configuration as well as combinations of OSCTUNE and OSCCON2. Here is my code at the start..

OSCCON=0b11110110; //16 meg internal
SLRCON=0b00011111;//all ports slow slew
OSCTUNE=0b01000000;// PLLEN
OSCCON2=0b10000000;//PLLRDY

In all cases the frequency remains at 16MHz.

I have not seen the data-sheet mention that a delay is necessary between a low start speed and PLL implementation. Could be wrong.

Any ideas?
Thanks
Howard
V7.2.1.4

Re: PLL not working

Posted: Thu Oct 26, 2017 8:37 pm
by Kenrix2
Does this work?

Code: Select all

OSCCON=0b11110000;
OSCTUNE=0b01000000;
If you look at Figure 2-1, find the Clock Switch MUX. You can see that SCS<1:0> needs to be 00 for the 4xPLL to work.

Re: PLL not working

Posted: Sat Oct 28, 2017 12:23 pm
by howard123
Hi
This has worked perfectly.
Thank you for your kindness.
regards
Howard