Hi!!
i would like to know what is the frequecy of the pwm, can we vary this freq?? is it fast enough to drive ESC's? the ESC's requires like 450 hz... servos require 50hz, and whats the resolution??
thanks!!
cheers!
Hi!!
i would like to know what is the frequecy of the pwm, can we vary this freq?? is it fast enough to drive ESC's? the ESC's requires like 450 hz... servos require 50hz, and whats the resolution??
thanks!!
cheers!
What I'm about to explain is documented under the PWM section for Maple at http://leaflabs.com/docs/.
There are two functions that provide control of both the PWM frequency and resolution:
Timer1.setPrescaleFactor(prescale)
Timer1.setOverflow(overflow)
You must choose the right timer (there are four) for the PWM pin you're using; there's a chart on the PWM doc page.
Basically, prescale determines what the 72MHz clock is divided by to produce the PWM counter clock. overflow is what the counter clock counts up to during one period of a PWM cycle and determines the resolution. This means:
PWM frequency = 72MHz/(prescale*overflow)
You must log in to post.