This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI Switch between easyDMA and normal read

Hi,

I am reading a BMX055 via I2C which consists of three sensors with three addresses. I got the easyDMA running to read 10 times the gyro using the PPI and the data ready interrupt. Now after 10 readings I want to read once the accelerometer and the magnetometer. But if I try to read with

nrf_drv_twi_tx(&m_twi_instance, address, &reg, 1, false); nrf_drv_twi_rx(&m_twi_instance, address, p_data, length);

I get the NRF_ERROR_BUSY which means that the TWIM is still in use. So here is my question how can I switch from easyDMA reading to normal reading.

Thanks and kind regards,

C.

Parents
  • Do you setup the TWIM transfers using the TWI driver as well? The error code NRF_ERROR_BUSY will only be returned if the driver is busy, it will not check the state of the peripheral. Did the error code come from nrf_drv_twi_tx or nrf_drv_twi_rx call? Note that unless you initialize the driver in blocking mode, you need to make sure the first transfer is finished before calling the receive function.

Reply
  • Do you setup the TWIM transfers using the TWI driver as well? The error code NRF_ERROR_BUSY will only be returned if the driver is busy, it will not check the state of the peripheral. Did the error code come from nrf_drv_twi_tx or nrf_drv_twi_rx call? Note that unless you initialize the driver in blocking mode, you need to make sure the first transfer is finished before calling the receive function.

Children
Related