I am using an ATmega644 and is attempting to set up pin-change interrupts
for ports PA4/PCINT4 & PA5/PCINT5. I've used the following code.
Apparently, no interrupts are coming. Any obvious faults?
When in the interrupt handler, how should a decide what pin created the
interrupt? I can't find a flag-bit that carries this
information.
// Set
External Interrupt Control Register A to trigger on both edges
BCLR(EICRA,ISC01);// ISCn1 = 0
BSET(EICRA,ISC00);// ISCn0 = 1 // Enable
Pin Change Interrupts
BSET(PCICR,PCIE0);
BSET(PCMSK0,PCINT0);
BCLR(EIFR,INTF0);// Clear INTF0
Flag
BSET(EIMSK,INT0);// Enable
external interrupt INT0
BSET(SREG,7);// Enable Global
Interrupt
} // InterruptInit()
//---------------------------
// External Interrupt handler
//---------------------------
ISR(INT0_vect)
{ // Detect
were interrupt came from (PA4 or PA5) ...
}