|
|
View previous topic :: View next topic |
Author |
Message |
szkrep
Joined: 13 Oct 2010 Posts: 3
|
dsPIC PLL settings |
Posted: Wed Jun 01, 2011 7:37 am |
|
|
Hi all,
I am trying to use a dsPIC33FJ256MC710A. I managed to blink some led, etc, but clock frequency is always incorrect (delays are far from what i wanted).
I checked the .h file of the device for usable fuses, but none of them match the names which can be found in the datasheet. http://ww1.microchip.com/downloads/en/DeviceDoc/70594C.pdf <- On page 147 in this document, everything seems to be clearly written, but in CCS what fuses mean them?
In the help file of CCS I tried to find some special setting in setup_oscillator(), but I couldn't figure out how to set the PLL correctly.
I want to use the device at 80MHz from external crystal (currently 10MHz is built in because of the datasheets good-looking explanation). Could someone post an example, or an explanation about relating CCS fuse names? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19512
|
|
Posted: Thu Jun 02, 2011 4:39 am |
|
|
Most of this is not fuses.
Key is that on wake up, the incoming oscillator _must_ be less than 8MHz, if the PLL is used. So the unit has to start up on the internal clock, and only then change to the external clock (section 2.7). The compiler can do this for you, if you simply tell it in the clock statement to use an external 10MHz crystal, and a clock of 80MHz. It then calculates the PLL divisions for you, and adds the code to generate these. The CKFSM fuse is needed to allow this.
Best Wishes |
|
|
|
|
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
|