View previous topic :: View next topic |
Author |
Message |
Beta2K
Joined: 24 Nov 2007 Posts: 5
|
Fuses won't stay? |
Posted: Sat Nov 24, 2007 1:02 pm |
|
|
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
|
|
|
Beta2K
Joined: 24 Nov 2007 Posts: 5
|
|
Posted: Sat Nov 24, 2007 2:46 pm |
|
|
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
|
|
Posted: Sat Nov 24, 2007 10:27 pm |
|
|
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
|
|
Posted: Sun Nov 25, 2007 6:12 pm |
|
|
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
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
|
|
Posted: Sun Nov 25, 2007 6:20 pm |
|
|
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
|
|
Posted: Mon Nov 26, 2007 12:00 am |
|
|
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! |
|
|
|