Part Number: MSP430FR5969
Other Parts Discussed in Thread: TMP102
Tool/software: Code Composer Studio
Hey everyone!
I`m trying to finish my implementation of I2C using Drivelib to read and configure the TMP102 but without success in read mode.
After set the register 0x00 ( Temperature register ) as showed below : I2C TMP102 address (0x48) in transmition data ( 0x90 write mode / 0x91 read mode )
to Set it I used the code:
EUSCI_B_I2C_setSlaveAddress(EUSCI_B0_BASE, TMP102_I2C_ADDRESS); // Set TMP102 address
EUSCI_B_I2C_setMode(EUSCI_B0_BASE, EUSCI_B_I2C_TRANSMIT_MODE); //Set in transmit mode
EUSCI_B_I2C_masterSendMultiByteStartWithTimeout(EUSCI_B0_BASE,0x00,Timeout_I2C);//init the transmition with
EUSCI_B_I2C_masterSendMultiByteFinishWithTimeout(EUSCI_B0_BASE,0x00,Timeout_I2C);
while ((EUSCI_B_I2C_isBusBusy(EUSCI_B0_BASE))&& --Timeoutcounter);
After set the register I need start to receive the data. The TMP102 send 2 bytes ( MSB and LSB )
In accordance with with the examples I code it:
( I2C with out interrupt mode)
EUSCI_B_I2C_setSlaveAddress(EUSCI_B0_BASE, TMP102_I2C_ADDRESS); // Set TMP102 address
EUSCI_B_I2C_setMode(EUSCI_B0_BASE, EUSCI_B_I2C_RECEIVE_MODE);
// Send start
EUSCI_B_I2C_masterReceiveStart(EUSCI_B0_BASE);
while (EUSCI_B_I2C_isBusBusy(EUSCI_B0_BASE)) ;
// Receive first byte
Temp_Word[2] = EUSCI_B_I2C_masterReceiveMultiByteNext(EUSCI_B0_BASE);
while (EUSCI_B_I2C_isBusBusy(EUSCI_B0_BASE)) ;
// Receive second byte
Temp_Word[1]= EUSCI_B_I2C_masterReceiveMultiByteFinish(EUSCI_B0_BASE);
while (EUSCI_B_I2C_isBusBusy(EUSCI_B0_BASE)) ;
// Disable I2C Module
EUSCI_B_I2C_disable(EUSCI_B0_BASE);
Temp_Word_out = Temp_Word[0]<<8;
Temp_Word_out = Temp_Word_out + Temp_Word[1];
return Temp_Word_out ;
The I2C receive the first byte (0x16) that is compatible with the temperature now, but stop after it as show in figure below
Someone can help me understand where is the problem and what shall I do to solve it?
1- why the transmission stop after the first byte received?
2 When I send the command to configure the TMP register I need send twice the command (EUSCI_B_I2C_masterSendMultiByteFinishWithTimeout(EUSCI_B0_BASE,0x00,Timeout_I2C);) if I put only one command the I2C send only the slave address. Why does this happen?
Thank you and best regards











