Download to read offline

















This document discusses pulse width modulation (PWM) modes in AVR microcontrollers. It describes fast PWM and phase correct PWM modes. For fast PWM, the timer counts from 0 to its maximum value and resets, generating a waveform at 1/256 the timer clock frequency. Duty cycle is set by comparing the counter to OCR0. For phase correct PWM, the timer counts up then down, generating a waveform at half the fast PWM frequency. Duty cycle is also set by comparing to OCR0. An example is given of configuring fast PWM to generate a 31.25 kHz waveform at 75% duty cycle using an 8 MHz clock.
















