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.

TMP422: Single-Byte Read

Part Number: TMP422

Hello,

I have the following questions regarding the single-byte read of TMP422:

  1. If I want to do a single-byte read for all the three temperature registers: Local Temperature Reg (x"00"), Remote Temperature Reg 1 (x"01"), and Remote Temperature Reg 2 (x"02"), does the master has to Start the data transfer, then stop it for each register?
  2. Or can the master only issue one start data transfer, and after received the data from Remote Reg 2, issue the stop data transfer?

Best regards,
Mark

  • Hi Mark,

    Figure 18 shows a write transaction followed by a read transaction. It's customary to set the pointer register internal to TMP422 using a write transaction before every read transaction. This is to ensure that data received comes from the expected register. The contents of the pointer register is retained until power cycle, so it is possible to perform multiple read transactions of the same register without making a write transaction every time.

    Pointer registers are so common in I2C devices that most software libraries support this write/read sequence as one function/action. From the hardware perspective, the write pointer transaction is implemented without explicit I2C Stop, and another Start is issued immediately for the read transaction. In this case, the second Start is called a Repeated Start. This is supported by TMP422, shown in Figure 18, and defined in the I2C standard.

    thanks,

    ren

  • Hi Ren,

    Thank you for the reply.

    You said that: "The contents of the pointer register is retained until power cycle."  If the SD bit  ='0' in the Configuration Register 1, should the contents of the Temperature Registers be updated after each ADC update?

    Best,

    Mark

  • Yes, the contents of the temperature registers are updated when an ADC conversion completes.

    thanks,

    ren

  • After a read from Local Temperature Reg, if one wants to read from another register: Remote Temperature Reg 1; does the Master have to issue a Stop before the write transaction for sending the address of Remote Temperature Reg 1?

    Best,

    Mark

  • TMP422 does not require Stop. TMP422 supports HS Mode, which has no Stop.

    thanks,

    ren

  • If Fast Mode is used, does the Master need to send out a Stop between the two register reads?

    Best,

    Mark

  • It does not need to Stop but it does need to provide 8 clocks and ACK/NACK as appropriate per frame.

    ren

  • Would this be ok (see the attached waveform)? 

    The second trace is SCL and the third one is SDA output.  The first read (AcqRMT1) is from Remote Temperature 1 and the second read (AcqRMT2) is from Remote Temperature 2.

    Best,

    Mark

    4382.two read from Remote Temperature 1 and 2.docx

  • The attachment shows read back of zero from the temperature register, which could happen shortly after power-on. The temperature registers will contain zero at power-on-reset and will be updated with temperature data when the first temperature conversions complete. 

    I've marked two areas in your waveform where the SCL and SDA appear to change at the same time. These are problematic and should be avoided. They could be interpreted as a Start or Stop, causing the device to ignore the rest of the transaction.

    0513.two read from Remote Temperature 1 and 2.docx

    thanks,

    ren

  • The SDA is inout port, the previous attached file shows the SDA output; therefore during the read, it is in 'Z', the read back data should be appeared in SDA input which is not shown in the file.

    You have a good point on where the SCL and SDA should not be changed at the same time.  There are more places in the attached file, which I only makered during the slave address byte and the pointer register address byte.  Could you please confirm that are also problematic, i.e. there should be no time that SCL and SDA be changed at the same time?

    Thanks,

    Mark0307.two read from Remote Temperature 1 and 2.docx

  • I would like to make myself clearer: in the attached file: March7_two read.docx, I labeled the markers: A, B are yours from the previous attached file, 1 to 5 are mine.  The reason for the SDA changes, which are marked for Marker 1 to 5, is that I want to shift the data out during the falling edge of the SCL to meet the Data Setup Time tSUDAT.  But if that causes problems, then I cannot shift data out on SDA on the falling edge of the SCL.  Could you please let me know if that is a problem like the Marker A and B, i.e. one cannot shift data out through SDA during SCL falling or rising edge?  Thanks.

    March7_two read.docx

    Best,

    Mark

  • There should be no time that SCL and SDA are changed at the same time. You must meet both setup and hold (SUDAT, HDDAT) so I recommend using 3 cycles for every clock pulse in a bit bang solution. 

    ren

  • Thank you for your reply.  

    You said that: "I recommend using 3 cycles for every clock pulse in a bit bang solution.", could you please elaborate on using 3 cycles for every clock?

    Best,

    Mark

  • Is there anywhere in the TMP422 datasheet: SBOS398C-July 2007- Revised May 2012, mentioned that the SCL and SDA should not change at the same time?

  • See Figure 6 in my app note for an illustration of 3 cycles per clock. http://ti.com/lit/snia026

    Changing SCL/SDA at the same time violates SUDAT and HDDAT timing specifications. These are specified for all I2C devices.

    ren

  • The HDDAT of TMP422 is 0 ns.  But if the SDA cannot change on either edge of the SCL, that would be another issue.

    So if the SDA output is shifted 1/4 the period of the SCL, will that work (see B in the attached file), instead of using 3 cycles per clock?

    Mark

  • If you can make this shift, it should be OK. As I said, you must meet SUDAT and HDDAT. Timing is measured at the VIH/VIL levels, so the host can create negative HDDAT when changing SCL/SDA at the same time. Many devices will work under this condition, but it technically does not meet the spec. I don't believe there's any reason to believe there is a fault with TMP422 in your case. 

    thanks,

    ren