Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMX160 Magnetometer problem.

    BMX160 Magnetometer problem.

    parkescape
    Member

    I'm using a BMX160 with an ARM Microprocessor, using I2C, code developed in C, using the MCUXpresso IDE to program the micro. I've got the accelerometer, gyro and magnetometer working as expected. The ARM board outputs a data stream to a tool on my pc that graphs the sensor values for all 9 axes. 

    When I program the board (through a USB connection) and run the software from my pc all is working correctly.

    When I disconnect the board from the usb connection, hard reset my electronics (power off power on, including the BMX160), the magnetometer does not provide any output data, but the accelerometer and gyro work as previously.

    I assumed it was a power-on start up race condition with the BMX160 and added delays of up to a second in the start up code before attempting to access any sensor registers, but this made no difference. I tried a softreset of the BMX160 (CMD register 0x7e set to 0xB2), a soft reset of the magnetometer, and a POR reset of the magnetometer, all with no success.

    Also checked that I'm not exceeding the power capabilites of the supply on my board.

    I think I'm missing something but can't find it.

    Any insight from anyone please?

    Thanks.

    7 REPLIES 7

    Minhwan
    Community Moderator
    Community Moderator

    Hello parkescape, 

     

    Please correct me if there is something I have misunderstand. 

    1) After hardware reset, BMI160 part  (accel and gyro) is working properly, yet BMM150 part doesn't work at all. 

    2) Therefore, you tried to soft reset for BMM150, but didn't work. 

    If yes, could you check one more time with my code? 

    If there is something you miss please put for configuration part. 

    Or, could you please share your code with me? 

    Thanks,  

    Thanks.

     

    1 and 2 are correct.

    But magnetometer (and accel and gyro) works after programming, before hardware reset.

    My code attached.

    I'll take a look at your code but it will take me a while to integrate it into mine.

    Regards, Andrew

    Minhwan
    Community Moderator
    Community Moderator

    Hello parkescape, 

     

    Ok, so now you are developing not to use our API. 

    Why don't you use our API? 

    https://github.com/BoschSensortec/BMI160_driver

    You can check proper initialization process using our API. 

    Please let me know if you have any questions. 

     

    I already had the software developed for other (NXP) sensors. NXP have notified that they are going to stop manufacturing their sensors, so looking for a replacement. The BMX160 looks ideal, so prototyping to make sure I can work with it before redesigning hardware.

    All the I2C interface software is already developed and working, so don't want to have to replace it. And I don't (currently) use anything other than the basic 9 axes of data - don't need all the interrupts etc., or the FIFO. So easier to develop a dedicated driver than to understand and integrate the whole of your API which is more than 6000 lines of code. My driver is only about 250 lines of code, and 110 of that is register and data definitions. Of course - that's of no value if I can't get it to work!!

    Can you detail the start up commands and their order for the magnetometer in your api please?  Or point me to where they are in the code? I cant see them in the code you posted yesterday.

    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