Have you tried OSCCON = %01110010?
Also, try putting the OSCCON statement before the OSCTUNE.
<br>Originally Posted by datasheet
DT
Yep I think DT just nailed it. Might be holding it off until it's in the right mode for the switch.
Confirmed -
Darrel, you were right again. Now that I switch to 8MHz BEFORE I enable the PLL, it
works as expected.
Thanks!
Charles Linquist
And one last "Gotcha" that I forgot to mention earlier - bits 0 and 1 of
OSCCON *MUST* be set to "00".
Even though you are running off the Internal Oscillator Block, if you
enable the PLL, you have to configure for PRIMARY OSCILLATOR.
Summary -
To run off the Internal oscillator and use the 4X PLL:
Set OSCCON bits 6 through 4 for either 8MHz (111) or 4MHz (110) and OSCCON
bits 1 and 0 for PRIMARY OSCILLATOR (00)
Set OSCTUNE.6 = 1 to enable the PLL.
In that order!
Charles Linquist
Bookmarks