Using Hardware Fast PWM Mode and Testing With Data Visualizer

Last modified by Microchip on 2026/11/16 09:39

AVR® Microcontrollers: Using Hardware Fast PWM Mode and Testing With Data Visualizer

In This Video

  • Understand the Fast PWM timing diagram.
  • Modify the PWM initialization function to configure 11-bit PWM and clear Output Compare 1B (OC1B) on compare match.
  • Find that OC1B is an alternate pin function of PB2 and set this as an output.
  • Use the Data Visualizer's GPIO view in pin mode to analyze the output waveforms.
  • Utilize cursors to measure the frequency of the waveforms of both the LED pin (PB5) and OC1B (PB2).
  • Check the measured frequency (7813 Hz) against the formula in the data sheet (7812 Hz), showing the frequency is measured as expected.