relation between frequency and pwm in atmega16

Status
Not open for further replies.

southpaw4471092

Junior Member level 1
Joined
Apr 6, 2012
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,392
Hi,
i wanted to implement dc motor speed control using atmega16 with clock internal 8mhz.
But im unable to do soand i guess i'm not using the proper prescaler.Please help me out with this.

Code C - [expand]
1
2
3
4
void timer0_init()
{
    TCCR0|=(1<<WGM00)|(1<<WGM01)|(1<<COM00)|(1<<COM01)|(1<<CS00)|(1<<CS02);
}


When i give a value to OCR0 in main function, im not able to get the desired result.Please help to know how i can choose a prescaler to get a correct result.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…