Atmega8 microcontroller- to detect the dutycycle of PWM

Status
Not open for further replies.

sathishkumarnano

Newbie level 1
Joined
Oct 9, 2013
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
0
Activity points
11
Hai friends..

I hope you people only help to me in this simplest project.!!!

I wrote a program for generating 10%, 20%, 30%... dutycycles of pulses in atmelstudio6 for atmega8 MC. Now i wanna to detect that pulses and need to glow the LED respective to that dutycycles.

For example, i took one input pin and 6 output pin. when 10% of duty cycle is received at input pin, Led1 will be glow which is connected in (PD0) first output pin. If i give a 20% dutycycle pulses as a input then LED 2 will be glow (PD1), etc... Like wise the 6 Led want to be glow with respect to different dutycycles of pulses..

I wanna thid program... Please help me
 

so your problem is detection of PWM input.... the way to do this is use timer counter and measure the period when there is high detected on the input pin.... say 10% or 20% etc....and based on the counter reading you can make LED's On (output pin of the particular port).....

Good Luck
 

atmega input capture function is well suited for th eapplication.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…