This is the documentation for the data structures, functions, variables, defines, enums, and typedefs for the TC driver.
It also gives an example of the usage of the TC module.
This example involves one TC channel configured in capture mode (input). Upon a chosen GPIO pin change, an event triggers a TC.Ai capture.
The GPIO pin PA11 is programmed to output a peripheral event whenever the interrupt condition pin value falling edge is detected.
Since we're using PA11 as event generator, channel 1 of the TC0 module is used as event user (cf. the table "Peripheral Event Generators and Users Interconnection" from the UC3L datasheet). The selected timer input clock is the internal clock labelled TC4 referred to as TIMER_CLOCK4 in the datasheet.
Upon a falling edge detection on the GPIO pin, an event is generated. This event generator triggers a TC0.A1 capture. When the TC0.A1 capture occurs, an interrupt is triggered and LED0 (connect STK600.PORTA.PA4 to STK600.LEDS.LED0) is toggled by the interrupt handler.
This software was written for the GNU GCC for AVR32 and IAR Systems compiler for AVR32. Other compilers may or may not work.
All AVR32 UC3L devices with a TC module and a Peripheral Event System can be used. This example has been tested with the following boards:
CPU speed:
For further information, visit Atmel AVR32.