oscillator settings
oscillator settings
I am new to pic32 and the oscillator settings are not so easy on the first look. I have a question for understanding the project edit window. The oscillator frequency on the right side: is it - as i understand - the cpu frequency resulting from the settings on the left side? (And could be calculated by the program itself) Or is it the primary oscillator frequency?
- petar.timotijevic
- mikroElektronika team
- Posts: 1739
- Joined: 19 Feb 2014 13:46
- Location: Serbia
- Contact:
Re: oscillator settings
Hello,
You need to familiarize yourself with the microcontroller and the best way is MCU datasheet.
Best regards,
Peter
You need to familiarize yourself with the microcontroller and the best way is MCU datasheet.
Best regards,
Peter
Re: oscillator settings
Thanks for your advice.
I asked for "edit project" window in the ide. On the right side i can input "Oscillator Frequency". That is misunderstandable - it is the cpu clock. In my opinion the window could help the user. Instead of asking for the cpu clock on the right side (where i can input a value that does not suit to my settings on the left) it should ask me for the xtal freqency (or the external or...) on the left side (when i choose the clock source) and calculate the cpu clock itself. The user has a control if he had made the right settings. The window could also control if (when used) the pll input frequency is in the 4 to 5 MHz range. More a suggestion then a question.
I asked for "edit project" window in the ide. On the right side i can input "Oscillator Frequency". That is misunderstandable - it is the cpu clock. In my opinion the window could help the user. Instead of asking for the cpu clock on the right side (where i can input a value that does not suit to my settings on the left) it should ask me for the xtal freqency (or the external or...) on the left side (when i choose the clock source) and calculate the cpu clock itself. The user has a control if he had made the right settings. The window could also control if (when used) the pll input frequency is in the 4 to 5 MHz range. More a suggestion then a question.
Re: oscillator settings
Since there is no firm explanation the question, I'll repeat it utmost clearly:
1. What we see in Edit Project -> MCU&Oscillator Frame -> Oscillator Frequency [MHz]: 48.0000
2. What we see in mBasic compiler for PIC32 PRO Main Window -> left side in Project Settings frame -> MCU clock -> Frequency: 48.0000
What about frequency we speack: about crystal ((primary) Oscillator) frequency, or about SYSCLK after all PLL/multipliers/dividers (DS60000156H page 141)??
I tried to clear the question some times and every time I've got different answer from mE.
Can the mE staff explain it once and for all?
BTW: I've cleared it by myself experimentally, but I spent a lot of time before I understand I must do it by myself...
1. What we see in Edit Project -> MCU&Oscillator Frame -> Oscillator Frequency [MHz]: 48.0000
2. What we see in mBasic compiler for PIC32 PRO Main Window -> left side in Project Settings frame -> MCU clock -> Frequency: 48.0000
What about frequency we speack: about crystal ((primary) Oscillator) frequency, or about SYSCLK after all PLL/multipliers/dividers (DS60000156H page 141)??
I tried to clear the question some times and every time I've got different answer from mE.
Can the mE staff explain it once and for all?
BTW: I've cleared it by myself experimentally, but I spent a lot of time before I understand I must do it by myself...
- petar.timotijevic
- mikroElektronika team
- Posts: 1739
- Joined: 19 Feb 2014 13:46
- Location: Serbia
- Contact:
Re: oscillator settings
Hi,
@foravr
Yes I agree with the suggestion that it would be of great help to users.
@Const50
For example PIC32MX795F512L with 8MHz crystal oscillator.
MCU is set to work on 80MHZ, you can see that on right side in Project setting.
Please see oscillator diagram from MCU datasheet in attachment.
8MHz crystal / 2 PLL Input Divider = 4MHz x 20xPLL = 80MHz / 1 Sys output PLL div = 80MHz.
See examples for mikroBasic at this location:
...\Mikroelektronika\mikroBasic PRO for PIC32\Examples\Development Systems\EasyPIC Fusion v7
PIC32MX795F512L datasheet
http://ww1.microchip.com/downloads/en/D ... 61156H.pdf
Best regards,
Peter
@foravr
Yes I agree with the suggestion that it would be of great help to users.
@Const50
1. What we see in Edit Project -> MCU&Oscillator Frame -> Oscillator Frequency [MHz]: 48.0000
Please can you specify MCU, I can not find document with name DS60000156H on Microchip site?2. What we see in mBasic compiler for PIC32 PRO Main Window -> left side in Project Settings frame -> MCU clock -> Frequency: 48.0000
What about frequency we speack: about crystal ((primary) Oscillator) frequency, or about SYSCLK after all PLL/multipliers/dividers (DS60000156H page 141)??
For example PIC32MX795F512L with 8MHz crystal oscillator.
MCU is set to work on 80MHZ, you can see that on right side in Project setting.
Please see oscillator diagram from MCU datasheet in attachment.
8MHz crystal / 2 PLL Input Divider = 4MHz x 20xPLL = 80MHz / 1 Sys output PLL div = 80MHz.
See examples for mikroBasic at this location:
...\Mikroelektronika\mikroBasic PRO for PIC32\Examples\Development Systems\EasyPIC Fusion v7
PIC32MX795F512L datasheet
http://ww1.microchip.com/downloads/en/D ... 61156H.pdf
Best regards,
Peter
- Attachments
-
- PIC32MX795F512L - USB Example.png (37.71 KiB) Viewed 3009 times
-
- Oscillator Diagram from Datasheet
- PIC32MX795F512L - Oscillator Diagram.png (135.91 KiB) Viewed 3009 times