[QUESTION]SPI communication with BNO080?

Using SPI, I’ve come across a bit of strange behaviour that i’m not sure if its due to my system implementation or a limitation from the bno080. I’m running SPI at 3MHz. I can enable a single sensor and get pretty much the max reported rate (which im very happy with), but once I enable more than one sensor I can’t really get anywhere near the maximum rates without losing stability.

I’m using an ESP32 Thing Plus hooked up to the BNO080 breakout through SPI (specifically the SPI3 bus). I’m using esp-idf alongside the esp32-arduino core in order to utilise the sparkfun library for the BNO080.

At the moment I’ll leave a reproducible example out, as I have a feeling its just that each sensor has its own list of discrete rates it actually can operate at, and when I’m requesting some rate outside of that list it messes with the other sensors. I’m wondering if you guys know about this behaviour or if I just need to trial and error it. I’m using the sequence number from the shtpHeader to count and compare the messages in a set period of time to how many times my interrupt actually gets triggered per sensor.

I’d expect this behaviour: I should get close to the requested rate for each sensor I enable, or at least it should report according to the datasheet (0.9rate < rate < 2.1rate).

What actually happens though:

When running at 100Hz, everything is still good. with gyro, accelerometer, and rotation vector reporting near 100 Hz. When trying 200 Hz, the quaternion and gyroscope report around 200, but the accelerometer only gets up to 125 Hz at the best of times, which after some testing i found is part of its discrete list (125, 250, 500). But on bad runs it can get as low as 5.5 Hz. In general it feels like there’s a limit on the BNO when more than one sensor is reporting like i only have X Hz to play with and must split it between the sensors in order to not get funky behaviour.

Part of the rate drop is due to messages being dropped, as sometimes my sequence count for a sensor does not increase monotonically but skips numbers. I hope that this is an issue on my side (taking too long to deal with a message before the next comes in?) and not that the BNO080 has some limit to operating multiple sensors. In terms of bandwidth I believe that i’m still well below the 3MHz clock limit.

Any ideas/knowledge here would be awesome. If this is actually something up with the sensor let me know and I can provide an example code to show the performance.

Thanks

I think your issue is related to this one https://github.com/sparkfun/SparkFun_BN … /issues/42 - there are several more similar issues currently open related to the SPI bus and clock times, I’d suggest following a couple?

Hi Russell, that’s what I had thought of initially, but if it was the same case as in the issues i’d expect my sensor to timeout at high Gyro-integrated-Rotation Vector rates (1kHz) as well. But that goes through fine (i mean running something at 1kHz brings up other freeRTOS tick rate related problems), at least the sensor seems fine with that. I’ve not found any executable channel reports from the bno080, i.e. it doesn’t crash because I miss a read on a message as is the case with most of the issues on git.

I’d like to hook up the bno to an oscilloscope just to confirm but won’t have one available for around two more weeks :confused: