Hi Jason,
According to the "BMM150_temperature_compensation.pdf" file I just attached here, dig_xyz1 is an unsigned integer from register (0x6D << 😎 | 0x6C. So its valid value is from 0 to 65535. And it is used in all x/y/z compensated data calculations.
In order to check if the magnetometer inside BMX160 is working or not, you can log magnetometer x/y/z data when you rotate your device around x axis, y axis and z axis full-round respectively and slowly on a wooden or plastic surface. Then you can plot x-y data when you rotate your device around z axis to see if it is a circle or ellipse or not. z axis data should be almost constant. You can also repeat the plot for y-z and x-z to see the shape. In addition, you can also log x/y/z data when you rotate your device randomly in 3D space slowly in all directions. Then you can plot x-y-z data in 3D to see if you can get a ball or an ellipsoid or not.
If it is yes to the above data collections and plots, then BMX160 magnetometer is working fine. If it is no, then the magnetometer is not working fine. We need to find out the root cause of this failure BMX160 part.
Thanks.
... View more