Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4931

How can i generate 4 PWM Signal in Atmega32

$
0
0
As i know that Atmega32 has 4 PWM Pin. I only know how to generating Timer0 Pwm. using following code.
void PWM_init()
{
/*set fast PWM mode with non-inverted output*/
TCCR0 = (1<<WGM00) | (1<<WGM01) | (1<<COM01) | (1<<CS00);
DDRB|=(1<<PB3); /*set OC0 pin as output*/
}

How can i write code for timer 1 and 2 in the same way as well.

Viewing all articles
Browse latest Browse all 4931

Latest Images

Trending Articles



Latest Images