CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

dsPIC PLL settings

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
szkrep



Joined: 13 Oct 2010
Posts: 3

View user's profile Send private message

dsPIC PLL settings
PostPosted: Wed Jun 01, 2011 7:37 am     Reply with quote

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: 19498

View user's profile Send private message

PostPosted: Thu Jun 02, 2011 4:39 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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