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

Configuration bits modification on CCS

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



Joined: 01 Nov 2007
Posts: 9

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

Configuration bits modification on CCS
PostPosted: Tue Jun 30, 2009 10:07 am     Reply with quote

Hi,
I work with PIC18F14K50.
I use CCS Compiler v4.088.

There are many bugs in the compiler to set the clock frequency.

When I use the command:

#FUSES HS
#use delay (clock=20MHz)



--> I found that the really operating frequency is 5 MHz not 20MHz
When I verify with MPLab Simulator I found that:

CONFIG1L = 0x38 --> CPU Divider is set to 4
--> USB Divider is se to 2

To work with 20MHz I must use

#FUSES HS
#FUSES CPUDIV1
#use delay (clock=20MHz)

When I use the command:

#fuses H4
#use delay (clock=48M, oscillator=12M)



No thing work and I found many errors in the CONFIG1L CONFIG1H

To work with 48MHz I must use

#fuses H4
#FUSES CPUDIV1
#FUSES USBDIV1
#FUSES PLLEN
#use delay (clock=48M, oscillator=12M)

But only CPUDIV1 and USBDIV1 was changed

The #FUSES PLLEN don't make any change
So I must change it directly in the end of generated HEX file:

From
:0E00000000C61E1E0008890003C003E0034076
To
:0E00000000D21E1E0008890003C003E0034076



What is the problem?
Can I change directly the configuration bits into CCS
I want to set the register CONFIG1H (Adress:0x300001) to 0xD2


Many thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jun 30, 2009 12:52 pm     Reply with quote

You could use a #rom statement:
Code:
#rom int8 0x300001 = {0xD2}
SAMIR_SBG



Joined: 01 Nov 2007
Posts: 9

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

PostPosted: Wed Jul 01, 2009 10:58 am     Reply with quote

Thanks "PCM programmer" you are the best Smile
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