Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    Automatic detection of BMA253 and BMA456 via SPI

    Automatic detection of BMA253 and BMA456 via SPI

    Hoerz
    Member

    Hello all!
    I have a question (or a challenge) regarding the automatic detection of the sensors BMA253 and BMA456.

    My situation:

    I am working for Bosch (other division, not senortec) and we are currently using the BMA253 sensor on our hardware. Now we would like to shift to the new sensor BMA456. In order to simplify the manufacturing process we would like to implement an automatic software-based detection of the mounted sensor. In theory we could simply readout the chip ID but that is exactly the crucial problem:

    Problem 1:

    The SPI communication if different for the sensors BMA253 and BMA456.
    For the BMA253 the read-response starts after 8 SPI clock cycles, see following image:

    1648821749875.png
    For the BMA456 the read-response starts after 16 SPI clock cycles, see following image:
    1648821740767.png

    In order to perform an automatic detection I would have to read two bytes and in one of them should be a correct chip ID.
    But in theory it is also possible to have two correct chip IDs in both bytes.

    Problem 2:
    The BMA456 starts sending after 8 SPI clock cycles dummy values. I measured those values and they change often. I could not verify that those values will never correspond to the chip ID of the BMA253. 

    The BMA253 starts sending after 8 SPI clock cycles its correct Chip ID but after 16 it sends the values of register 0x01. This is a reserved register and I could not verify that those values in register 0x01 will never correspond to the chip ID of the BMA456.

    In most of the cases that sensors would be detected correctly but there might be some cases where two correct Chip IDs are read. We want to use this software in million products and we have to make sure that there is no misidentification of the sensor.

    Questions:
    - Is it possible for the BMA253 that the register 0x01 contains the Chip ID of the BMA456?
    -> If yes: Is it possible that this register will not change its content if it is read out multiple times?
    - Is it possible for the BMA456 that the dummy values correspond to the Chip ID of the BMA253?
    -> If yes: Is it possible that these dummy values will not change if read out multiple times?
    - Do you have any other ideas how a automatic software-based detection could be done?

    Thank you very much for your answers in advance!

    Julian 

    4 REPLIES 4

    SterlingMinsha
    New Poster

    Hello, I've read an article about ensuring that there is no misidentification of the sensor before. I wonder if it helps you?

    "When using wireless sensor networks for target detection, how to arrange as few sensor nodes as possible and achieve high correct detection probability and low false alarm rate is one of the key problems Using data fusion technology, the cooperation between sensor nodes can be realized, so as to greatly improve the accuracy of target detection An accuracy model for target detection is proposed. The relationship between data fusion radius and sensor node density is analyzed. A clustering method is designed to organize the target points into arrangement units, and the sensor nodes are arranged from high-density units to low-density units to cover the target area Simulation results show that the algorithm can effectively reduce the number of sensor nodes while ensuring the detection accuracy"


    @SterlingMinsha wrote:

    Hello, I've read an article about ensuring that there is no misidentification of the sensor before. I wonder if it helps you?


    Hi SterlingMinsha!
    Thanks for your reply.
    Unfortunately this has nothing to do with my decribed problem.

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Hoerz,

    When the communication interface is SPI, if you want to use the same software to detect BMA253 and BMA456, this is not supported. Because there is no dummy byte in the SPI read operation of BMA253, that is, when the address 0x00 is transmitted, one byte read is the value 0xfa of chip ID. However, the SPI read operation of BMA456 is performed by dummy byte. When the address 0x00 is transmitted, the first byte read is dummy byte, and the second byte read is the value 0x16 of chip ID. Address 0x01 is not the address of chip ID.

    In addition, pin 11 of BMA253 is the pin that determines whether to use SPI or I2C interface, which needs to be connected to GND.

    Hi BSTRobin,

    you summarized exactly the problem which we would like to solve. With the help of a Sensortec colleague we found a "workaround".
    We are cross-checking another register (pair), e.g. register 0x0F and 0x10. Those registers are both non-zero for BMA253 and all zeros for BMA456.

    1. Send read command for register 0x0F (8 SPI Clock cycles)
    2. Keep the SPI clock ON for additional 16 SPI Clock cycles and store the last received byte

    -> If the last received byte is non-zero -> BMA253 (actual received register 0x10)
    -> If the last received byte is zero -> BMA456 (actual received register 0x0F)

    Regarding your second point 


    @BSTRobin wrote:

    In addition, pin 11 of BMA253 is the pin that determines whether to use SPI or I2C interface, which needs to be connected to GND.


    We are connecting pin 11 to GND for both BMA253 and BMA456 and that is allowed in the datasheets.

     

    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