11-03-2021 09:18 AM
Hi,
I'm trying to communicate nrF52832 and BHA260AB shuttle board but I cannot get the chip ID. I checked with the logic analyzer and saw the ACK is returned.
this is I2C read function:
int8_t twi_read(uint8_t sl_addr, uint8_t reg_addr, uint8_t* output, uint8_t len)
{
ret_code_t err_code;
err_code = nrf_drv_twi_tx(&m_twi, sl_addr, ®_addr, 1, false);
APP_ERROR_CHECK(err_code);
nrf_delay_us(300); //not work if no delay
NRF_LOG_FLUSH();
err_code = nrf_drv_twi_rx(&m_twi, sl_addr, output, len);
APP_ERROR_CHECK(err_code);
nrf_delay_us(500); //delay to wait for the response
if(rx_done)
return 0;
else
return -1;
}
Please tell me what is the problem here? thanks.
Solved! Go to Solution.
11-22-2021 08:16 AM
Hello Minh,
As long as sensor is not in PWRUP state, you COULD read the chip ID, even in sleep mode.