Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMX160 magnetometer causing accelerometer and gyro to shut off

    BMX160 magnetometer causing accelerometer and gyro to shut off

    gregtronics
    New Poster

    I am using the BMX160 sensor.  I am able to get the accelerometer and gyro to work just fine so I am working on getting the magnetometer.  I am using the same setup that is on the datasheet, page 25, Table 16.  I monitor the PMU after each step to see where the issue is and the PMU goes to 0 after starting to send data to go from setup mode to data mode.  In the order of operations, I do the following:

    1. Write CMD to put MAG_IF into normal mode (0x19 to CMD Register)
    2. Put the magnetometer into setup mode (0x80 to IF[0])
    3. Put the magnetometer into sleep mode (0x01 to IF[3], 0x4B to IF[2])
    4. Set the REPXY to low power (0x01 to IF[3], 0x51 to IF[2])
    5. Set the REPZ to high accuracy (0x0E to IF[3], 0x52 to IF[2])
    6. Prepare for data mode (0x02 to IF[3], 0x4C to IF[2], 0x42 to IF[1])
    7. Write ODR (0x05 to MAG_CONF)
    8. Enter data mode (0x00 to IF[0])
    9. Write CMD to put MAG_IF into low power mode (0x1A to CMD)

    PMU is good up until step 6.  The data mode setup causes everything to shut off.  Also, monitoring the IF registers after the function above, I have the following:

    • IF[0] = 0x80
    • IF[1] = 0x42
    • IF[2] = 0x4C
    • IF[3] = 0x00

    So we can see something along the way does cause the write to fail.  I have tried 100k and 400k data rates over I2C.  I can still talk to the chip, I can still ping the ID and read it, no issues.  The status has just the NVM_rdy.  The PMU is 0x00.  The error is 0x00.  As mentioned, the I2C is still up and working.  If I comment out the magnetometer section, back to working no issue.  Any thoughts?

    1 REPLY 1

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    Inside BMX160 the magnetometer BMM150 is connected to BMI160's secondary I2C interface. Please refer to BMI160 API source code at https://github.com/BoschSensortec/BMI160_driver where it includes the BMM150 part about how to establish I2C interface with BMM150 , how to configure BMM150 and how to retrieve BMM150 data from BMI160's data registers.

    Thanks.

    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