Problem int0 and int2 are working but int1 is not.
Why is INT1 not working?
Picbuster
Part of interrupt routine
void interrupt ISR()
{
if (INTCON3bits.INT2IF) // working
{
INTCON3bits.INT2IF=0 ;
Xport1('&');
Display_Bl = Off; //led
}
if (INTCON3bits.INT1IF)
{
INTCON3bits.INT1IF=0; // not working
Xport1('#');
Display_Bl = On; // led
}
}
//================ end of interrupt
// ========== in main setup for interrupts
TRISB = 0b00001111; set inputs
INTCON3bits.INT1E=On;
INTCON3bits.INT1IE=On; // enable interrupt 1
INTCON3bits.INT2E=On;
INTCON3bits.INT2IE=On; // enable interrupt 2
INTCON3bits.INT1IF=0; // clear flag
INTCON3bits.INT2IF=0; // clear flag
INTCONbits.GIE=On; // global on
INTCONbits.PEIE=On;
while (1) //loop
{
__delay_ms(20); // just wait
}
//========================= test input b1 =========================
Find out if connection to chip or chip itself fails
INTCON3bits.INT1IE=Off;
disable interrupts for int1
while (1)
if (PORTBbits.RB1) // input RB1 is Working !!!
{
Xport1('@');
Display_Bl = On; // led
}
// hardware input and chip are working but INT1 when activated is remains dead.
Why is INT1 not working?
Picbuster
Part of interrupt routine
void interrupt ISR()
{
if (INTCON3bits.INT2IF) // working
{
INTCON3bits.INT2IF=0 ;
Xport1('&');
Display_Bl = Off; //led
}
if (INTCON3bits.INT1IF)
{
INTCON3bits.INT1IF=0; // not working
Xport1('#');
Display_Bl = On; // led
}
}
//================ end of interrupt
// ========== in main setup for interrupts
TRISB = 0b00001111; set inputs
INTCON3bits.INT1E=On;
INTCON3bits.INT1IE=On; // enable interrupt 1
INTCON3bits.INT2E=On;
INTCON3bits.INT2IE=On; // enable interrupt 2
INTCON3bits.INT1IF=0; // clear flag
INTCON3bits.INT2IF=0; // clear flag
INTCONbits.GIE=On; // global on
INTCONbits.PEIE=On;
while (1) //loop
{
__delay_ms(20); // just wait
}
//========================= test input b1 =========================
Find out if connection to chip or chip itself fails
INTCON3bits.INT1IE=Off;
disable interrupts for int1
while (1)
if (PORTBbits.RB1) // input RB1 is Working !!!
{
Xport1('@');
Display_Bl = On; // led
}
// hardware input and chip are working but INT1 when activated is remains dead.