This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMP112: Temperature always being read back as x"7FF" / Using NACK to terminate reads

Part Number: TMP112

We have 3 TMP112 chips connected to an FPGA.  On power up we write to registers 1, 2 & 3 with 00, 0000 & 0000 respectively.  Then we read from the temp registers.  This read gives us 7FFF (from all 3 sensors).  All subsequent temp reads give us the same value back.

One thing I have noticed is that we are using NACKs to terminate reads from the TMP112.  Is this OK?  I've noticed that the datasheet show only ACKs but using NACKs should be OK according to the I2C spec.

I've attached a zip of scope captures of this activity.  Note that there was an accidental "dual start" before each transaction.  This was a bug which has since been removed, but hasn't changed the bug.  I can recapture if this helps.tmp112_scope.zip

  • Hello David,

    Can you please send the programming sequence you are using for the TMP112, while we check the waveforms.

    As for the Read question, yes, it is as per I2C, that the last data transaction from I2C be terminated by the master using NAK
  • As stated it's an FPGA driving these devices so I don't have a handy code snippet I can provide. In pseudo code we are writing...

    Transaction 1, write to register 1:
    Data
    0x90 (all to tmp112)
    0x01
    0x00
    Transaction 2, write to register 2:
    0x90 (all to tmp112)
    0x02
    0x00
    0x00
    (ACK)
    Transaction 3, write to register 3:
    0x90 (all to tmp112)
    0x03
    0x00
    0x00
    Transaction 4, Read from temp (register 0):
    0x90 (to tmp112)
    0x01(to tmp112)
    0x91(to tmp112)
    0x60(from tmp112)

    0x90(to tmp112)
    0x02(to tmp112)
    0x91(to tmp112)
    0x00(from tmp112)
    0xFF(from tmp112)

    0x90(to tmp112)
    0x03(to tmp112)
    0x91(to tmp112)
    0x00(from tmp112)
    0x7F(from tmp112)
  • Hello David.

    The registers are 16-bit wide. Hence the configuration register needs to have 2 bytes instead of 1 byte.

    As for the read from temp (register 0), the pointer address is not correct. It should be

    0x90, 0x00, 0x91, RD, RD