Introduction

This application note is an introduction to the use of the high-speed Pulse Width Modulator (PWM) available in some Atmel® tinyAVR® microcontrollers such as Atmel ATtiny26, Atmel ATtiny15, etc.

The advantage of high-speed PWM is the increased bandwidth of the analog output signal. The high frequency further allows for smaller and less expensive filter components to be used in shaping the signal.

  • The fast PWM is used to generate a pulse train with varying duty-cycle
  • The PWM output is generated on the OC1A output pin (PB1)
  • An analog filter can be used to shape the digital PWM output to obtain an analog signal such as a sine wave
  • Assembly and C code examples are provided to show the usage of high-speed PWM in the ATtiny26