18f Intrc + PLL

Status
Not open for further replies.

justDIY

Active Member
I'm having a heck of a time getting the PLL to engage on my 18F2620.

Config fuses:
FOSC3:FOSC0 set to 1000 (int rc, io on ra7:6)

Registers:
PLLEN (OSCTUNE:6) = 1
IRCF2:IRCF0 (OSCCON6:4) = 111

according to the datasheet, that is all I need to set. yet when I flash the chip, the program runs very slowly, in fact, it runs at 1/4 speed, which means the chip is still running at 8mhz, even though I have all my timing routines calculated for 8*4 = 32

i'm using Proton PDS (proton basic)

any suggestions?

 
i seem to have solved this one, more or less by random chance. in messing with the code, I ended up having PLLEN set several instructions after OSCCON was set. In reading the datasheet, it seems to fit, that the pic does some sort of sanity checking on the PLLEN bit, and perhaps setting OSCCON and PLLEN right next to each other doesn't work. However, with a few other instructions in between setting OSCCON and PLLEN works!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…