For your NXT or EV3
Sensors
Accelerometer, Compass & Gyro
Motor Multiplexers & Controllers
Wireless Control
Sensor Adapters & Multiplexers
RC Servos, Mountings & Pneumatics

Sensor Kits
Flexi-Cables & Cable Extenders
Classroom packs of Flexi-Cables
Plugs and Connectors
Power Options
Other Robotics accessories

EV3 Console Adapter
EV3 Sensor Adapter for NXT or Arduino
EV3 Compatibility Info

Android App for NXT/EV3

Arduino Products
Shields and Controllers

Raspberry Pi Products
For your Raspberry Pi

Connect with us
Google+
Shopping Cart
Your cart is empty.

Ordering Information
Our Distributors
World Wide Shipping
How to Order and Pay
Paying by Credit Card
Your satisfaction is important to us
About mindsensors.com
Site Map

Yondering ...
Forums
FAQ
Videos
Coming Soon ...
End of Life Products
Robotics related Links

Downloads
NXT Product Docs and Software
User Guides
EV3 Blocks
API's and Sample Programs
NXT-G Blocks
All Downloads

EV3 Programming Environment
Which Programming Environment do you prefer for EV3?
EV3 Home Edition
EV3 Edu Edition
LeJOS
MonoBrick
RobotC
ev3dev
Other



[View Result]

Votes: 1234
Translate this site
Translate this site: (Courtesy of Google™)
Search Web Pages



Need Quote for your School?
Write e-mail to:
info
Need Technical Support?
Write e-mail to:
support
Note your order number in the support request.
You can find order number on your Packing-slip or Order confirmation e-mail.


Proud Supporter of:
Robofest


Trinity College Fire Fighting Robot Contest.

Contact:
E-mail:
info
Address:
mindsensors.com

8623 Mayland Drive
Henrico, VA 23294-4703 USA.
Phone: (804) 767-8116
Fax: (804) 747-5303
Official PayPal Seal
Motor Multiplexer (MOTORMUX)
Features
Motor Multiplexer for RCX

This Motor Multiplexer (MOTORMUX) is specifically designed medium power motor controller, to drive upto four LEGO motors. It's designed as a Quad 35Volt 0.6Amp H Bridge Motor Drive.

  • Ease of use and flexibility.
  • Drives upto four motors independently.
  • Forward, Reverse, Brake and Float control.
  • 256 speed settings for each motor.
  • Read/write control for all the parameters of motor.
  • LED to indicate selected address.
  • Uses external up to 35 Volts of power supply for motors.
  • A standard 5V supply for the control logic, derived from I2C connector consumes maximum of 10mA.
  • Control of the module can be done by any I2C master device. RCX can control MOTORMUX module with aid of RCX-I2C interface.
  • Can connect several MOTORMUX to single RCX-I2C controller.


I2C Mode and communication
I2C communication protocol with this MOTORMUX module is the same as popular EPROM?s such as the 24C04.
To read one or more of the MOTORMUX registers, first send a start bit, the module address (0XB4 for example) with the read/write bit low, then the register number you wish to read. This is followed by a repeated start and the module address again with the read/write bit high (0XB5 in this example). You are now able to read one or more registers.

TIP: For IR communication with MOTORMUX, use 'Low Range' setting on your RCX.

The MOTORMUX has 9 registers numbered 0 to 8 as follows:

Register AddressRead DescriptionWrite Description
00x00Software RevisionControl Register
10x01direction motor 1direction motor 1
20x02speed motor 1speed motor 1
30x03direction motor 2direction motor 2
40x04speed motor 2speed motor 2
50x05direction motor 3direction motor 3
60x06speed motor 3speed motor 3
70x07direction motor 4direction motor 4
80x08speed motor 4speed motor 4

Motor direction Register
0x00 Float
0x01 Forward
0x02 Reverse
0x03 BREAK

Speed1 Register (Controls the speed of motor).
If you are forward or reverse direction then it controls the speed of the motor.
If you are in break position then it then controls the breaking power.

Software Revision number
This register contains the revision number of the software in the modules. Boards with version 1.2 uses Morse code to indicate Address on LED.


Control Register
Allows you to change the I2C address of the device.

Sequence used to change the I2C address
0xa0 0xaa 0xa5
Selected address is shown at power up by the LED mounted on MOTORMUX.
Address is shown in long blink for higher order byte (above 0xA0) and short blinks for lower order bytes of address.
NQC Program
NQC
/********************************************************
following program demonstrates how to move motors, and also
 provides all the functions required for this functionality.
********************************************************/
#define float 0x00
#define fwd 0x01
#define rev 0x02
#define brk 0x03
#define MTR_1 1
#define MTR_2 2
#define MTR_3 3
#define MTR_4 4
#define READ_BYTE 0x52 //R or r
#define WRITE_BYTE 0x57 //W or w
#define ABORT 0xff // 0xff
#define ALIVE 0x41 // A

#define ERROR -1
#define NO_ERROR 1

int Error;
int speed;
task main()
{
        speed=250 ;
        SetTxPower(TX_POWER_LO) ;
        Set_motor(0xb4,MTR_1, speed,fwd);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);

        Set_motor_12(0xb4, speed,fwd,speed,rev);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);

        Set_motor_34(0xb4, speed,rev,speed,fwd);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);
        Set_motor_34(0xb4, speed,fwd,speed,rev);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);

        Set_motor_1234(0xb4, speed,brk,
                                speed,brk,
                                speed,brk,
                                speed,brk);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);

        Set_motor_1234(0xb4, speed,fwd,
                                 speed,fwd,
                                 speed,fwd,
                                 speed,fwd);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);

        Set_motor_1234(0xb4, speed,rev,
                                 speed,rev,
                                 speed,rev,
                                 speed,rev);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);

        Set_motor_1234(0xb4,speed,brk,
                                 speed,brk,
                                 speed,brk,
                                 speed,brk);
        Wait(500);
        PlaySound(SOUND_DOUBLE_BEEP);

}




/********************************************************
set_motor(int Address, int motor,int speed,int direction)
Address = IIC device address eg for 24C02 will be 0xA0
motor = 1 to 4
speed = 1 to 0xff 1 slow 0xff fast
direction is off fwd rev or break
make sure that you do not exceed the count than your array size

returns the bytes or Integers written as Message

// Write count no of from IIC_Data bytes to the IIC device named Address
at location Register

***********************************************************/
void Set_motor(int Address, int motor,int speed,int direction)
{
        int temp;
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);       // I2C protocol headers.
        SetSerialData(1,0xff);       // I2C protocol headers.
        SetSerialData(2,0xaa);       // I2C protocol headers.
        SetSerialData(3,WRITE_BYTE); // I2C command
        SetSerialData(4,Address);
        SetSerialData(5,2*motor-1);  // motormux is an I2C device, and uses
                                     // register 2*m-1 to address each motor.
                                     // where m is the motor number

        SetSerialData(6,0x02); // no of bytes to be written
        SetSerialData(7,direction);
        SetSerialData(8,speed);
        SendSerial(0,9);
        Wait(1);
        if(Message()!=2 ) Error=ERROR;
}


/********************************************************
set_motor_12(int Address, int speed_1, int direction_1,
                    int speed_2,int direction_2)
Address = IIC device address eg for 24C02 will be 0xA0
speed = 1 to 0xff 1 slow 0xff fast
direction is off fwd rev or break
make sure that you do not exceed the count than your array size

returns the bytes or Integers written as Message

// Write count no of from IIC_Data bytes to the IIC device named Address
at location Register

***********************************************************/
void Set_motor_12(int Address, int speed_1,
                       int direction_1,int speed_2,int direction_2)
{
        int temp;
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);
        SetSerialData(1,0xff);
        SetSerialData(2,0xaa);
        SetSerialData(3,WRITE_BYTE);
        SetSerialData(4,Address);
        SetSerialData(5,0x01); //first motor register no
        SetSerialData(6,0x04); // no of bytes to be written
        SetSerialData(7,direction_1);
        SetSerialData(8,speed_1);
        SetSerialData(9,direction_2);
        SetSerialData(10,speed_2);
        SendSerial(0,11);
        Wait(1);
        if(Message()!=4 ) Error=ERROR;
}

/********************************************************
set_motor_34(int Address, int speed_1,
                int direction_1, int speed_2,int direction_2)
Address = IIC device address eg for 24C02 will be 0xA0
speed = 1 to 0xff 1 slow 0xff fast
direction is off fwd rev or break
make sure that you do not exceed the count than your array size

returns the bytes or Integers written as Message

// Write count no of from IIC_Data bytes to the IIC device named Address
at location Register

***********************************************************/
void Set_motor_34(int Address, int speed_1,
                  int direction_1,int speed_2,int direction_2)
{
        int temp;
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);
        SetSerialData(1,0xff);
        SetSerialData(2,0xaa);
        SetSerialData(3,WRITE_BYTE);
        SetSerialData(4,Address);
        SetSerialData(5,0x05); //first motor register no
        SetSerialData(6,0x04); // no of bytes to be written
        SetSerialData(7,direction_1);
        SetSerialData(8,speed_1);
        SetSerialData(9,direction_2);
        SetSerialData(10,speed_2);
        SendSerial(0,11);
        Wait(1);
        if(Message()!=4 ) Error=ERROR;
}



/********************************************************
set_motor_23(int Address, int speed_1,
                int direction_1, int speed_2,int direction_2)
Address = IIC device address eg for 24C02 will be 0xA0
speed = 1 to 0xff 1 slow 0xff fast
direction is off fwd rev or break
make sure that you do not exceed the count than your array size

returns the bytes or Integers written as Message

// Write count no of from IIC_Data bytes to the IIC device named Address
at location Register

***********************************************************/
void Set_motor_23(int Address, int speed_1,
                  int direction_1,int speed_2,int direction_2)
{
        int temp;
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);
        SetSerialData(1,0xff);
        SetSerialData(2,0xaa);
        SetSerialData(3,WRITE_BYTE);
        SetSerialData(4,Address);
        SetSerialData(5,0x03); //motor register no
        SetSerialData(6,0x04); // no of bytes to be written
        SetSerialData(7,direction_1);
        SetSerialData(8,speed_1);
        SetSerialData(9,direction_2);
        SetSerialData(10,speed_2);
        SendSerial(0,11);
        Wait(1);
        if(Message()!=4 ) Error=ERROR;
}

/********************************************************
set_motor_123(int Address, int speed_1,
       int direction_1, int speed_2,
       int direction_2, int speed_3, int direction_3)
Address = IIC device address eg for 24C02 will be 0xA0
speed = 1 to 0xff 1 slow 0xff fast
direction is off fwd rev or break
make sure that you do not exceed the count than your array size

returns the bytes or Integers written as Message

// Write count no of from IIC_Data bytes to the IIC device named Address
at location Register

***********************************************************/
void Set_motor_123(int Address, int speed_1, int direction_1,
                   int speed_2, int direction_2,
                   int speed_3, int direction_3)
{
        int temp;
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);
        SetSerialData(1,0xff);
        SetSerialData(2,0xaa);
        SetSerialData(3,WRITE_BYTE);
        SetSerialData(4,Address);
        SetSerialData(5,0x01); //first motor register no
        SetSerialData(6,0x06); // no of bytes to be written
        SetSerialData(7,direction_1);
        SetSerialData(8,speed_1);
        SetSerialData(9,direction_2);
        SetSerialData(10,speed_2);
        SetSerialData(11,direction_3);
        SetSerialData(12,speed_3);
        SendSerial(0,13);
        Wait(1);
        if(Message()!=6 ) Error=ERROR;
}


/********************************************************
set_motor_1234(int Address, int speed_1, int direction_1,
                            int speed_2, int direction_2,
                            int speed_3, int direction_3,
                            int speed_4, int direction_4)
Address = IIC device address eg for 24C02 will be 0xA0
speed = 1 to 0xff 1 slow 0xff fast
direction is off fwd rev or break
make sure that you do not exceed the count than your array size

returns the bytes or Integers written as Message

// Write count no of from IIC_Data bytes to the IIC device named Address
at location Register

***********************************************************/
void Set_motor_1234(int Address, int speed_1, int direction_1,
                                 int speed_2, int direction_2,
                                 int speed_3, int direction_3,
                                 int speed_4, int direction_4)
{
        int temp;
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);
        SetSerialData(1,0xff);
        SetSerialData(2,0xaa);
        SetSerialData(3,WRITE_BYTE);
        SetSerialData(4,Address);
        SetSerialData(5,0x01); //first motor register no
        SetSerialData(6,0x08); // no of bytes to be written
        SetSerialData(7,direction_1);
        SetSerialData(8,speed_1);
        SetSerialData(9,direction_2);
        SetSerialData(10,speed_2);
        SetSerialData(11,direction_3);
        SetSerialData(12,speed_3);
        SetSerialData(13,direction_4);
        SetSerialData(14,speed_4);
        SendSerial(0,15);
        Wait(1);
        if(Message()!=8 ) Error=ERROR;
}

/********************************************************
Change_add(int Address, int New_address)
Address = IIC device address eg for 24C02 will be 0xA0
New_address = new IIC device address
***********************************************************/

void Change_add(int Address, int New_address)
{
        int temp;
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);
        SetSerialData(1,0xff);
        SetSerialData(2,0xaa);
        SetSerialData(3,WRITE_BYTE);
        SetSerialData(4,Address);
        SetSerialData(5,0x00);
        SetSerialData(6,0x04);
        SetSerialData(7,0xa0);
        SetSerialData(8,0xaa);
        SetSerialData(9,0xa5);
        SetSerialData(10,New_address);
        SendSerial(0,11);
        Wait(1);
        if(Message()!=2 ) Error=ERROR;
}

/********************************************************
Check_alive()

checks if the RCX2I2C is alive

Sets ERROR flag
***********************************************************/
void Check_alive()
{
        ClearMessage();
        SetSerialComm(SERIAL_COMM_DEFAULT);
        SetSerialPacket(SERIAL_PACKET_DEFAULT);
        SetSerialData(0,0x55);
        SetSerialData(1,0xff);
        SetSerialData(2,0xaa);
        SetSerialData(3,0x41);
        SendSerial(0,4);
        Wait(100);
        if(Message()!=ALIVE+1 ) Error=ERROR;
}

RCX interface
To interface this Motor Controller to RCX, you will need RCX-I2C module or similar I2C interface.
What's Related
These might interest you as well
Web Pages

Documents

FAQ

Link Manager

Photo Albums