a) Would splitting up the sensors into multiple Wire busses help? Not sure. You do have have 3 of them on T4... Question would then be could you get all three of them reading at same time.
-* I DONT THINK SO. IT CANT BE READ AT THE SAME TIME*
Actually depending on coding, maybe it can... But normal code bases are not setup to do so. That is the endTransmission and requestFrom both loop waiting for the number of bytes to transfer.
Now there are at least two ways around this.
One could write special code that lets say duplicates the main code here but instead of just iterating over one set of IO registers for the one Wire port, it iterates over more than one... I have not done that before on this chip.. I have done it on old AVr processors for example to check two different uarts...
Another approach is to use DMA... So you start up the transfers, and all of them run in the background transferring the bytes for each of the devices in parallel.
On T3.x boards there is a library i2c_t3(
https://github.com/nox771/i2c_t3) that has this capability. The last I checked he has not ported this library over to T4.x...
There is another library, which I have not used before:
https://github.com/Richard-Gemmell/teensy4_i2c
Not sure if he has implemented DMA access or not. There may be others...
b) Where is the time spent? If the code has to ask sensor to do measurement and then waits for that to complete, can it be reorganized to ask each of the sensors to go get their next data and then cycle back to get the data?
- * 2ms IS SPENT WHEN BNO SENDS DATA TO TEENSY*
Again without seeing code and the like, it may be hard to see what this means.. That is are you simply timing one call to library, like get me the XYZ data... or have you broken that code down and that is the actual time it takes on the Wire buss to transfer the N bytes to the teensy?
d) If the multiple I2C devices works, might be able to hack up some more logical I2C objects using FlexIO. I have not tried that yet, played with Serial and some SPI...
- * CAN YOU ELABORATE ON WHAT FLEX IO IS ? SOME EXAMPLES COULD HELP. (ANY LINKS) *
For Flex IO, you can look at the latest blog that Paul posted up on the main PJRC website for the latest release of Teensyduino. And there will be a small section on FlexIO that has a link to a WIKI page on it.
And/or you can look at Chapter 50 of the IMXRT1060RM pdf file that you can download from PJRC main website.