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

#fuses not working as expected - 18F24K22

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



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

#fuses not working as expected - 18F24K22
PostPosted: Wed Dec 14, 2011 10:16 pm     Reply with quote

I am running the latest (4.128) PCH with MPLAB as the IDE, and #fuses don't seem to work on all the bits. In particular, I can't enable the WDT. My fuses statement is:

Code:
#fuses XT,NOPROTECT,NOLVP,NOFCMEN,NOIESO,WDT,WDT4096,PLLEN,BROWNOUT,NOPBADEN


The single source file has a #device PIC18F24K22 (instead of the full .h include) because I am not using any library functions.

After cleaning the project and doing a make (F10 on MPLAB) I look at the Config bits in MPLAB and they always say "Watchdog timer is always disabled. SWDTEN has no effect." Also this is confirmed by examining the .HEX file produced and seeing that it contains:

:0E0000000031193400BD000003C003E00340CE

The "34" after the "3119" is CONFIG2H.

Any idea what I am doing wrong? This always worked find on midrange projects (PCM) but this is my first PCH project.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 15, 2011 12:03 am     Reply with quote

See this post about fuses and Debug/Release mode. It may apply to
your problem:
http://www.ccsinfo.com/forum/viewtopic.php?t=46950&start=6
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

PostPosted: Thu Dec 15, 2011 5:00 am     Reply with quote

PCM programmer wrote:
See this post about fuses and Debug/Release mode. It may apply to
your problem:
http://www.ccsinfo.com/forum/viewtopic.php?t=46950&start=6

Yup, that was it. After changing the build configuration to "Release", all the config bit settings responded as expected to the #fuses statement. Thanks.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
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