Hi all,
Back again.
My project needs to go faster so I opted to switch from 16MHz to 64MHz.
The datasheet states,
No problem, just need to enable the PLL and 64MHz it is.
Didn't work. So, used the code configurator to get the right values,
Note: I've tried both the PLL boxes with the same result.
The generated code states a clock of 16MHz!!!
and if you run an LED flash type program it is indeed running at 16MHz.
To test this I setup a new project called test_oscillator and used the code configurator as above.
However, when trying to debug it tells me,
Yes, I know I spelt oscillator wrong.
What does this mean?
Anyone know IF I can run this chip at 64MHz or not?
Yes, it'll run at 64MHz. I don't use MCC, so I don’t know what boxes to check, but it involves setting the OSCCON register in code to set the intosc to 16M and enabling the 4x PLL
Pommie, I just use the MCC to find the correct settings (there's so many config settings I always do that ), I then simply cut and paste the part I want from it.
In your OP the screenshot clearly shows the oscillator set to 16MHz_HFINTOSC, and says above "Current system clock 16MHz", I've just tried running the MCC on that chip, and if you select INTOSC it gives a warning that PLL is not applicable.
If you choose the 18F27K42 (my 'goto' 18F chip) it easily lets you select the 64MHz option:
From that I would assume the 18F25K22 doesn't allow the PLL with the internal oscillator?, and the MicroChip web page suggests using it's newer version the 18F25Q10 - which says 64MHz internal oscillator in the product features, the 18F25K22 doesn't.
It just says "Software selectable frequencies range of 31 kHz to 16 MHz" and "Four Crystal modes up to 64 MHz".
The syntax for setting the OSCTUNE PLLEN register bit depends on your language.
The chip will run at 1MHz until you execute those two lines, so you'll want to do it as soon as possible at startup.
Seems the problem was I set the lower two bits of OSCCON to zero as I wanted to use the internal oscillator - they need to be 11. Edit, I'm sure I tried this before without success as shown in post #3.
Oh well, problem solved - onward and upward.
Mike.
BTW, Nigel, my code configurator states that 16MHz can use the PLL!!!!
I don't understand where you're selecting the HFINTOSC.
Are you sure you have that around the right way?
If you set the lower two bits of OSCCON to 1x then the PLL gets bypassed. The clock mux (System Clock Select) needs to select the Primary Clock to use the PLL. See datasheet FIGURE 2-1
Seems the problem was I set the lower two bits of OSCCON to zero as I wanted to use the internal oscillator - they need to be 11. Edit, I'm sure I tried this before without success as shown in post #3.
Oh well, problem solved - onward and upward.
Mike.
BTW, Nigel, my code configurator states that 16MHz can use the PLL!!!!
I don't understand where you're selecting the HFINTOSC. View attachment 146139