Trigger BNO055 measurements

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Minimata
 
Posts: 2
Joined: Wed Oct 18, 2017 10:58 am

Trigger BNO055 measurements

Post by Minimata »

Hello there !

I'm doing some experiments with an Adafruit BNO055 connected to a Raspberry Pi 3.
To the same Pi is connected a Lapjack T7-Pro ADC, useful for connecting other devices.

The Lapjack sends a PWM signal to these devices to trigger the measurements.
This is useful because every measure is timed with the same clock, so everything is always sync.
Now I'd like to do this with the BNO055 too, if possible.

The only documentation I could find on an external clock is about the XOUT32 & XIN32 connections, but it is specified that "an external 32 KHz crystal oscillator has to be connected to the pins XIN32 and XOUT32".
In my case, I just want to connect a single pin sending a PWM signal (3V or 5V tick, basically) to trigger a single measure, which is quite different from what I understand based on the crystal oscillator documentation.

So my question is : can I connect my PWM signal from my Lapjack to a pin on the BNO055 to trigger a measure, maybe one of the XIN32 and XOUT32 pins ?

Thanks in advance for your answer, and sorry if this question has already been asked, or is present in the documentation somewhere. Couldn't find a clear answer on this matter by myself.

Best regards,
Alex

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trigger BNO055 measurements

Post by adafruit_support_mike »

No, that wouldn't work.

The BNO055 has its own microcontroller to handle all the calculations, and the XIN32/XOUT32 pins control the CPU clock. They give you the option to connect a crystal oscillator that will reduce the amount of drift in the CPU frequency, thus making all the time-based calculations more accurate. They don't have any effect on when the firmware takes a reading, and connecting anything other than a 32,768kHz crystal to them would at least mess with the calculations, and probably crash the microcontroller.

User avatar
Minimata
 
Posts: 2
Joined: Wed Oct 18, 2017 10:58 am

Re: Trigger BNO055 measurements

Post by Minimata »

Hi,

thank for your quick response.

What would be the difference in accuracy between internal and external clock ?
And would any crystal with this frequency do, or do you have some recommendations of some ?

Thanks !
Alex

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trigger BNO055 measurements

Post by adafruit_support_mike »

Most microcontrollers use a resistor-capacitor oscillator with an absolute frequency accuracy of +/-5% and frequency stability of +/-1% over periods of a few minutes. That's only part of an elaborate clock generation circuit that multiplies the base clock up to a much higher frequency and then divides down to a lower one. The multiplication ratio is fixed in hardware, but the division system (called a 'prescaler') can be adjusted from registers in the chip.

One part of the chip fabrication process involves measuring the actual oscillator frequency and setting the prescaler so the CPU clock is within about 0.5% of the expected value when the chip is approved for sale. The drift characteristic of about +/-1% is still there though, and the oscillator frequency will change with temperature.

A simple quartz oscillator has an absolute frequency accuracy of +/-30ppm (0.003%), frequency stability of +/-10ppm over periods of a few hours, and temperature-related frequency drift of about +/-20ppm across the range of temperatures where the rest of the electronics will work.

The microcontroller's clock generation system uses an external crystal oscillator to recalibrate its prescaler every few microseconds. It basically keeps long-term and short-term averages for the number of CPU clock ticks between two ticks of the crystal oscillator. If the short-term average starts to get larger or smaller than the long-term average, the system adjusts the prescaler to bring the counts back in line.

The clock adjustment system is only designed to work with a 32786Hz crystal, and any other value will create far more error than it corrects.


Adding a crystal gives the BNO055 maybe two or three significant digits of precision in its velocity/position calculations, but those numbers already go through an adaptive filter to keep the output as responsive as possible while minimizing random noise errors. In practical terms, a crystal will make the BNO055's readings converge to a new value a little more quickly, and the accumulated drift from error will stay low for a bit longer.

Our BNO055 breakout already has a crystal, so the correction is already there.

User avatar
gammaburst
 
Posts: 1015
Joined: Thu Dec 31, 2015 12:06 pm

Re: Trigger BNO055 measurements

Post by gammaburst »

In my opinion, the BNO055's external crystal does not work at all. Try enabling it and then mess with it as Mike mentioned. Short it out, inject a different frequency, whatever. Absolutely nothing happens! The BNO continues outputting measurements without the slightest change in value or data rate, according to my experiments. All my BNO's have firmware 0x0311.

I haven't found any way to trigger BNO measurements or to synchronize them to an external timer.

Furthermore, the BNO doesn't provide any output pulse or status register that tells me when a new measurement is available. To ensure that I read each measurement exactly once, I continuously poll several raw sensor registers (they're noisy) and watch for them to change. That gives me enough info to lock-on to the middle of the fusion measurement intervals, at approximately 100 Hz. (Most of the fusion registers have some sort of noise suppression, so their readings don't change when the sensor is motionless.)

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”