# Basic PWM Project 1.4

## Purpose

This example demonstrates a simple configuration of two PWM channels to generate variable duty cycle signals. This will cause one or more LEDs the evaluation kit to glow repeatedly.

## Hardware Requirements

The following Atmel evaluation kits can be used to run this example:

- AT91SAM7A3-EK
- AT91SAM7S-EK
- AT91SAM7SE-EK
- AT91SAM7X-EK
- AT91SAM7XC-EK
- AT91SAM7L-EK
- AT91SAM7L-STK
- AT91SAM9RL-EK
- AT91SAM9263-EK

## Description

Two PWM channels (channel #1 and channel #2) are configured to generate a 100kHz PWM signal. On channel #1, the signal is configured as left-aligned. On channel #2, the signal is center-aligned and the polarity is inverted.

On most Atmel evaluation kits, PWM signals for channels #1 and #2 are connected to two LEDs on the board. Since the duty cycle of the PWM signals varies continuously, the two LEDs will alternate between their minimum and maximum intensity. Note that on some boards, only one LED will be connected.

## Usage

1. Build the program and download it inside the evaluation board. Please refer to the SAM-BA User Guide, the GNU-Based Software Development application note or to the IAR EWARM User Guide, depending on your chosen solution.
2. Optionally, on the computer, open the DBGU port with a terminal application (e.g. HyperTerminal on Microsoft Windows), to see debug traces output by the example.

- Settings: 115200 bauds, 8 bits, 1 stop bit, no parity, no flow control.

3. Start the application.
4. Depending on the board being used, either one or two LEDs will start glowing. If two LEDs are glowing, their states will be inverted (since channel #2 uses a reversed polarity).

###### Atmel Corporation ©2008