Efficient Software PWM (4+ channels)

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is a tutorial on pwm waveform generation for servos in software with other interrupts enabled and using only one timer overflow interrupt for duty cycle precision.

 

http://oskit.se/efficient-softwa...

 

I currently have it running with +-16us precision. Greatest challenges has been getting it to run exactly with other interrupts getting in the way. This solution solved many of these issues.

 

Code is partly in the post, and partly in my avr micro firmware framework. Which, well, is currently at two places itself, one here: https://github.com/mkschreder/av... and one here: https://github.com/mkschreder/fo..... I will put them all in one place. That's zee plan. :=)

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer

Last Edited: Wed. Aug 9, 2017 - 03:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The link to this "tutorial" is dead so moving this out of the Tutorial Forum

 

(and there's a lesson here for us all - post complete tutorials - not links to sites that may die!)