Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The benifit of PWM generation is:
* low frequency jitter
* low duty cycle jitter
* extremely low and extremely high duty cycle possible
* no processing power needed (besides setup)
Maybe 5%. This gives 20 steps. 20 steps in 5ms.
Means you need to generate interrupt with 200Hz x 20 = 4000Hz.
This means you need to setup your timer to generate an interrupt eveery 250us.
Within the ISR you need a counter.
increment the counter every time you enter the ISR. set it to zero if it is >=19.
So it counts 0 up to 19.
Now you have to compare this counter with your PWM value. ( in the range of 0...20)
if pwm_value > counter then set PWM_PORT, else clear PWM_PORT.
return from ISR
****
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.