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.

How to configure the TMP102

Other Parts Discussed in Thread: TMP102, MSP430F249

Hi,

I am currently working on TMP102,using MSP430f249 to set it in the one-shot mode and take data from the TMP102 every 30 seconds. While I donot know how to set the configuration register. The pointer register is defaultly pointing to the temp register. So I can directly write 0x01 into the Tx buffer of the I2C. Then the pointer changes to the configuration register? Then What I put into the Tx buffer next would configure the TMP 102?

Or, some other procedure should be followed. I cannot find a example code on it.

Si

  • Si,

    You have the right idea. You will need to change the pointer address to 0x01 and then follow the "write word"  procedure shown on page 13 of the datasheet.

    I have put together a procedure for another I2C device that you can look at as an example. The I2C protocol is identical to both devices (TMP102 and the device in my example) and should point you in the right direction.Please scroll down on the link below for the example. Also on this link you can find example C code for the MSP430

    Find example here: http://e2e.ti.com/support/other_analog/temperature_sensors/f/243/t/206460.aspx

  • Hi,Chris,

    Thanks for your help. Below is what I am doing now. I have initiate the I2C before that.And  I have put the TMP102 address to UCB1I2CSA, which is 0x48. Is that right that I can just use  UCB1CTL1 |= UCTXSTT   to define a START and then I write the address and R/W into the TxBUF,and then the data?

      UCB1CTL1 |= UCTXSTT;       // I2C start condition 

    while(UCB1TXIFG==0);  

    UCB1TXBUF = 0x90;

       while(UCB1TXIFG==0); 

    UCB1TXBUF = 0x01;

      while(UCB1TXIFG==0);  

    UCB1CTL1 |= UCTXSTT;  

    while(UCB1TXIFG==0);  

      UCB1TXBUF = 0x91;