This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to read slave address in iic(twi)

hello, i am using nrf52 dk .I was testing example twi scanner.I want to read slave address.So i am using twi scanner example but i got error message as follow:

TWI:INFO:Transfer type: XFER_RX. TWI:INFO:Transfer buffers length: primary: 1, secondary: 0. TWI:WARNING:Function: nrf_drv_twi_xfer, error code: NRF_ERROR_DRV_TWI_ERR_ANACK.

can any help me to resolve the issue

Parents
  • The error is expected on all addresses that is not used on the bus. The scanner will check each address and return the address if a device ACK's the message. Have you checked through the log for an address or do the application return "No devices found" at the end? You can disable logging in the TWI driver by setting #define TWI_CONFIG_LOG_ENABLED 0 in sdk_config.h. This will make the output of the log more readable.

Reply
  • The error is expected on all addresses that is not used on the bus. The scanner will check each address and return the address if a device ACK's the message. Have you checked through the log for an address or do the application return "No devices found" at the end? You can disable logging in the TWI driver by setting #define TWI_CONFIG_LOG_ENABLED 0 in sdk_config.h. This will make the output of the log more readable.

Children
No Data
Related