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-03-2021 10:45 AM
Hello Minh,
You should check host I2C read function, there was two I2C stop signal in your waveform.
It works well on my side.
11-03-2021 02:40 PM - edited 11-03-2021 03:29 PM
Hi BSTRobin,
Thanks for your response. I removed a stop signal but the result is still 0.
In writing case, I received NACK like this so I cannot write data.
BHA260 shuttle board is new and is the first time I use it. Is the firmware already uploaded to the BHA260 chipset? I feel like the chip is blocked and I cannot access it.
Thanks
11-04-2021 03:53 AM
Hello Minh,
The chip ID can be read before the firmware is loaded.
In your SW code, you need to shift one bit to the right your device address(sl_addr) to 0x50, and try it again.
11-04-2021 08:50 AM - edited 11-04-2021 10:19 AM
Hi BSTRobin,
I tried with slave address 0x50 but received NACK.
I selected the address 0x28. My hardware setup: