PLL not working

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

howard123
Posts: 68
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 26 times
Been thanked: 28 times
Contact:

PLL not working

Postby howard123 » Thu Oct 26, 2017 2:51 pm

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

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: PLL not working

Postby Kenrix2 » Thu Oct 26, 2017 8:37 pm

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.
These users thanked the author Kenrix2 for the post (total 3):
howard123 (Sat Oct 28, 2017 12:23 pm) • medelec35 (Sat Oct 28, 2017 1:36 pm) • Benj (Mon Oct 30, 2017 10:29 am)
Rating: 15%
 

howard123
Posts: 68
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 26 times
Been thanked: 28 times
Contact:

Re: PLL not working

Postby howard123 » Sat Oct 28, 2017 12:23 pm

Hi
This has worked perfectly.
Thank you for your kindness.
regards
Howard
These users thanked the author howard123 for the post:
Benj (Mon Oct 30, 2017 10:29 am)
Rating: 5%