Go Down

Topic: PWM variable frequency added to the PWM function. (Read 2788 times) previous topic - next topic

Grand Archer

I keep running into this issue for my capacitive discharge welder project.  I need to be able to accurately control the energy discharged with a MOSFET but not being able to easily set the frequency accurately.  It would be nice to see this feature added to the PWM function.

Grand Archer

I have had this capability on other boards right from the start that I've used for our robotics club at college.  It would be a shame to see such a useful feature left out of the next revision. :'(

volvodani

This woul be a nice feature. As you can read an another thread of me  I worte my own function to generate an Low Base Frequency PWM.
So ist das Leben:
Manchmal bis du das Denkmal, manchmal die Taube!

merlin_jim

Good idea.  You can do it hacking the timers, but the code is messy, and apparently can affect other things if you're not careful.

That's probably the main reason it wasn't included; unintended consequences... each pair of PWM pins is tied to a timer that controls the PWM frequency... and millis(), micros(), and other functions depend on TIMER0 being a specific frequency... still, this could all be noted in the documentation about how to use it...

Go Up