oscillator settings

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
foravr
Posts: 130
Joined: 11 May 2009 19:34

oscillator settings

#1 Post by foravr » 01 Mar 2014 11:17

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?

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: oscillator settings

#2 Post by petar.timotijevic » 01 Mar 2014 12:46

Hello,

You need to familiarize yourself with the microcontroller and the best way is MCU datasheet.


Best regards,
Peter

foravr
Posts: 130
Joined: 11 May 2009 19:34

Re: oscillator settings

#3 Post by foravr » 03 Mar 2014 23:25

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.

Const50
Posts: 124
Joined: 28 Oct 2010 15:08
Location: West Siberia, Tomsk

Re: oscillator settings

#4 Post by Const50 » 17 Jun 2014 07:01

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...

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: oscillator settings

#5 Post by petar.timotijevic » 19 Jun 2014 17:17

Hi,

@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
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)??
Please can you specify MCU, I can not find document with name DS60000156H on Microchip site?

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
PIC32MX795F512L - USB Example.png (37.71 KiB) Viewed 2994 times
Oscillator Diagram from Datasheet
Oscillator Diagram from Datasheet
PIC32MX795F512L - Oscillator Diagram.png (135.91 KiB) Viewed 2994 times

Post Reply

Return to “mikroBasic PRO for PIC32 General”