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

What is the cleanest way to hard code configuration bits?

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



Joined: 21 Feb 2006
Posts: 19
Location: San Diego

View user's profile Send private message

What is the cleanest way to hard code configuration bits?
PostPosted: Mon Jan 07, 2008 10:18 pm     Reply with quote

I just tried my first project with PCD and am not impressed. It sucks to be a beta tester and not at least get a shirt...

Ranting aside I need to be able to setup the configuration bits and not have the #fuse entries over-ride them. What is the best way to do that?

Greg
Ttelmah
Guest







PostPosted: Tue Jan 08, 2008 2:55 am     Reply with quote

The #fuse statements are there to set the configuration bits. Why use anything else?....
However if you want to 'byte' code them, then just don't have any fuse statements, or add a #ROM statement, declaring them with the required numeric values.
Your question is a little like asking "when I turn the steering wheel the wheels move, how can I stop this". It can done, but seems rather 'strange'...

Best Wishes
Greg_R



Joined: 21 Feb 2006
Posts: 19
Location: San Diego

View user's profile Send private message

I've had problems with CCS and the "Valid" fuse li
PostPosted: Tue Jan 08, 2008 9:55 am     Reply with quote

Ttelmah,
I've had problems with the Fuse lists being incomplete before. I don't tend to trust them anymore. Right now I have an external clock oscillator connected to a dsPIC33FJ64MC506. It's runs slow if I set EC. It runs as expected with FRC_PLL.(Yes, I know this means I'm running on the internal) I've checked the Oscillator with a scope and it is running fine.

The second reason is that I have to setup the PLL and VCO to get the speed I want. I may as well put all the clock stuff in one place...

Greg
Ttelmah
Guest







PostPosted: Tue Jan 08, 2008 11:00 am     Reply with quote

So, just use a #ROM statement for the configuration data.
If you either exclude the fuse statements entirely, or put the #ROM after it, this will override the fuse settings.
One way to generate the required values, is to setup all the fuses as you want them, in MPLAB, and it's setup window, then gives the word addresses and values to use. Makes it easier, and safer, than trying to generate them yourself.

The 'reason', is one of the ones that makes sense I'm afraid.....

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