Thanks for the help on my previous issue. I am trying to implement the CONFIG statement at the start of my code and it seems no matter which way I try to use it it gives me a mass load of errors/warnings when I try to build. Anyone have any ideas where I should start? I'm using Hi-tech C Compiler and MPLAB to do the programming.
Fair enough .
This is my first successful code of a blinking LED, that is successful without the CONFIG statement. With it I get 30+ errors saying ';' expected, conflicting delcarations, etc.
Code:
#include <htc.h>
#define _XTAL_FREQ 4000000
__CONFIG(INTIO & WTDDIS & MCLRDIS & UNPROTECT)
void main(void){
int i;
PORTA = 0x00; // PORTA low
CMCON0 = 0x07; // turn off comparators
ANSEL = 0x00; // turn off ADC
TRISA = 0x00; // RA1 as output
while(1 == 1){
if(RA1 == 0){
RA1 = 1;
}
else{
RA1 = 0;
}
for(i = 0; i <= 127; i++){
__delay_ms(2);
CLRWDT();
}
}
}