This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TWI SDA check for NACK

Hello, I want to use at the nRF52832 a temperature sensor TMP108 and an EEPROM via TWI bus which are connected to Pin 5 (SDA) and Pin 6 (SCL). I made a lot of time until understanding that at the declaration of the sensor using nrf_drv_twi_config_t 'Pin' is written but 'port' (0.03 / 0.04) are needed... Finally I have now the typical signals for SCL and SDA (at my own board as well as at the PCA10040). Only the Acknowledge doesn't appear which is clear for the PCA10040. At my own board I tried separately the sensor (at address 0x90/0x91) by reading and writing; the EEPROM at address 0x10 doesn't give any Acknowledge neither. I had before 4k7 Pull-Ups which I soldered out using only the internal pull-ups - at 100kHz this seems still working and at the oscilloscope looks fine. The high-levels are at about 2.5V and the low-level at about 0.3V - could this be a problem? Is there any possibility to check if the configuration is ok when the acknowledge should appear? Do I need the twi-master-functions for this (in the first step I only need the temperature sensor) or are the twi functions sufficient? Thanks in advance.

Parents
  • Hi,

    If you use the TWI drivers from Nordic you should use address 0x48 to 0x4B for the TMP108, dependent on your A0 pin configuration. From the TMP108 datasheet: image description

    You don't need to left shift this address or add any TWI read/write bits at the end. That is all handled in the nRF52 hardware.

    I'll advise you to try the TWI Scanner Example. This example will scan all possible TWI addresses and give you an output if a slave device is answering. If a slave responds, then the returned address is the address you should use throughout your code. If no devices respond then you have a TWI driver configuration issue or an external hardware issue.

Reply
  • Hi,

    If you use the TWI drivers from Nordic you should use address 0x48 to 0x4B for the TMP108, dependent on your A0 pin configuration. From the TMP108 datasheet: image description

    You don't need to left shift this address or add any TWI read/write bits at the end. That is all handled in the nRF52 hardware.

    I'll advise you to try the TWI Scanner Example. This example will scan all possible TWI addresses and give you an output if a slave device is answering. If a slave responds, then the returned address is the address you should use throughout your code. If no devices respond then you have a TWI driver configuration issue or an external hardware issue.

Children
No Data
Related