PWM with TIMER0 (8 bit)

Back to start page

PWM with TIMER0 fast DutyCycle


PWM with TIMER0, simplified block diagram.

8-bit TIMER0 and TIMER2 can each generate two PWM-signals (pin OC0A OC0B OC2A OC2B). 16-bit TIMER1 can also geneate two PWM-signals (pin OC1A OC1B). Sample program below generates a PWM signal (OC0A) with a fixed duty cycle value. Can be used for a "stepup converter".

The full program is available here:

Dimmer - potentiometer - AD - PWM

AD-converter (A0/PC0) 8 most significant bits are copied to TIMER0 PWM (OC0A/PD6). Can be used as a "dimmer" for the LED.

The full program is available here:


Back to start page

 


William Sandqvist    william@kth.se