What am I missing?
Re: What am I missing?
No. Was I supposed to?
If you know what you're doing, you're not learning anything.
Re: What am I missing?
yes... the value to write there (oscillator frequency field) isnt the crystal speed connect to the MCU but the real speed of the MCU after oscillator calibration. The compiler make all delay calculation from this number.LGR wrote:No. Was I supposed to?
example : if you want run with internal RC, in the edit project , you set the oscillator at FRC but in the oscillator frequency field you write the speed you will set it in the code.
Is why you have to tell to the compiler the real speed of the MCU... compiler cannot read the speed from the code ...lol
HTH a bit
Re: What am I missing?
Seems like "oscillator frequency" pretty clearly means the crystal (or input from external oscillator). Maybe that field should be renamed "MPU frequency" to be clear. So if I say 8 mHZ, and set the PLL, then the compiler assumes the crystal is 800 kHZ? That isn't obvious at all.
If you know what you're doing, you're not learning anything.
Re: What am I missing?
Hi,
I'm glad that we have found a solution for you and I apologize for the misunderstanding produces by the Oscillator label.
Regards,
Filip.
I'm glad that we have found a solution for you and I apologize for the misunderstanding produces by the Oscillator label.
Regards,
Filip.
Re: What am I missing?
Compiler does not assume anything about the crystal, just accepts given frequency as processor clock. Configuration bits do not affect compiler either.LGR wrote:So if I say 8 mHZ, and set the PLL, then the compiler assumes the crystal is 800 kHZ? That isn't obvious at all.
Re: What am I missing?
I just tried setting the chip to PLL AND setting the "oscillator frequency" to 80, and everything worked fine. All this confusion could have been avoided if the "oscillator frequency" was correctly labeled "MPU frequency". The oscillator is still 8 mHZ even when the chip is operating at 80, just like a desktop computer operates at 2 or 3 gHZ even when the oscillator frequency in the computer is the FSB frequency. There needs to be a clearer way to distinguish between the frequency of the resonator or external oscillator and the frequency of the core.
If you know what you're doing, you're not learning anything.