Back to DRIVERS page

# AVRŽ32 AT32AP7000 Software Framework: Pulse Width Modulation (PWM) Driver

Copyright © 2006-2008 Atmel Corporation

## Introduction

The Pulse Width Modulation Controler (PWM) controls several channels independently. Each channel controls one square output waveform. Characteristics of the output waveform such as period, duty-cycle and polarity are configurable.

## PWM Software Driver

This driver provides an API to get access to the main features of the PWM controler. Its "philosophy" of usage is:

- Initialize the PWM controller (mode register) and disable the interrupt [pwm_init()]
- Initialize a specific PWM channel [pwm_channel_init()]
- Start one or several PWM channels [pwm_start_channels()]
- Stop one or several PWM channels [pwm_stop_channels()]
- Eventually update the duty cycle or the period of the output waveform of a channel, synchronous method [pwm_sync_update_channel()]
- Eventually update the duty cycle or the period of the output waveform of a channel, asynchronous method [pwm_async_update_channel()]

  The driver is composed of pwm.c and pwm.h.

  ## PWM Software Driver Examples

  One example is available: how to configure a PWM and output it on a GPIO..

  AVR is a registered trademark of Atmel Corporation.