As far as I've understood the trim values need to be read from the BMX160 via the mag_if registers.
Following the datasheet:
For a read access:
Write magnetometer register address to read from into Register (0x4D) MAG_IF[1]
Read
Register (0x1B) STATUS
until the bit mag_man_op is “0”
Read Register (0x04-0x0B) DATA_0 to DATA_7, get the data from magnetometer
1. First setting the Powermode: 0x19 -> BMX160_COMMAND_REG_ADDR
2. Set setup mode with burst read 8 bytes: 0x83 -> BMX160_MAG_IF_0_ADDR
3. Write Regaddres too MAG_IF1: BMM150_DIG_Z4_LSB -> BMX160_MAG_IF_1_ADDR
wait 10 ms
4. Read Status byte and check bit man_mag_op is "0"
5. Read Register (0x04-0x0B) DATA_0 to DATA_7, get the data from magnetometer
But I am always getting zeros and not data.
Help is apreciated.
Best regrads,
Constantin
Hi Sir:
I think first you should check PMU_STATUS(0X03) to know mag_if_pmu_status.
BMX160 is regared BMI160 and BMM150 integration.
There is only a different CHIP_ID between BMX160 and BMI160+BMM150.
If want to get mag data, you need to open BMI160 aux interface and BMM150 POWER_CNTRL_ENABLE.
Ragarding operating BMM150 which is in BMX160 as a Magnetometer, you can reference the follow link:
https://github.com/BoschSensortec/BMI160_driver