In my project I am using all external interrupts of atmega32
. However, INT2
is not working. The input is read but nothing happens unlike the rest of the INT0
and INT1
external interrupts.
Code
int main(void)
{
DDRC = 0xFF;
GICR|= (1 << INT0) | (1 << INT1) | (1 << INT2);
GICR|= (1 << INT2);
MCUCR |= (1 << ISC10) | (1 << ISC11)|(1 << ISC00) | (1 << ISC01);
MCUCSR |= (1 << ISC2); //Activating all interrupt to react to rising edges
sei();
while(1)
{
}
return 0;
}
ISR(INT0_vect)
{
PORTC ^= (1 << PC3);
_delay_ms(2000);
PORTC ^= (1 << PC3);
}
ISR(INT1_vect)
{
PORTC ^= (1 << PC0);
_delay_ms(2000);
PORTC ^= (1 << PC0);
}
ISR(INT2_vect)
{
PORTC ^= (1 << PC1);
_delay_ms(2000);
PORTC ^= (1 << PC1);
}
So what is wrong and why it's not working ?