|
|
View previous topic :: View next topic |
Author |
Message |
[email protected]
Joined: 28 Jul 2014 Posts: 38
|
How to enable 16X PLL in DSPIC30F6010A |
Posted: Sat Jan 17, 2015 2:48 pm |
|
|
Please tell me the setting for enabling 16x pll. I am using 4 mhz crystal and i use the following:
Code: |
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT_PLL16
#FUSES CKSFSM //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES NOBROWNOUT //No brownout reset
#device ICSP=1
#use delay(clock=64MHz,crystal=4MHz)
|
Not working. Please guide where i am wrong.
If i use only
Code: | #use delay(crystal=4mhz) |
it works.
Regards |
|
|
cbarberis
Joined: 01 Oct 2003 Posts: 172 Location: Punta Gorda, Florida USA
|
|
Posted: Sun Jan 18, 2015 11:11 am |
|
|
This can be answered in various ways depending on the version of your compiler. For what I understand on the latest version 5.xx the compiler sets up the correct fuses for you when you use the #use delay(crystal=xxMHz) statement. So if your crystal= 4MHz and you want to use 16X PLL (providing this feature is applicable in the PIC hardware) you would only need to use the following statement: #use delay(crystal=64MHz)
You do not need to use the: #FUSES XT_PLL16 or #FUSES HS, however I do believe that you can still declare other oscillator setup like: #FUSES CKSFSM |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Sun Jan 18, 2015 12:24 pm |
|
|
Agreed.
However the other possible problem, is that he may need to actually enable the primary oscillator.
On quite a few chips like this, you must both setup the oscillator, and separately enable it.
Big question is 'what compiler version'?.
Vital for a question like this, since as Cbarberis says, the default behaviour for several of the settings, changes with compiler version.
Have just checked, and this chip isn't one that requires a separate oscillator enable.
You wouldn't use 'crystal=64M', since this is illegal...
Have just tested with:
Code: |
#include <30F6010A.h>
#FUSES NOWDT
#FUSES NOMCLR
#FUSES XT_PLL16
#FUSES CKSFSM
#FUSES BORV27
#FUSES NOBROWNOUT //No brownout reset
#device ICSP=1
#use delay(clock=64MHz) //Since the oscillator is setup above, just
//tell the compiler what frequency the chip is running.
void main(void)
{
while(TRUE)
{
output_toggle(PIN_G2);
delay_ms(100);
}
}
|
And 5.028, and it merrily runs OK, and at the right frequency with a 4Mhz crystal.
The only things I changed, were MCLR (the board I have this chip on doesn't have a pull up on this signal), and setting the brownout voltage (though it is disabled). I've had some oddities with a couple of chips in this family, if the brownout voltage is set to the 'reserved' setting (the default), not working properly even if the brownout is disabled.... |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|