Cannot connect to ATECC508A through TWI with NRF52832. Tested with nRF5_SDK_12 twi_master and deprecated twi_sw_master. It was working fine only with NRF51822 nRF5_SDK_12 using deprecated twi_sw_master.
Cannot connect to ATECC508A through TWI with NRF52832. Tested with nRF5_SDK_12 twi_master and deprecated twi_sw_master. It was working fine only with NRF51822 nRF5_SDK_12 using deprecated twi_sw_master.
Have you checked that you have connected the correct pins defined in your code? Do you get any error codes? Have you checked the bus using a logic analyzer, to see if there are any activity?
Pins are ok. Using latest SDK driver nrf_drv_twi.c code stays forever in loop
while (!nrf_twim_event_check(p_twim, evt_to_wait))
{
if (nrf_twim_event_check(p_twim, NRF_TWIM_EVENT_ERROR))
{
NRF_LOG_DEBUG("TWIM: Event: %s.\r\n",
(uint32_t)EVT_TO_STR_TWIM(NRF_TWIM_EVENT_ERROR));
nrf_twim_event_clear(p_twim, NRF_TWIM_EVENT_ERROR);
nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_RESUME);
nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_STOP);
evt_to_wait = NRF_TWIM_EVENT_STOPPED;
}
}
I check the bus with logic analyzer.
What is the error reported in NRF_TWIM_EVENT_ERROR
? You can enable debug logging in the TWI module by setting TWI_CONFIG_LOG_ENABLED 1
and TWI_CONFIG_LOG_LEVEL 4
in sdk_config.h.
Got it working. I quess it was HW issue.
Great! Thanks for reporting back what the issue was.