XMEGA256A3B interrupts in GCC toolchain?

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

Hi, has anybody encountered problems with interrupts not firing using the xmega256a3b? The device is new to me and I'm experiencing problems.

I can configure the TCC0 timer to continually cycle around as described in the following function:

void SetUpTimer(void)
{
TCC0_PER = 0x07B8; //top value of the counter
TCC0_CTRLA = 0x01; //no prescaler
TCC0_INTCTRLA = 0x03; //high level int on overflow
}

Global interrupts are enabled and the OVIF bit in the TCC0_INTFLAGS gets set when the timer overflows (every 1mSec). I can proove this by polling the OVIF bit from main and toggling an O/P pin.

The problem is the program never jumps to the interrupt vector, even though I believe I have enabled it.

The ISR is defined in my code as follows:

ISR(TCC0_OVF_vect)
{
TimerComplete(); //never goes here!!!
}

I'm using a JTAGICEII.

Please advise if anybody is aware of problems with using the "ISR" macro for the GCC toolchain for the xmega256a3b? If I am missing something in the interrupt config? or if the vector defines in the header file are incorrect?

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

Did you enable the high interrupt level in the PMIC as well? Interrupts in XMEGA are by default "double off", both the global and each level in the PMIC.

Hans-Christian

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

Thanks, yes I just saw this in an older post:

PMIC.CTRL|=PMIC_HILVLEN_bm;

thanks a lot for your reply

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

hce wrote:
Did you enable the high interrupt level in the PMIC as well? Interrupts in XMEGA are by default "double off", both the global and each level in the PMIC.

Are even "triple off": global, specific and in PMIC.