PWM (Pulse Width Modulation) Selecting the Correct WGM (Waveform Generation Mode)

There are two types of WGM (Waveform Generation Modes), phase correct or fast PWM. Within those modes, you can set the WGM to be CTC (Clear on Timer Compare) where the timer resets to 0 when it reaches a specific number. The top of the timer/counter can be 8-bit or a 16-bit top value (depending on the timer used 8 to 16 bit). For fast PWM, WGM13, WGM12 and WGM11 are set (WGM10 is not set) and the ICR1 value determines the top of the counter.



Back to blog

Leave a comment

Please note, comments need to be approved before they are published.