PWM for motor driver
Posted: Tue Feb 24, 2015 11:55 pm
Hi All,
I'm trying to write a module for the SparkFun Motor Driver TB6612FNG
I'm struggling to understand how to use the PWM features of the TimerChannel and would appreciate any help I can get.
I'm not sure what to set the freq and pulse_width to, the datasheet mentions a max 100 kHz frequency on the PWM pins but I'm not sure how use that fact.
Once the channel is configured, is the timer.pulse_width_percent the correct way to vary the motor speed?
I've read the following pages but I'm still confused
http://micropython.org/doc/module/pyb/Timer
http://docs.micropython.org/en/latest/l ... #pyb-timer
http://wiki.micropython.org/platforms/b ... r-Examples
Thanks for your help,
Chris
I'm trying to write a module for the SparkFun Motor Driver TB6612FNG
I'm struggling to understand how to use the PWM features of the TimerChannel and would appreciate any help I can get.
I'm not sure what to set the freq and pulse_width to, the datasheet mentions a max 100 kHz frequency on the PWM pins but I'm not sure how use that fact.
Once the channel is configured, is the timer.pulse_width_percent the correct way to vary the motor speed?
I've read the following pages but I'm still confused
http://micropython.org/doc/module/pyb/Timer
http://docs.micropython.org/en/latest/l ... #pyb-timer
http://wiki.micropython.org/platforms/b ... r-Examples
Thanks for your help,
Chris