Bosch Sensortec Community

    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

    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 : 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

    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 */
    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 */
    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;
    rslt = BMA4_E_NULL_PTR;

    return rslt;