I'm trying to generete an interrupt with software on an ATXMEGA256A3. My approach is as follows:
- -Configure PORTB PIN1 as output
-Enable internal pull-up/down resistor on PORTB PIN1 (no effect, should prevent floating)
-Leave PIN1CTRL ISC[2:0]-bits as is (000 = both edges)
-Set PORTB INT0 level to MEDIUM
-Set PORTB INT0 mask to PIN1
-Set PMIC to enable medium level interrupts
-Enable global interrupts
-Have a software routine to write PIN1 value to the PORTB OUTTGL-register to toggle the state of PIN1
-Define an ISR for PORTB_INT0_vect.
Actual outcome: PORTB_INT0_vect ISR is not executed. This is proven by setting a debugger breakpoint inside the routine, which never breaks execution. PORTB INTFLAGS register indicates an interrupt has occured but is not serviced. All register values (PMIC, PORTB, global interrupts...) are correct.
Am I missing some detail? Please help.