Hello.
The best way to optimize your system would probably be to develop a new app to replace the Wixel’s Serial-to-I²C app. It should know how to read from the six MinIMU-9 v5 boards, so you could just send one byte to trigger all of those readings, and then get all the readings back at once.
However, since you said you do not want to edit the apps, here are some other ideas.
From the latest code you posted in your previous topic, it seems like you are reading one byte at a time from the sensors. With your six MinIMU-9 v5 boards, you need to read 108 bytes to get all the data (2 bytes per reading, 3 readings per sensor, 3 sensors per board, 6 boards). You should be able to speed up the system a lot by reading multiple bytes at a time. The documentation of the Serial-to-I²C app in the Wixel user’s guide explains how to read more than one byte at a time.
The LIS3MDL magnetomer output registers are all consecutive, so you can read all of them by doing a single 6-byte read starting at the lowest output register address. Make sure you add 128 to the register address byte that you transmit to the LIS3MDL (i.e. you need to set its most-significant bit) in order to tell the LIS3MDL that you want to automatically increment the address each time you read a byte. Otherwise, you will end up reading the same byte 6 times, instead of reading 6 consecutive bytes.
Similarly, the LSM6DS33 gyro and accelerometer output registers are at consecutive addresses, so you can just do a single 12-byte read to get all the gyro and accelerometer data from a single board. To get auto-increment working on the LSM6DS33, you should make sure that the IF_INC bit in the CTRL3_C register is 1. That is the default value, so just make sure you are not changing it.
Once you make these changes, you should only be writing to the serial port three times per MinIMU-9 v5 board: once to change the I²C mux, once to read from the LSM6DS33, and once to read from the LIS3MDL. That should make things a lot faster.
At that point, if your system still is not fast enough, I would suggest combining those serial port writes together. In other words, you can try concatenating all the commands for one board together, and then send them all at once, with one call to the SerialPort.Write method. You can also go further and try combining the commands for multiple boards together. At some point, if you combine together too many commands then you might end up filling up all the buffers between your C# program and the Wixel running the Serial-to-I²C app, and the write will never complete, but I suspect that won’t be an issue for you.
Another thing to do is to increase the I2C_freq_kHz parameter on the Wixel running the Serial-to-I²C app, if you have not done so yet. The chips on the MinIMU-9 v5 are capable of handling bit rates up to 400 kHz, while the default value for that parameter is 100 kHz.
Please let me know if you have any further questions.
–David
