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.

  • 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.

  • Hi Martin, I have a good and a bad news: The good one: Scanning did work. The bad one: Only one device was found, at that at the address 80d = 50h; also at the oscilloscope I see the ACK when sending to 50h which would mean an I²C address of 0xA0/1 instead of 0x90/1. Actually I try to find out if the device is the TMP108 or the EEPROM...

    Do you have any idea how this is possible? I tried it already with another electronics (same type), but same behavior - strange...

  • What is the serial number of the EEPROM? My bet is that it is the EEPROM that answers. 50h is not one of the possible addresses of the TMP108. 0xA0 is an 8 bit number and is probably not what you should refer to in the documents or code. Please have a look at this thread.

  • You are right Martin: the EEPROM address is 0xA0/1 - only the ECAD designer who designed the electronics in Altium was obviously reading 0x10 at my schematics paperwork and didn't discover that it is an 'A' and not a '1'... Now I know that the EEPROM can be read and written; unfortunately not the TMP108; I have to check this now....Thanks for your help!

Related