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

Fuses won't stay?

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



Joined: 24 Nov 2007
Posts: 5

View user's profile Send private message

Fuses won't stay?
PostPosted: Sat Nov 24, 2007 1:02 pm     Reply with quote

Fuses I set in MPLAB change after I rebuild my project. I've tried in MPLAB 7.50, 7.61a and 8.00 with PIC-C v4.042 on a 16F689 and 16F886. I've also tried setting them in code with #fuses on the 16F886, every fuse except the oscillator fuse worked.

Anyone else had problems like this?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Nov 24, 2007 1:24 pm     Reply with quote

This post may help:
http://www.ccsinfo.com/forum/viewtopic.php?t=29087
Beta2K



Joined: 24 Nov 2007
Posts: 5

View user's profile Send private message

PostPosted: Sat Nov 24, 2007 2:46 pm     Reply with quote

That doesn't appear to fix it... I switched the output format and tried both set in code and not.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Nov 24, 2007 10:27 pm     Reply with quote

1. What operating system are you using ?

2. I'm assuming that you installed the current CCS "plugin" that's
available for download on the CCS website.

3. Post a very short test program that shows the problem with the fuses.
This post has an example of what I mean by a short program:
http://www.ccsinfo.com/forum/viewtopic.php?t=32258&start=3

4. If you're running XP or Win2K, I can download MPLAB 8.0 and test it
and see if I can duplicate the problem.
Beta2K



Joined: 24 Nov 2007
Posts: 5

View user's profile Send private message

PostPosted: Sun Nov 25, 2007 6:12 pm     Reply with quote

PCM programmer wrote:
1. What operating system are you using ?


Windows XP SP2

PCM programmer wrote:
2. I'm assuming that you installed the current CCS "plugin" that's available for download on the CCS website.


Yes I have

PCM programmer wrote:
3. Post a very short test program that shows the problem with the fuses.
This post has an example of what I mean by a short program:
http://www.ccsinfo.com/forum/viewtopic.php?t=32258&start=3


Code:

#include <16F886.h>

#FUSES NOWDT,XT,NOPROTECT,NOPUT,NOBROWNOUT,NOWRT,NOCPD,NOLVP,MCLR,NOIESO,NOFCMEN
#USE DELAY(clock=8M, crystal, restart_wdt)
void main(void) {
   setup_adc(ADC_OFF);
   setup_comparator(NC_NC_NC_NC);
   setup_ccp2(CCP_PWM);
   setup_timer_2(T2_DIV_BY_16, 127, 1);
   set_pwm2_duty(0);
        while(1);
}


That does it, tho I've tracked it down since I was cutting down code to post to the #USE DELAY line. Whatever I set in there overrides #FUSES line, oscillator as I had it set give me the EC fuse, crystal gives HS, and internal gives the INT_RC

Odd behaviour to me but at least I found the problem...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 25, 2007 6:20 pm     Reply with quote

Quote:
#USE DELAY(clock=8M, crystal, restart_wdt)

So this was the problem. I never use that feature. I only put the
frequency in the #use delay() statement. I set the oscillator type
with the #fuse statement.
Beta2K



Joined: 24 Nov 2007
Posts: 5

View user's profile Send private message

PostPosted: Mon Nov 26, 2007 12:00 am     Reply with quote

PCM programmer wrote:
Beta2K wrote:
#USE DELAY(clock=8M, crystal, restart_wdt)

So this was the problem. I never use that feature. I only put the
frequency in the #use delay() statement. I set the oscillator type
with the #fuse statement.


Yes that's the offending code. Sure threw me trying to figure it out... I'll do the same as you from now on and avoid specifying a clock source in #USE DELAY

Thanks for the help!
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