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

Why there is no TWI NACK for wrong Slave address

Hello,

I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flashing the image.

To understand TWI better, I loaded 'twi_sensor' example as is on nRF52832 development kit where there is no LM75B sensor.

As per below link, if there is a wrong slave address, there will be NACK.

https://blog.digilentinc.com/i2c-how-does-it-work/

But I did not receive any interrupt in twi_handler() of event type NRF_DRV_TWI_EVT_ADDRESS_NACK or NRF_DRV_TWI_EVT_DATA_NACK. When will these occur actually.

Because of this, code struck in while loop "while (m_xfer_done == false);"

Thanks & Regards

Vishnu Beema

Parents
  • Hi,

    Error code 33281 = 0x8201 -> NRF_ERROR_DRV_TWI_ERR_ANACK ( from sdk_errors.h).

    I am not sure why twi_sensor don't throw any errors, is it using the same GPIO's as twi_scanner and is there external pull ups? Having a logic analyzer (e.g. saleae) to look at the actual twi activity may be helpful here, then it's possible to decode the twi transfer.

    It may also be related to that twi_scanner use nrf_drv_twi_rx() and twi_sensor use nrf_drv_twi_tx(), though I would expect both to throw error or success.

    Best regards,
    Kenneth

Reply
  • Hi,

    Error code 33281 = 0x8201 -> NRF_ERROR_DRV_TWI_ERR_ANACK ( from sdk_errors.h).

    I am not sure why twi_sensor don't throw any errors, is it using the same GPIO's as twi_scanner and is there external pull ups? Having a logic analyzer (e.g. saleae) to look at the actual twi activity may be helpful here, then it's possible to decode the twi transfer.

    It may also be related to that twi_scanner use nrf_drv_twi_rx() and twi_sensor use nrf_drv_twi_tx(), though I would expect both to throw error or success.

    Best regards,
    Kenneth

Children
No Data
Related