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-05-2021 10:25 AM
Hi BSTRobin,
sorry, I re-check my hardware setup the HSDO pin connected to the ground. Thanks for your code. I will re-check again my source code.
11-08-2021 07:55 AM
Hello Minh,
Follow previously discussed HW & SW operations , it will work.
11-11-2021 11:08 AM - edited 11-11-2021 11:21 AM
Hi BSTRobin,
Sorry for the late feedback. I found the reason.
BHA260 auto goto sleep after power-up if no action and very quick:
you can refer to datasheet page 37.
My question: how to keep BHA260 chip set in the ACTV mode after power up?
thanks
11-12-2021 04:32 AM
Hello Minh,
Do you mean that the failure to read the chip ID has anything to do with this?
After power on, you can allow access to the chip ID register as you have saw our I2C waveform capture.
11-12-2021 05:20 AM
Hi BSTRobin,
can read chip ID at the first time BHA260 power up like the picture below.
then if there is no action the BHA260 chipset will go to sleep and I cannot read the chip ID again.
That is my conclusion when I read the datasheet on page 37.
Thanks