Serial communication of OpenCM9.04

I am using OpenCM 9.04 to communacate with IMU sensor through Serial3. However, i am having trouble to recieve data from sensor. Is the Serial3 working with this kind of connection? Or is it only working with dynamixel?

@hyungyu8066

On the OpenCM-904 Pins D24 and D25 have dual-purpose: either for I2C devices or as UART devices:

image

What kind of device is your IMU module? I2C or UART? Can you share the brand and model of your IMU device? Then I may be able to help you better.

Personally I have used I2C ToF sensors via pins D24 and D25, or interface those same Pins as Tx and Rx pins when using UART devices such as BT-210 or just plain wire connections.

1 Like

Thanks for your reply. The IMU sensor has both communication methods, I2C and UART. However, I want to use UART method. The model name is “xsens-MTI1”. I just want to access the IMU sensor through the provided manager software. So, I uploaded the below code to OpenCM9.04, but nothing happened. I have tried with another board (Teensy3.2), and it worked. Is there any problem with using the below code with OpenCM9.04?

char data;
void setup() {
Serial.begin(57600);
Serial3.begin(57600);
}
void loop() {
if (Serial.available()){
data=Serial.read();
Serial3.print(data);
}
else if (Serial3.available()){
data=Serial3.read();
Serial.print(data);
}
}

Wow! The xsens-MTI1 is a fancy IMU!

Were you trying to use the Xs MT Manager Tool via the USB cable through the OpenCM-904?

image

I did not see why your shared code would not work, as it looks like that you were trying to use the OpenCM-904 as a pass-through Serial Port?

Can you try the simpler version below to see if anything would work for you?

void loop() {
  if (Serial.available()) {      
    Serial3.write(Serial.read());   
  }

  if (Serial3.available()) {     
    Serial.write(Serial3.read());   
  }
}

I worked with your code. However, there were connection (wiring) problems.

From my own experience some micro USB cables are only rated for battery charging and not for data transfer. Also I had one old OpenCM 904 whereas it’s micro USB port has gone bad from being used for a long time too.