r_guna_sekar
Newbie level 6
hi
i'm trying to use three external interrupts...
in this code the interrupts are working fine.. (I tested it with LED)
But i Cant Read Or Update the mic_num in this code
i'm trying to use three external interrupts...
in this code the interrupts are working fine.. (I tested it with LED)
But i Cant Read Or Update the mic_num in this code
Code:
#define LED PORTD.F0
unsigned int mic_num = 0;
void interrupt()
{
if(INTCON.F1 == 1)
{
mic_num = 1;
}
else if(INTCON3.F0 == 1)
{
mic_num = 2;
}
else if(INTCON3.F1 == 1)
{
mic_num = 3;
}
}
void main()
{
TRISD = 0x00; // for Display, LED, Relay
TRISC = 0x00;
TRISB = 0xFF;
LED =1;
delay_ms(1000);
LED =0;
PORTC = 0;
INTCON = 0b10010000;
INTCON2 = 0b01110000;
INTCON3 = 0b00011000;
RCON.IPEN = 0;
while(1)
{
if(mic_num > 0) // this Part is not working
{
LED = 1;
}
}
}