Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TC Example 2 for xplain Documentation

Introduction

This simple example shows how to use the Timer Counter (TC) to generate single slope PWM.

Main files:

  • tc.c Timer XMEGA Timer Counter driver implementation
  • tc.h Timer XMEGA Timer Counter driver definitions
  • tc_example2.c example application
  • conf_example.h: configuration of the example

TC Driver

The XMEGA TC driver can be found here.

Device Info

All AVR XMEGA devices with an tc can be used.

Description of the example

The example uses and configures two TC modules.

Each time the 50ms overflow interrupt of TIMER_EXAMPLE is executed the TIMER_PORT_LED single slope PWM duty cycle is changed so that it result visible on LEDO light intensity.

Compilation Info

This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.

Contact Information

For further information, visit Microchip.