Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    How to read trim values of Magnetometer of BMX160

    How to read trim values of Magnetometer of BMX160

    cwi
    Established Member

    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

     

    1 REPLY 1

    Jet
    Occasional Contributor

    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

        

     

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist