Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Harware limitation on the NRF52833 for I2C burst

    Harware limitation on the NRF52833 for I2C burst

    yduv
    Occasional Visitor

    Dear Bosch Sensortech community,

    We are using the NRF52833 MCU with the BMA456 through I2C.

    We would like the BMA456 to raise an interrupt pin when we detect any motion in order to wakeup the NRF52833 from sleep.

    We can successfully access the registers of the BMA456 (CHIP_ID (0x00) returns the expected value).

    Simple write works too.

    However, there is a hardware limitation of the function NRF_DRV_TWI_TX(...); (Function for writing on I2C on the NRF52) for a burst write. The data transfer is limited to 256 bytes. 

    We are thus unable to do a burst write of the BMA configuration file (found here : https://github.com/boschsensortec/BMA456-Sensor-API/blob/master/bma456h.c) in the FEATURES_IN register. It is 6144 Bytes and it is too wide.

    Is there any solution to either do the burst write or to activate the interrupt without writing into FEATURES_IN?

    Thanks in advance!!

    1 REPLY 1

    BSTRobin
    Community Moderator
    Community Moderator

    Hi yduv,

    The configuration file in the bma456h_config_file is not written at one time, but is written in segments. The length of the segment can be configured. Generally, it cannot be greater than the maximum length supported by hardware I2C, for example, it cannot be greater than 256 for your NRF52833 MCU platform.


    /*!
    * @brief Function to select the interface between SPI and I2C.
    */
    int8_t bma4_interface_selection(struct bma4_dev *bma)
    {
    int8_t rslt = BMA4_OK;

    if (bma != NULL)
    {
    /* Select the interface for execution
    * For I2C : BMA4_I2C_INTF
    * For SPI : BMA4_SPI_INTF
    */
    bma->intf = BMA4_I2C_INTF;

    /* Bus configuration : I2C */
    if (bma->intf == BMA4_I2C_INTF)
    {
    printf("I2C Interface \n");

    /* To initialize the user I2C function */
    user_i2c_init();
    dev_addr = BMA4_I2C_ADDR_PRIMARY;
    bma->bus_read = user_i2c_read;
    bma->bus_write = user_i2c_write;
    }

    /* Bus configuration : SPI */
    else if (bma->intf == BMA4_SPI_INTF)
    {
    printf("SPI Interface \n");

    /* To initialize the user SPI function */
    user_spi_init();
    dev_addr = 0;
    bma->bus_read = user_spi_read;
    bma->bus_write = user_spi_write;
    }

    /* Assign device address to interface pointer */
    bma->intf_ptr = &dev_addr;

    /* Configure delay in microseconds */
    bma->delay_us = user_delay;

    /* Configure max read/write length (in bytes) ( Supported length depends on target machine) */
    bma->read_write_len = 8;
    }
    else
    {
    rslt = BMA4_E_NULL_PTR;
    }

    return rslt;

    }

    bma4_write_config_file.png

    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