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.

TMP006: Reading registers atomically

Other Parts Discussed in Thread: TMP006

In order to calculate the object temperature one needs to read two registers (VOBJ and TAMB) in the TMP006. Since these are continuously updated by the sensor, several questions arise concerning the validity of the data read. I found very little information on this topic in the datasheet. Can someone comment on the following questions:

1.The DRDY bit indicates "Object voltage and ambient temperature results are ready to read". Does this mean that no further updates occur until the flag is cleared by reading the registers?

2. When DRDY=1, is it safe to read both Vobj and Tamb without further checks of DRDY? Is the following scenario possible: (i) the master reads VOBJ and thereby clears DRDY, (ii) the sensor happens to complete a conversion at this very moment and writes Tamb, (iii) the master reads TAMB at the same time.

3. Are 16-bit reads always safe? When reading a register without checking DRDY (or if a collision as in 2. occurs), is it possible that a 16-bit read yields inconsistent data with LSB and MSB from two different conversions?

  • Hi Michael,

    We received your questions. Will review and get back to you soon. 

    Mayrim

  • Hi Michael,

    Please see the answers to your questions here:

    1.The DRDY bit indicates "Object voltage and ambient temperature results are ready to read". Does this mean that no further updates occur until the flag is cleared by reading the registers?

    ANS] The results will continue to update even after the flag is set. The flag is mainly intended to be used with one shot command. This will indicate that the one-shot is done and the results can be read. If part is in continuous conversion mode, then DRDY flag is set at end of each conversion.

    2. When DRDY=1, is it safe to read both Vobj and Tamb without further checks of DRDY? Is the following scenario possible: (i) the master reads VOBJ and thereby clears DRDY, (ii) the sensor happens to complete a conversion at this very moment and writes Tamb, (iii) the master reads TAMB at the same time.

    ANS] Result registers updated at the end of the conversion. How ever there is a small delay between these updates. The DRDY flag is set only after all result registers are updated. So if you read the registers after DRDY =1, then you will be fine, given that the read happens before the next conversion finishes.

    3. Are 16-bit reads always safe? When reading a register without checking DRDY (or if a collision as in 2. occurs), is it possible that a 16-bit read yields inconsistent data with LSB and MSB from two different conversions?

    ANS] Yes. Data is synchronized internally to make sure that device does not give 8bits of old value and next 8 bits of new value. All 16 bits will belong to same value either old or new.

  • Hi Ed,

    thank you for answering my questions.

    Regards,
    Michael