NRF52832 twi does not find ATECC508A

maiduule gravatar image

asked 2017-05-19 14:03:13 +0100

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.

edit retag flag offensive close delete report spam


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?

Jørgen Holmefjord ( 2017-05-22 11:29:17 +0100 )editconvert to answer

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",
                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.

Maidu ( 2017-05-22 11:36:41 +0100 )editconvert to answer

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.

Jørgen Holmefjord ( 2017-05-23 16:02:22 +0100 )editconvert to answer

Got it working. I quess it was HW issue.

Maidu ( 2017-05-23 16:04:58 +0100 )editconvert to answer

Great! Thanks for reporting back what the issue was.

Jørgen Holmefjord ( 2017-05-23 16:05:47 +0100 )editconvert to answer