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.

TMP007: Control with LabVIEW

I am having problems getting the sensor set up and controlling TMP007 with LabVIEW.

Hardware/Software:

-NI USB-8451 I2C interface

-TMP007 temperature sensor breakout board with integrated 10k pullup resistors

-LabVIEW 2015 with Windows 7

I currently am using the NI-845x I2C API and it seems that I am able to communicate with the sensor without errors (ack, etc). I am using the NI-845x I2C write read VI, and specify the EEPROM data address (result register address specified in TMP007 datasheet), # of bytes (2 for 16 bits) and I receive 16 bits of data back. I am currently unable to figure out the following:

1. Is the data I am reading correct?

2. If it is correct, how do I convert it back to a temperature?

I think I may be missing something in the binary data collection & conversion to decimal format.

Thanks,

Mark

  • Hi Mark,

    1. Can you read 2 bytes from register 0x1F and confirm that you receive 0x0078?

    2. See attachments.

    Thanks,

    Ren

  • I read 2 bytes from register 1F and received 0xFF75.

  • For all TMP products, the first byte written is the register pointer. Any subsequent bytes are data to be written to the specified register. It appears that you are writing two bytes, and then performing a read. The write and read are separate I2C transactions. In order to ensure that you are reading the desired register, you must perform a write transaction with only one byte to set the register pointer. If my assumption is correct, you are setting the register pointer to 0x00, and then attempting to write 0x1F to the upper 8 bits of this 16 bit register. However, register 0 is the read-only register Sensor Voltage, so the device discards the data you attempted to write to it. The subsequent read gives you the contents of register 0, because that is the current register pointer. The data received, 0xFF75, could plausibly be a small negative sensor voltage. To fix this, I would change "EEPROM Data Address" to U8 data type, connect it as a single element to the Build Array function, and finally connect that to the driver call.

    Ren