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

pic18f46j50+48 MHz crystal

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



Joined: 31 Jan 2013
Posts: 63

View user's profile Send private message

pic18f46j50+48 MHz crystal
PostPosted: Sun Feb 16, 2014 12:24 pm     Reply with quote

hi
For create 12MIPS in pic18f46j50:
Should be use 48 MHz Crystal or use 16 MHz crystal with PLL ?.
Can you help me for config ccs?
Ttelmah



Joined: 11 Mar 2010
Posts: 19549

View user's profile Send private message

PostPosted: Sun Feb 16, 2014 12:27 pm     Reply with quote

You _must_ use the PLL, or an external oscillator module (not a crystal).

Read the data sheet. Look at what the maximum crystal frequency can be.

Same applies to the configuration required. The data sheet shows what oscillator and PLL settings are needed.
hamid9543



Joined: 31 Jan 2013
Posts: 63

View user's profile Send private message

PostPosted: Wed Feb 19, 2014 11:38 pm     Reply with quote

i read data sheet .can you explain what different between crystal and oscillator. and how use PLL? i use pll and 40mhz crystal but micro not working properly.
temtronic



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

View user's profile Send private message

PostPosted: Thu Feb 20, 2014 6:34 am     Reply with quote

a 'crystal' usually means a 2 pin metal can attached to the 'primary oscillator' pins with 2 caps.
an 'oscillator' is any 'device' or 'group of components' that make a 'clock' signal.


You need to printout figure 2-1 of the datasheet! That's the diagram of the 'family clock' which represents the various signal paths the PIC can use to create the required 'clock' signals.
Also table 29-10 lists the oscillator ratings. There you will see that when using an external crystal(and 2 caps) the MAXIMUM crystal value is 16MHz. So you cannot use any value higher( like 48 MHz) as the external crystal on the primary oscilator pins.
As for configuring this PIC with USB please do the following,
1) printout out figure 2-1,page 28 of datatsheet DS3931B
2) connect a 16MHZ xtal(and 2 caps) to the primary oscillator pins.
3) follow the 'flow' or 'signal path' to the PLL.Note that a 4MHz clock MUST be the USB PLL input.You've got a 16MHz xtal so you MUST divide by 4. Simple set the PLL prescaler to /4. This will give the required 4MHz input.
4)Notice underneath the PLL Prescaler there's a block called PLLEN, that must be enabled to allow the 48MHz clock to get to the USB module.

5) CPU speed can be set(configured)several ways, but if using the same 16MHz 'primary oscillator', look at the 'blocks' after the PLLEN block.This takes the 48MHz USB clock and feeds it into a 'CPUDivider' block.If you select '/3' then the CPU master clock will be 16MHz( 48/3). You also have to select the 2 other 'blocks' to get this signal to the CPU. Just follow the diagram.

With this PIC there are a great many options to get 'clocks' running!I've shown just one way using one crystal value.
When I do this I always printout the diagram, use a yellow 'highlighting' pen to show the signal paths.I use a 4MHz xtal for my projects as I have lots of them in stock.


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