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

Int osc with PLL X4 on PIC18F2520

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



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

Int osc with PLL X4 on PIC18F2520
PostPosted: Fri Sep 05, 2014 8:16 am     Reply with quote

I have not been able to enable the PLL (OSCTUNE bit 6) using a variety of methods on a PIC18F2520. I would like the clock output to be 32MHz. How would one set flags appropriately to accomplish this. My current flag configuration is below without anything to enable the PLL. Please fill in the blank:

Code:

#include <18F2520.h>

#device ADC=10

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES INTRC                    //Internal RC Osc, with CLKOUT
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOBROWNOUT
#FUSES NOPUT                    //No Power Up Timer 
#FUSES NOLVP
#FUSES NOWRT                    //Program memory not write protected


#use delay(clock=8000000)


It's probably a stupid mistake on my part Embarassed . Thanks for the group's indulgence. I'm using compiler version 5.021 inside MPLAB 8.90.
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Sep 05, 2014 8:26 am     Reply with quote

this....
#use delay(clock=8000000)

says use an 8 MHz clock...


you want a 32 MHz clock so....

#use delay(clock=32000000)

would be a good starting point...

although

I always printout the page in the datasheet that has the 'flow' of clock signals, highlight what I want, decide which configuration is best, then let the compiler decide. After that test using the '1Hz LED' program, dump the listing to see what the fuses are and go from there.

hth
jay
JerryR



Joined: 07 Feb 2008
Posts: 167

View user's profile Send private message

PostPosted: Fri Sep 05, 2014 10:02 am     Reply with quote

You know... it worked! I know I tried that before when it seemed to be the simplest way to configure the osc, but didn't notice somehow that osctune.6 was set. Now it sets the internal osc to 111 (8MHz) and enables the PLL (OSCTUNE.6=1).

Thanks a bunch! Very Happy
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