Naumanpak
Member level 2
Experts,
I am not getting interrupts working.
From the data sheet, I have set out the values for bits but doesnt work. I can use it a a simple input port but not with interrupts. kindly help me out.
here is a simple test code I wrote,
thanks
I am not getting interrupts working.
From the data sheet, I have set out the values for bits but doesnt work. I can use it a a simple input port but not with interrupts. kindly help me out.
here is a simple test code I wrote,
Code:
int count=0;
void interrupt() // Interrupt function definition
{
INTCON.INT0IF=0;
count++;
}
void main()
{
TRISB = 0;
INTCON.INT0IF=0;
INTCON.INT0IE=1;
PORTB = 0;
Lcd_Init(&PORTB); // Initialize LCD connected to PORTB
Lcd_Cmd(Lcd_CLEAR); // Clear display
Lcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor off
Lcd_Out(1, 1, "Waiting..");
while(count==0);
Lcd_Out(1, 1, "interrupt!!1");
}
thanks