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

40MHz clock from 10MHz using built-in PLL

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



Joined: 07 Sep 2003
Posts: 51

View user's profile Send private message Yahoo Messenger

40MHz clock from 10MHz using built-in PLL
PostPosted: Wed Dec 31, 2003 7:33 pm     Reply with quote

Mabuhay!

Happy New Year from the Philippines!!!

I read the data sheet of PIC18F452 and it says that you can use 10MHz crystal that will generate a 40MHz clock using the x4 PLL multiplier built-in with the PIC18F452.

Just wondering if anybody in the community have done this? what advantage do I get if I am to implement this in my project?

I'll appreciate if anyone who can provide me a code snippet in using this features and/or share any info of how can I use this x4 PLL multiplier for a 40MHz clock?

Thnk you Cool
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Wed Dec 31, 2003 7:38 pm     Reply with quote

There isn't really a code snippet. You just set the config bit. In this case, use the H4 instead of HS in the fuse statement. The advantage, well it runs at 40MHz instead of 10MHz. What does that mean? It runs 4x faster.
rrb011270



Joined: 07 Sep 2003
Posts: 51

View user's profile Send private message Yahoo Messenger

PostPosted: Wed Dec 31, 2003 7:47 pm     Reply with quote

Mark wrote:
There isn't really a code snippet. You just set the config bit. In this case, use the H4 instead of HS in the fuse statement. The advantage, well it runs at 40MHz instead of 10MHz. What does that mean? It runs 4x faster.


with this 40MHz thing, I can't use any other value of the crystal except the 10MHz crystal?

Is it possible to use a crystal value below 10MHz and use the x4 PLL multiplier for as long it does not exceed the maximum 40MHz clock?

Thank you Cool
rrb011270



Joined: 07 Sep 2003
Posts: 51

View user's profile Send private message Yahoo Messenger

PostPosted: Wed Dec 31, 2003 7:58 pm     Reply with quote

Mabuhay!

By all means the code will be similar as listed below:

Code:

#include <18F452.h>              // Target PIC Microcontroller IC
#device  *=16                         // use a 16-bit pointer
#device ICD=TRUE

#fuses H4,NOPROTECT,NOWDT        // PIC MCU Configuration
#use delay(clock=40000000)                 // 40MHz Crystal clock speed



Thank you Cool Very Happy Wink
MGP



Joined: 11 Sep 2003
Posts: 57

View user's profile Send private message

PostPosted: Wed Dec 31, 2003 8:16 pm     Reply with quote

rrb011270 wrote:

with this 40MHz thing, I can't use any other value of the crystal except the 10MHz crystal?

Is it possible to use a crystal value below 10MHz and use the x4 PLL multiplier for as long it does not exceed the maximum 40MHz clock?

Thank you Cool


Yes, it's possible to use a lower frrequency crystal and 4x PLL mode. For instance you could use a 4MHz crystal and run the PIC at 16MHz.

Also be aware that some 18F devices won't run at 40MHz and are limited to 25MHz, be sure to check the errata for your particular device.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 31, 2003 8:40 pm     Reply with quote

See these notes on the PLL from R.J. Hamlett:
http://www.ccsinfo.com/forum/viewtopic.php?t=294&highlight=pll+resistor
Guest








PLL
PostPosted: Thu Jan 01, 2004 2:50 pm     Reply with quote

PCM programmer wrote:
See these notes on the PLL from R.J. Hamlett:
http://www.ccsinfo.com/forum/viewtopic.php?t=294&highlight=pll+resistor


I've used it a lot... The commnets about resistors demonstrate a ppoor choice of crystal.

Read the data sheet, order the correct crystal type (series) and it works 100% every time... no need to kluge resistors.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 01, 2004 3:38 pm     Reply with quote

Quote:
Read the data sheet, order the correct crystal type (series)


In section 2.2 of the 18Fxx2 data sheet, it says this:

PIC18FXX2 oscillator design requires the use of a parallel cut crystal.

and also:

Note: Use of a series cut crystal may give a frequency
out of the crystal manufacturers specifications.
Ttelmah
Guest







Re: PLL
PostPosted: Thu Jan 01, 2004 3:57 pm     Reply with quote

Anonymous wrote:
PCM programmer wrote:
See these notes on the PLL from R.J. Hamlett:
http://www.ccsinfo.com/forum/viewtopic.php?t=294&highlight=pll+resistor


I've used it a lot... The commnets about resistors demonstrate a ppoor choice of crystal.

Read the data sheet, order the correct crystal type (series) and it works 100% every time... no need to kluge resistors.

I disagree, (but also disagree with myself!... :-).

The current 18F452's, now run fine with the original crystals I was using. I first played with the PLL, on some very early chip examples (including four 'pre-release' examples), and the earlier chips gave problems on the same crystals. At the time, MicroChip stated that series resistors would improve the problem (they did), and I have allways left the board space present on latter boards, since it is much easier to wire a link if the resistor is not necessary, than to fiddle around adding resistors to a board not laid out for them.
Two 'demo' boards from MicroChip, supplied by them as part of a drive circuit for the radio driver on a RFPic system (and using the PLL ability), also had the resistors present.

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