Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMM150

    BMM150

    CH_Miss
    New Poster

    The BMI150 can obtain valuable magnetometer data in the forcad mode, and then configure it to the normal mode. The magnetometer data is 0. I want to know where I am wrong with the configuration, or what causes this phenomenon.

    3 REPLIES 3

    shellywang
    Occasional Contributor

    Please provide the  code for BMM150 configuration/initialization.

    uint8 bmm150_init(void)
    {
    uint8 init_ret = BMM150_ERROR;
    uint8 self_test_fault_cnt = 0;

    init_ret = bmm150_read_pwr_control();
    if(BMM150_OK != init_ret)
    {
    init_ret = bmm150_set_pwr_control(BMM150_PWR_OTHER_MODE);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }
    }

    //bmm150_soft_reset();

    init_ret = bmm150_read_id();
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }


    #if (!NORMAL_WORK_MODE)

    init_ret = bmm150_set_pwr_mode(BMM150_PWR_SLEEP_MODE);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }

    init_ret = bmm150_set_ready_en(BMM150_READY_EN);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }

    init_ret = bmm150_set_repxy(BMM150_REPXY_LOWPWR);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }

    init_ret = bmm150_set_repz(BMM150_REPZ_LOWPWR);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }
    #else

    init_ret = bmm150_set_ready_en(BMM150_READY_EN);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }

    init_ret = bmm150_set_rate(BMM150_DATA_RATE_10HZ);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }

    init_ret = bmm150_set_repxy(BMM150_REPXY_REGULAR);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }

    init_ret = bmm150_set_repz(BMM150_REPZ_REGULAR);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }

    init_ret = bmm150_set_pwr_mode(BMM150_PWR_NORMAL_MODE);
    if(BMM150_OK != init_ret)
    {
    return init_ret;
    }


    #endif
    return BMM150_OK;
    }

    Thanks.

    shellywang
    Occasional Contributor

    Please check the following points with your code :

    1. Try to read the Chip ID
    2. Provide the  I2C or SPI wave form

    Check the  register ‘Power Control’ bit in register 0x4B and ‘OP Mode’ bit in register  0x4C after initialization is complete.

    Please download and use BMM150 API:

    https://github.com/BoschSensortec/BMM150-Sensor-API

    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