Microchip® Advanced Software Framework

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

Introduction

This simple example shows how to use the XMEGA Pulse Width Modulation (PWM) service to dim LEDs.

Main Files

Device Info

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

Description of the example

This example sets up 4 PWM channels and outputs them to 4 different LEDs, giving the impression the LEDs are dimmed. All 4 PWM channels are set up with the same frequency, but uses different duty cycles to give different level of dimming. LED3 is set up to light constantly (since the LEDs are active low, this means 0% duty cycle)

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.