I have tried the code in other compiler(XC16) it works fine, so the problem is not in the hardware.
The problem seems to be in the compiler.
The interrupt flags are generating which checked by polling them, but the ISR is not executed.
Here is the test code which i am running
Code: Select all
#define HZ_LED LATB3_bit
void Timer1Int() iv IVT_ADDR_T1INTERRUPT {
T1IF_bit = 0; // Clear T1IF
HZ_LED=~HZ_LED;
}
any suggestions????
void main() {
ADPCFG = 0xFFFF; // Initialize AN pins as digital
TRISB = 0; // initialize PORTB as output
IPC0 = IPC0 | 0x1000; // Interrupt priority level = 1
T1IF_bit = 0; // Clear T1IF
T1IE_bit = 1; // Enable Timer1 interrupts
T1CON = 0x8030; // Timer1 ON, internal clock FCY, prescaler 1:256
HZ_LED=1;
while (1) // Endless loop, interrupted by Timer1Int
;
}