This simple example shows how to use the Timer Counter (TC) to toggle LEDs.
The XMEGA TC driver can be found here.
All AVR XMEGA devices with an tc can be used.
The example will configure one TC module (TIMER_EXAMPLE) in normal mode and use three TC interrupts (overflow, Capture/Compare Channels A and B).
The TC is setup to use a 31250Hz resolution clock and a 31250 period value resulting in a 1Hz TC overflow frequency. Compare Channels A and B will be setup at 1/4 and 1/2 of the TC period.
Each callback interrupts functions are setup to toggle a LED.
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
For further information, visit Microchip.