-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with SPI data updates #42
Comments
Hi @DaudiGabriel ,
If I decrease the delay inside the loop to 5ms, the code works as expected. With the delay set to 6ms, the updates freeze after 1 or 2 seconds. |
I’m starting to understand this. If we set the enableRotationVector interval to 40ms or more, the BNO080 does not seem to care if we take more than 40ms to acknowledge the interrupt and read the data. If we set the interval to less than that, then it seems we MUST respond to the INT within one interval otherwise the BNO080 freezes. More investigation tomorrow... |
The datasheet for the BNO080, in section 1.3.4.2, mentions that it may be necessary to wake the chip when communicating with it using SPI. https://cdn.sparkfun.com/assets/1/3/4/5/9/BNO080_Datasheet_v1.3.pdf I suspect that during the case that the loop is slower then the update rate that the chip puts itself to sleep. I have yet to discover a way to flat out disable this sleep method from the very beginning. I do have some code though that I believe should wake the chip For the .h file For the .cpp file
I attempted to use implement the above code with a smart waker system in my Arduino Sketch. However I have seen limited success. There is either an issue with the code above or my smart waker. Also note to the original poster. I'm the Factorem guy who reported a similar issue in the Sparkfun forums. I thought I was done with the issue back then but looks like I have ran into it again. Just happened to be doing some searching on the web when I ran into your post on the pjrc forums. Noticed your post linked back to my original post on the issue and I felt compelled to give any assistance I could. |
I spent today testing and can't seem to wake the chip back up. There is probably an issue with the wake code I provided. Will attempt to look into this again tomorrow. |
Hi @FidencioYzaguirreIII , |
I've attempted contacting CEVA, they now own Hillcrest Labs, to see if there is a way to disable the sleep function. If I get a response I will be sure to post about it. Also thank you for the oscilloscope data. |
Thank you @FidencioYzaguirreIII & @DaudiGabriel , |
Found out the datasheet I was looking at was out of date. Current Version Turns out that there is a watchdog timer on the BNO080 that resets the sensor. The BNO085 on the other hand will timeout and retry the operation. (Hint to Sparkfun make a BNO085 module) |
Thanks all for the effort so far. At least I know now that I was not to stupid to connect the sensor the right way and that it is a sensor problem! I am curious whether this problem also occurs when using I2C with the interrupt pin, but unfortunately I have no time to test this right now... |
@DaudiGabriel I believe the issue will not occur on I2C from what I gather from the datasheet. Only issue will be dealing with the a speed bottleneck since SPI is faster then I2C. |
We are now in contact with CEVA about this. More updates to follow soon! |
We now understand more about what is happening to the chip. Being slow to read the SPI data does appear to be filling an internal buffer and causes the chip to perform a reset (“Initialize (unsolicited)”). |
Hi @DaudiGabriel & @FidencioYzaguirreIII ,
The penultimate Control Channel packet (length 20 (4 + 16)) is a command response (0xF1) for command 0x84 which is “Initialize (unsolicited)”. This issue is now resolved - but I am going to leave it open and mark it as sticky to help future users with the same issue. |
Subject of the issue
If the main loop evaluation time in an Arduino sketch is slightly larger than the update rate of the sensor, the Sensor will not report any updates via SPI any more.
Not sure, whether this is a library problem or whether there is some internal (inside the BNO080) buffer overflow, which stops the sensor from working properly.
Your workbench
-> Teensy 4.0
-> don't know
-> connected with SPI
-> USB power supply
-> no
Steps to reproduce
Slightly modified version of SPI example "Example1-RotationVector"
Expected behavior
Measurements over SPI should still be available
Actual behavior
Can not read any data from sensor
The text was updated successfully, but these errors were encountered: