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 support@ccsinfo.com

18F4550 Crystal

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



Joined: 09 Aug 2007
Posts: 82
Location: TN, India

View user's profile Send private message Send e-mail

18F4550 Crystal
PostPosted: Mon Sep 30, 2013 5:34 am     Reply with quote

Hi friends..
How much external crystal connect for below code ....

Code:
   #include <18F4550.h>
    #fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
    #use delay(clock=48000000)
temtronic



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

View user's profile Send private message

PostPosted: Mon Sep 30, 2013 6:01 am     Reply with quote

Let the datasheet be your friend !

Page 24, figure 2-1 shows the 'clock diagram' which you must understand to follow how the clock signal is generated.Just print the page and highlight the various 'fuses' used to follow the clock signal paths.

In your fuses configuration, you're using the USB clock source, and you know that PLL must have a 4MHz input(to get the 96MHz).
The PLLDIV is PLL5, means the input to it is 5* 4MHz = 20 MHz.

So the primary oscillator should be 20 MHz.

The rest of the fuses and #use delay(clock=...)determine speed of processor... I leave how that's done as a good exercise for you to do.

Knowing HOW and WHY the clock signals get configured will go a LONG way into properly using these PICs.

hth
jay
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