Lucky Chris
Joined: 04 Dec 2006 Posts: 1
|
Configuration bits problem |
Posted: Tue Dec 05, 2006 11:54 am |
|
|
Hi,
I am using a PIC12F509 for a small project, and I encountered a problem during I/O testing with a simple program.
The compiler seems to overwrite my configuration bits (#fuses INTRC, NOMCLR, etc.) with the ones in MPLAB IDE Configure->Configuration bits. If I change the #fuses, nothing changes, unless I change it in MPLAB IDE.
Code: | #if defined(__PCB__)
#include <12F509.h>
#fuses INTRC
#fuses NOWDT
#fuses NOMCLR // NOMCLR -> No master clear, RE3 enabled as I/O
#use delay(clock=8000000)
void main (void)
{
int toggle = 0;
SET_TRIS_B(0x00);
while(TRUE)
{
if (toggle == 0)
{
toggle = 1;
}
else
{
toggle = 0;
}
output_bit(PIN_B1,toggle);
delay_ms(100);
}
} |
I've worked with PIC18F4431 before and never seen something like that.
Your ideas will be really apreciated,
Thanks |
|