DSPIC33 MCU oscillator - PLLDIV setting issue

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
robmar
Posts: 13
Joined: 15 Oct 2014 07:10

DSPIC33 MCU oscillator - PLLDIV setting issue

#1 Post by robmar » 03 Feb 2019 15:06

Hi all,
In my project I am using a DSPIC33EP512MU810 with 8MHz XTAL and PLL by setting N1=2, N2=2 and PLLDIV=38 (M=40) thus complying with oscillator setting specifics and getting, as expected, a correct Fosc of: 8 * (M / N1*N2) = 80 MHz.

Then I've changed the XTAL to a 16Mhz and changed the PLLDIV to 18 (M=20) that is also complying with the specifics, and expected to get the same Fosc of 80 MHz, but instead I found that Fosc becomes apparently doubled (160MHz) and I can't understand why, since doubling XTAL frequency and at the same time halving the M multiplier should result in the same Fosc as before, but it isn't working this way for me.

Please note that I didn't do an actual MCU clock frequency measurement, but just observed that a led blink test, before and after the XTAL change, shows a doubled blinking frequency.

Did anyone deal with the same issue and can suggest an explanation / solution?
Thanks a lot in advance!
Roberto

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: DSPIC33 MCU oscillator - PLLDIV setting issue

#2 Post by jovana.medakovic » 05 Feb 2019 14:50

Hello,

I tested DSPIC33EP512MU810 MCU with 16MHz and PLLDIV = 18 (M=20) and it works fine.

In the attachment, you can find the LED Blinking example with mentioned parameters.
Please, try to run this example.
Also, in your project try to load scheme which you can find in the attachment: go to Project -> Edit Project -> Load Scheme.

Kind regards,
Jovana
Attachments
Led Blinking.zip
(114.44 KiB) Downloaded 94 times
Scheme.zip
(1.12 KiB) Downloaded 92 times

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”