Hi,
Thanks for your inquiry.
(1) Yes, that is correct. BSXLite library supports ODRs for accel 50Hz, mag 20Hz and gyro 50Hz. So you need to configure BMX160 to match these ODRs.
(2) There are two ways to call bsx_dostep function. One is enable BMX160 gyro data ready interrupt and map it to INT1 pin for example. Once your MCU receives the interrupt signal you can call bsx_dostep function. The other way is use your MCU timer interrupt. Every 20ms (50Hz) your MCU timer will generate an interrupt so that you can call bsx_dostep there. Because the ODR data ready interrupt has tolerance from sensor to sensor, MCU timer may be considered.
(3) Output data rate (ODR) means the sensor internal sampling rate. BMX160 accel and gyro (IMU) inertial measurement unit are internally synchronized. At 50Hz ODR both accel and gyro will automatically update their data registers every 20ms. Mag is an I2C slave to the IMU inside BMX160. The IMU will configure the mag to work at 20Hz and then read and put mag data in BMX160 data registers. So if your MCU calls bsx_dostep function at 50Hz, then it will require sensor data first through I2C or SPI interface and then calculate the sensor fusion results such as quaternions, Euler angles, gravity vector and linear acceleration. Your MCU then will wait for the next timer interrupt to call bsx_dostep again.
(4) Because BSXLite library needs to do sensors' calibrations and sensor fusion algorithms on the background, it requires your MCU to have sufficient RAM and ROM to hold the intermediate results and code size when compiling.
(5) The arrays of values that are passed in via the bsx_init function include sensor sensitivities, axis remapping 3x3 matrix, soft-iron 3x3 matrix, etc. If the BMX160 on your PCB is soldered and aligned to your product body axes in different ways, then you can change the axis remapping 3x3 matrix in the array.
Thanks.
... View more