Dedicated pwm generator

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Request group membership
By: Jev Kuznetsov, created: 2013-04-04 | updated: 2013-04-04

A simple (assembly) pwm object based on an example from application notes.


Original File Upload
Package icon pwmAsm.zip1.5 KB


[originally posted by Anonymous on 2013-03-01 07:11:28] This PWM program has a problem, perhaps due to the order in which operations occur and how data get stored. If you run: pwm1.start(pwm1pin) pwm2.start(pwm2pin) pwm2.SetDuty(3000) pwm1.SetDuty(1000) the PWM1 output gets screwed up. Change the order to: pwm1.start(pwm1pin) pwm1.SetDuty(1000) pwm2.start(pwm2pin) pwm2.SetDuty(3000) and the program works fine. I tried to debug the original pwmAsm.spin, but gave up. Use caution.