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

    Hello Amar, 

     

    1) For reading MAG data or even BMM150 Chip_id also, Finally we get data from  SPI only because it is the bmi160 primary interface. right?

     - Right 🙂 

    2) Eventhough if you call  " bmm_init();"  API,  still it will use spi_read/spi_write of bmi160 driver via  aux_interface of bmi160 like below

        bmm150_init(&bmm); ---> bmm150_get_regs ----->dev->intf_rslt = dev->read(reg_addr, reg_data, len, dev->intf_ptr);  ---->bmm150_aux_read() ----                        -------->bmi160_aux_read.  right?

    - The SPI communcation between host MCU and BMX160 is running via primary interface, not AUX interface. AUX interface is for BMM150 and BMI160 internally.  

    3) How do we know bmi160 aux_interface working fine or not?

    - when you call bmm150_init function, and get -2 error, it means communcation failure.

    4) Can i change bmi160 aux_interface to SPI from I2C?

     - No. 

    5) Can i read MAG data directly form bmm150(without using bmm150 driver), if yes can you please suggest me how to implement it.

     - You can only read mag data thru primary interface. 

    Thanks 🙂 

    amar
    Established Member

    Hi minhwan,

    In source code which API can i use SPI or I2C for rading ACC/GYRO and  MAG because for bmi160 i initialize in spi API and for bmm150 i2c API?

    If i use bmm150 API for MAG, finally it should use bmi160 SPI  API, but how it will work internally(bmi160 to bmm150) because aux interface of bmx160 I2C only.

    How spi will pass write or reg data into bmm150? and also in bmx160 datasheet no where given for this bmm150 interface for MAG, why?

    Thanks in advance

    amarr

     

    Minhwan
    Community Moderator
    Community Moderator

    Hello Amar, 

     

    Yes, you can use I2C/ SPI interface between host MCU and BMI160, and I2C interface between BMI160 and BMM150 ( this is BMX160 internal)

    You can also check BMX160 block diagram in datasheet page 14 how BMX160 works. 

    Because BMX160 concept is kind of combination with BMI160 and BMM150, we short commented it in BMX160 datasheet page 26.

    And, https://github.com/BoschSensortec/BMI160_driver/wiki/How-to-use-an-auxiliary-sensor-or-magnetometer-....

    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