Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PWM driver example 2 - XMEGA-A1 Xplained Documentation

Introduction

This example shows how to use the XMEGA Pulse Width Modulation (PWM) service with interrupts.

Main Files

Device Info

This example is made specifically for XMEGA-A1 Xplained. However, any XMEGA board with LEDs connected to PE0 and PE4 may be used.

Description of the example

This example uses two PWM channels on two different LEDs. An interrupt is triggered on each PWM TC overrun, and the interrupt handler will increase the duty cycle of the PWM channels, thus fading the LEDs out (since the LEDs are active low, increased duty cycle means more dimmed light). The two PWM channels are running two different frequencies to make the fading speed different.

Dependencies

This example depends on the following module:

PWM Service API

The PWM service API can be found here

Compilation info

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

Contact Information

For further information, please visit atmel.com.