Data Sheet

MD04 PC setup program
We have a simple configuration program for the PC that will allow you to change the communication
type and if necessary the baud rate
Modes of operation
I2C mode
I2C mode operates with a device address set in the USB configuration. The MD04 has 8 registers:
Register Name Read/write Description
0 Command R/W Write 1 for forwards, 2 for reverse, 0 for instant stop
1 Status R Acceleration, temperature and current status
2 Speed R/W Motor speed 0-255 (0x00 - 0xFF)
3 Acceleration R/W Motor acceleration 0-255 (0x00 - 0xFF)
4 Temperature R Module temperature in degrees centigrade
5 Motor current R Motor current
6 Unused R Read as zero
7 Version R Software revision
Command register
Controls the motor start, stop and direction. Write 1 to drive forwards, Write 2 to reverse, Write 0 to
stop instantly. Be sure to have set the speed and acceleration before issuing these commands.
Note - The way to stop the motor is the same as other speed changes, write the new speed to the speed
register and re-issue the direction command. This will cause the motor to decelerate to a stop at the rate
set by the acceleration register. If you wish the motor to stop instantly and bypass the acceleration
feature then write zero here, be aware that bypassing the acceleration routines does put high stresses on
gearboxes of motors.
© Devantech Ltd 12/07/15 MD04 documentation 4/8