What am I missing?

General discussion on mikroPascal PRO for PIC32.
Author
Message
LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

Re: What am I missing?

#16 Post by LGR » 19 Jul 2011 15:59

No. Was I supposed to?
If you know what you're doing, you're not learning anything.

piort
Posts: 1379
Joined: 28 Dec 2005 16:42
Location: Laval,Québec,Canada,Earth... :-)
Contact:

Re: What am I missing?

#17 Post by piort » 20 Jul 2011 03:25

LGR wrote:No. Was I supposed to?
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.
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 ;-)

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

Re: What am I missing?

#18 Post by LGR » 20 Jul 2011 05:17

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. :o
If you know what you're doing, you're not learning anything.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: What am I missing?

#19 Post by filip » 20 Jul 2011 08:54

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.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: What am I missing?

#20 Post by janni » 20 Jul 2011 11:59

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. :o
Compiler does not assume anything about the crystal, just accepts given frequency as processor clock. Configuration bits do not affect compiler either.

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

Re: What am I missing?

#21 Post by LGR » 21 Jul 2011 02:07

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.

Post Reply

Return to “mikroPascal PRO for PIC32 General”