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

PIC18F4550 at 48Mhz

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



Joined: 21 Jul 2017
Posts: 16

View user's profile Send private message

PIC18F4550 at 48Mhz
PostPosted: Mon Jul 24, 2017 11:06 am     Reply with quote

Hi,

How i configure #FUSES for 48Mhz ?

I have tested all possibility but it don't work

i have a crystal 16Mz

Code:

#FUSES HSPLL
#FUSES CPUDIV2
#FUSES PLL1

#use delay(clock=48Mhz)//,crystal=16Mhz)


Code:

#FUSES XT

#use delay(clock=48Mhz)//,crystal=16Mhz)


must i add crystal=16Mzh at #use delay ?

any idea for configurint this chip at 48 Mhz ?

Thanks in advance.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon Jul 24, 2017 11:21 am     Reply with quote

You need to use CPUDIV1.

The CPUDIV fuses are slightly complicated.

There are four divisor patterns.

00 01 10 11

When running off the crystal directly, these give /1, /2, /3 & /4

These are called by CCS CPUDIV1, CPUDIV2, CPUDIV3 & CPUDIV4.

However, when fed from the PLL, these same patterns give /2, /3, /4 & /6.

Personally I wish that CCS called them CPUDIV00, CPUDIV01, CPUDIV10 & CPUDIV11, with a note to look in the data sheet for what division ratio these actually give....

If your crystal is 16MHzx, you need to use PLL4. You have to be dividing the crystal down to 4MHz to feed the PLL.

So:
Code:

HSPLL, CPUDIV1, PLL4
#use delay (CLOCK=48MHz)
andromeda92



Joined: 21 Jul 2017
Posts: 16

View user's profile Send private message

PostPosted: Mon Jul 24, 2017 12:08 pm     Reply with quote

Thanks for your explication.
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