Re: I²C commands for Tetrix motor muxers?
Posted: 27 Nov 2010, 08:32
so you think you can send 2 registers for the speed of 2 different motors at once?
And what about the mode byte and the different address of both motors?
And what if you want to have motor1 in power mode and motor2 in constant speed mode?
as I understand, it's
so as far as I understand it,
mode_reg= 44+0 if motorNumber modulo 2=0
and
mode_reg= 44+3 if motorNumber modulo 2=1
similar it's with the power-registers:
But what I don't understand:
don't you have to wait after each address and register call until the IIC line is not_pending?
Can you REALLY send several register values all at once?
And what about the mode byte and the different address of both motors?
And what if you want to have motor1 in power mode and motor2 in constant speed mode?
as I understand, it's
Code: Select all
// start motor number counting at ZERO (as usual in C)
address of each motor 0-7 = 2+MotorNumber // addr_mot_0=2, addr_mot_1=3, addr_mot_2=4, addr_mot_3=5, ...
mode_reg = 0x44 for motors 0,2,4,6 // Sel Action: 00=power control only, 01=constant speed
mode_reg = 0x47 for motors 1,3,5,7 // Sel Action: 00=power control only, 01=constant speed
power_reg = 0x45 for motors 0,2,4,6 // -100...+100 both for power and speed
power_reg = 0x46 for motors 1,3,5,7 // -100...+100 both for power and speed
mode_reg= 44+0 if motorNumber modulo 2=0
and
mode_reg= 44+3 if motorNumber modulo 2=1
similar it's with the power-registers:
Code: Select all
mode_reg= 44 + 3*(motorNumber % 2);
power_reg=45 + (motorNumber % 2);
don't you have to wait after each address and register call until the IIC line is not_pending?
Can you REALLY send several register values all at once?