amayilsamy
Advanced Member level 1
- Joined
- Feb 5, 2013
- Messages
- 420
- Helped
- 38
- Reputation
- 76
- Reaction score
- 34
- Trophy points
- 1,308
- Location
- Chennai,India
- Activity points
- 3,370
Here I posted my code
Here _delay_ms(200); & __delay_ms(800);
Shows error "unable to resolve the identifier"
And "__CONFIG(MCLRE_ON & CP_OFF & CPD_OFF & BOREN_OFF & WDTE_OFF & PWRTE_OFF & FOSC_INTRCIO);"
shows"unexpected token"
How to solve this.
I'm using XC8 compiler.
Code:
#include <xc.h>
#define _XTAL_FREQ 4000000 // oscillator frequency for _delay()
//***** CONFIGURATION *****/
// ext reset, no code protect, no brownout detect, no watchdog,
// power-up timer enabled, int RC clock
/***** MAIN PROGRAM *****/
void main()
{
//*** Initialisation
// configure port
TRISIO = 0b111101; // configure GP1 (only) as an output
//*** Main loop
for (;;)
{
GPIO = 0b000010; // turn on LED on GP1 (bit 1)
__delay_ms(200); // stay on for 200 ms
GPIO = 0; // turn off LED (clearing GPIO clears GP1)
__delay_ms(800); // stay off for 800 ms
} // repeat forever
}
Here _delay_ms(200); & __delay_ms(800);
Shows error "unable to resolve the identifier"
And "__CONFIG(MCLRE_ON & CP_OFF & CPD_OFF & BOREN_OFF & WDTE_OFF & PWRTE_OFF & FOSC_INTRCIO);"
shows"unexpected token"
How to solve this.
I'm using XC8 compiler.