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.
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.