hello
using mplab v8.30 with mplab c18 v3.10.
i am writing a simple program for my class assigment , i get a syntax error and don't know the reason for it.
the Code :
the error is in the line with the "void interrupt sw(void)"
any suggestions ?
using mplab v8.30 with mplab c18 v3.10.
i am writing a simple program for my class assigment , i get a syntax error and don't know the reason for it.
the Code :
Code:
#include <p18f452.h>
#include <stdlib.h>
unsigned char a;
void main(void)
{
TRISB=0x3f; //PORT B AS INPUT
TRISC=0X0; //PORT C AS OUTPUT
INT0IE=1; //ENABLE INT0
INT0IF=0; //reset INT0
INTEDG0=1; //INTERRUP ON RISING
PEIE=0; //ENABLE HIGH PERIORITY
GIE=1; // ENABLE ALL INTERRUPT
while(1)
{
if ((a&0x1)==0)PORTCbits.RC0=1;
else PORTCbits.RC0=0;
}
}
void interrupt sw(void)
{
a=a+1;
for(j1=0;j1<2000;j1++); //DELAY
INT0IF=0;// RESET INT0
return;
}
the error is in the line with the "void interrupt sw(void)"
any suggestions ?