Hi Chris,
I haven’t got time to give you a full detailed write-up on this, but I’ll try and clarify things for you.
The OLA gives you an estimate of the maximum log rate based on how long it takes to read data from the attached sensors. But - IIRC - that doesn’t include printing the data or writing it to SD. So the real achievable rate will be lower.
With a single ISM330 attached to the OLA, and with no mux, I see it takes about 2.5ms to read the data from the ISM. With printing and writing to SD, I’m getting a rate of about 90Hz.
If I turn off the console (terminal) printing, it makes no difference to the rate.
If I run the I2C bus at 400kHz, the read time reduces to about 1ms. (Option 6 - then Configure Qwiic Settings). But the overall rate is now about 125Hz. And it won’t let me set it any higher. Strange… I should be able to set it faster than that.
OK. If I turn off logging the rate, and disable the timestamps. Right. Now I can set the rate to 240Hz. And it looks like I’m achieving that. It’s about 4ms between samples. I guess the limiting factor is the SD write time?
I can’t predict what the maximum rate is for two sensors via a qwiic mux. Setting the mux port slows things down as the code has to write two extra bytes each time the port changes: the mux address and the port settings.
In summary, it looks like you might be able to achieve >100Hz with two sensors. But will struggle to achieve >= 200Hz.
If you really need 200Hz, it might be better to start again with different hardware. A ESP32 Thing Plus C has a built-in microSD card slot. The ESP32 SD library is very fast. Interfacing the two ISM330’s via SPI instead of I2C would speed up the read dramatically. And you could start using the end-of-conversion interrupts to make it even more efficient. Let me know if you need more suggestions in this direction. Most of the code you need already exists as examples. It would be a case of cutting and pasting the right bits together.
Best wishes,
Paul