Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMX160_SPI

    BMX160_SPI

    amar
    Established Member

    Hi everyone,

    I am trying to read BMX160's ACC and GYRO data, as part of doing this  i am able read its device id as 0xD8 and then i configured its ACC and GYRO into

    NORMAL MODEs and trying to read its raw raw data from 12 registers(0x0C-0x17). 

    Till now i am able to read GYRO data(I saw gyro data on MISO), but for ACC i am not getting any data(x,y,z) on MISO even by moving the sensor also.

    Note:- Can we read ACC raw data directly by config its reg or is it depends GYRO or MAG data also?

    Please help mje to come out this issue.

    Thanks in advance.

    Regards,

    amarr

     

    12 REPLIES 12

    Minhwan
    Community Moderator
    Community Moderator

    Please check my example code. 

    I could get accel, gyro, mag data. 

    Thanks, 

    amar
    Established Member

    Hi minhwan,

    Thank you for your replay,

    Till now i am getting acc and gyro raw data in x,y,z co-ordinates with my source code of BMX160.  How can i convert it into pitch,roll, yaw?

    I should use your suggested  code for my magnetometer  config. 

    1) I am confusing about BMX160 device because for mag config your using bmm150.c/.h, In BMX160 DATASHEET in(pg:14) block

    diagram shows within the IC.

    2) Actually i am SPI interface for ACC & GYRO data reading, but MAG interface (bmm150) your using I2C in  like below 

    static void init_bmm150_sensor_driver_interface(void)
    {
        /* I2C setup */
        /* link read/write/delay function of host system to appropriate
         * bmi160 function call prototypes */
        i2c_bus = BMM150_DEFAULT_I2C_ADDRESS;
    	bmm150dev.intf_ptr = &i2c_bus;
        bmm150dev.intf = BMM150_I2C_INTF;
        bmm150dev.read = bmm150_aux_read;
        bmm150dev.write = bmm150_aux_write;
        bmm150dev.delay_us = bmm150_delay_usec;
    }

         How can i change from I2C to SPI? If i change it, but how it will work means how BMX160 can communicate with bmm150(mag) using SPI or I2C?

    3) Is my external SPI is same as internal SPI of bmm150?

    Pl suggest me to to overcome these doubts,like by showing web links or any pdf files.

     

    Thank you,

    regards,

    amarr

     

     

     

    Minhwan
    Community Moderator
    Community Moderator

    Hello Amar, 

     

    1) BMX160 is BMI160 with build-in BMM150. That's why we re-use existed BMM150 code for internal BMM150. 

    2) The SPI interface you have is for communication between BMX160 and your host MCU. BMM150 inetface is for communication between BMX160 internally. 

    3) I think 2) answer can give you answer for 3) as well. 

    Thanks, 

    amar
    Established Member

    Hi minhwan.

    Thank you for replay,

    1) If i use bmi160 with spi interface then which  interface can i use for bmm150, is it SPI or I2C?

    2) Can i config bmi160 and bmm150 with same SPI interface which i used for communicating with host to bmi160.

    3) If i config bmi160 with SPI and bmm150 with I2C, then how can i read MAG data from bmm150 because two are different protocols.

    So please help to understand its internal architecture for reading MAG data from it.

    one again Thank you so much for replay.

    amarr

     

    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