Port pin change interrupt not triggering

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

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.
Desired outcome: Every time the software routine is called, PORTB_INT0_vect ISR is invoked.

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your procedure should work. The problem may be due to your code.

Ozhan KD
Knowledge is POWER