ms. mmuw mm film t 2m
50mm cuLURAUu usu
Bis
Serial Motor Driver User Guide
2009.12.17
© 2009 SparkFun Electronics, Inc. All Rights Reserved. Product features, specifications, system requirements and availability are subject to change without notice. Serial
Motor Driver (ROB-09571) is a trademark of SparkFun Electronics, Inc. All other trademarks contained herein are the property of their respective owners.
ButtonpadControllerUSB_UG_090126
current state.
The UART hardware interface is also available via 4 header pins along the side of the device. The signals on this
UART interface are TTL level and need to be shifted to RS232 levels to use this with a computers COM port. Also,
the header pin labeled 5V is only to be used as an output as it is from the output of a regulator on the board; do not
apply power to this pin.
There is a 6 pin header along the top of the board that breaks out several pins from the AtMega328 microcontroller,
along with a power bus. These pins have been made available in case the user intends to modify the firmware or
create their own.
Command Interface
The serial command interface used to control the motors is very straightforward. A command consists of four
characters: the motor number, the direction indicator, the speed constant, and a carriage return. Here is a table
describing the command:
Only one motor can be addressed per command; the indicator character determines which motor is being addressed.
The direction character commands the motor to turn either forward ('f' or 'F') or reverse ('r' or 'R'). The speed is
entered with an ascii number anywhere in the range of 0 and 9. If '0' is ued for the speed, the motor will be stopped
(and the direction indicator doesn't matter). If '9' is entered for the speed value, the motor will run at full speed. If any
other speed value is used, the motor will receive a pulse width modulation signal to control the speed.
If an invalid character or an invalid message is entered, the device will echo an error response back on the serial
interface and no changes will be made to the motors speed or direction.
Motor Ind. Direction Speed End of Command
'1' or '2' 'f' or 'r' (case insensitive) '0'-'9' '/r'
Speed Value PWM Duty Cycle
'0' Off
'1' 11%
'2' 22%
'3' 33%
'4' 44%
'5' 55%
'6' 66%
'7' 77%
'8' 88%
'9' 100% (Full Speed)