05-21-2020 12:08 PM
We're using the BMI270 with a BMM150 attached to the I2C auxilliary port. When I enable just the BMI270 accelerometer and gyro, everything works as expected, reading the FIFO produces the correct number of samples per second. As soon as I enable the auxilliary sensor, I get strange behaviour where the sample rate for the accelerometer and gyro seems to drop to 1 to 2 samples per second.
Code snippets for the configuration below. Samples per second is determined by reading a FIFO frame every 500 ms and using the
bmi2_extract_accel
etc functions.
/* Setup accelerometer data rate, range */
{
bmi2_sens_config config = {};
config.type = BMI2_ACCEL;
config.cfg.acc.odr = BMI2_ACC_ODR_100HZ;
config.cfg.acc.bwp = BMI2_ACC_OSR4_AVG1;
config.cfg.acc.range = BMI2_ACC_RANGE_8G;
bmi2_set_sensor_config(&config, 1u, device_);
}
/* Setup gyroscope data rate, range */
{
bmi2_sens_config config = {};
config.type = BMI2_GYRO;
config.cfg.gyr.odr = BMI2_GYR_ODR_100HZ;
config.cfg.gyr.range = BMI2_GYR_RANGE_250;
config.cfg.gyr.bwp = BMI2_GYR_NORMAL_MODE;
config.cfg.gyr.noise_perf = 0u;
bmi2_set_sensor_config(&config, 1u, device_);
}
/* Configure auxilliary sensor - BMM150 */
{
const uint8_t device_address = 0x13u;
bmi2_sens_config aux_sens_config = {};
aux_sens_config.type = BMI2_AUX;
aux_sens_config.cfg.aux.aux_en = BMI2_ENABLE;
aux_sens_config.cfg.aux.manual_en = BMI2_DISABLE;
aux_sens_config.cfg.aux.odr = BMI2_AUX_ODR_25HZ;
aux_sens_config.cfg.aux.aux_rd_burst = 6u; /* 3 axes * 2 bytes */
aux_sens_config.cfg.aux.read_addr = 0x42; /* 0x42 - MAG LSB X */
aux_sens_config.cfg.aux.i2c_device_addr = device_address;
bmi2_set_sensor_config(&aux_sens_config, 1u, device_);
}
/* Configure FIFO */
uint16_t config = BMI2_FIFO_HEADER_EN | BMI2_FIFO_ACC_EN | BMI2_FIFO_GYR_EN | BMI2_FIFO_AUX_EN;
bmi2_set_fifo_config(config, BMI2_ENABLE, device_); res != BMI2_OK );
Solved! Go to Solution.
06-01-2020 07:25 PM
BMM150 as aux interface needs 8 bytes data (2x3 axis + 2 bytes of tempreature data).
So, in total, it should be 20 bytes otherwise BMM150 is not working properly.