|
|
View previous topic :: View next topic |
Author |
Message |
karthickiw
Joined: 09 Aug 2007 Posts: 82 Location: TN, India
|
18F4550 Crystal |
Posted: Mon Sep 30, 2013 5:34 am |
|
|
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: 9225 Location: Greensville,Ontario
|
|
Posted: Mon Sep 30, 2013 6:01 am |
|
|
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 |
|
|
|
|
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
|