Interrupt problem Xmega128a1

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


i'm trying to work with external interrupt on PORTE pin 0, however it doesn't work at all.

This is what i programmed for this portE:
(using codevisionAVR)
1)global interrupt enable ON:
2)PORTE as input:
// Bit0 Output/Pull configuration: Totempole/No
// Bit0 Input/Sense configuration: Sense both edges
// Bit0 inverted: Off
// Bit0 slew rate limitation: Off
3)PINE control:
// Bit1 Output/Pull configuration: Totempole/No
// Bit1 Input/Sense configuration: Sense both edges
// Bit1 inverted: Off
// Bit1 slew rate limitation: Off
4)interrupt control function:interrupt on pin0 for PORTE:

5)my interrupt routine (less important)
// PORTE interrupt 0 service routine
interrupt [PORTE_INT0_vect] void porte_int0_isr(void)



Remark: port K is well programmed, cause in the main program I set portK to 00110011 and correponding LEDS are on!

Now, I connect a pulse generator with 1Hz to PE0 and nothing happens.

Did I forget or misprogram my interrupt for this pin PE0??

Can't find it.
Please help,

thank you for any suggestions,

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

I don't see any code to configure the PMIC to enable particular interrupt levels. With the XMega, sei is not enough- ya gotta twiddle the PMIC. :idea:

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

You are completely right! now it works, great! I had to program PMIC.CTRL register with the right value, that's all to make it work.
I appreciate your help, it saves me a lot of time!