PWM

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
abtin
Posts: 1
Joined: Sun Jun 01, 2014 1:30 am

PWM

Post by abtin » Sun Jun 01, 2014 1:38 am

Hi

I recently received my micropython and want to use it to control a small DC motor. I want to use Pololu DRV8835 Dual Motor Driver Carrier (http://www.pololu.com/product/2135) and in odrer to control the speed of motor I need to use PWM output. I searched in the Forum and in the docs but couldn't find any example/document to show how a pin can be configured and used as PWM. I appreciate it if anyone can help me with this.

Cheers,
Abtin

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: PWM

Post by pfalcon » Sun Jun 01, 2014 6:15 pm

Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

User avatar
JonHylands
Posts: 69
Joined: Sun Dec 29, 2013 1:33 am

Re: PWM

Post by JonHylands » Tue Jun 03, 2014 5:58 pm

PWM for DC motor control is completely different than PWM for servo control.

I have some motor control PWM code that works with a much older build (before we switched to stmhal) using the DRV8835. What you really need to do is set up a timer on the appropriate pin, and configure it properly.

If you need it, I can post my PWM code, which includes all the setup required.

- Jon

Post Reply