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.

I2c Communication issue for RM57

Hi,

I am trying to read TCN75A temperature sensor via I2c on rm 57 board. we have customized board with TCN sensor on board. 

I took basic example to get started with

#include "HL_system.h"
#include "HL_i2c.h"

#define own_add 0x20
#define Slave_Address 0x4E
#define bsize 16
#define Slave_Word_address 0x00
#define Receive_data_setup 0x1 // 1 Word address

main{

 i2cInit();


///////////////////////////////////////////////////////////////
// Master Receive Functionality //
///////////////////////////////////////////////////////////////

/*****************************************/
//// Setup Slave to receving the data
/*****************************************/

/* wait until MST bit gets cleared, this takes
* few cycles after Bus Busy is cleared */
// while(i2cIsMasterReady(i2cREG1) != true);

/* Configure address of Slave to talk to */
i2cSetSlaveAdd(i2cREG1, Slave_Address);

/* Set direction to Transmitter */
/* Note: Optional - It is done in Init */
i2cSetDirection(i2cREG1, I2C_TRANSMITTER);

/* Configure Data count */
/* Slave address + Word address write operation before reading */
i2cSetCount(i2cREG1, Receive_data_setup);

/* Set mode as Master */
i2cSetMode(i2cREG1, I2C_MASTER);

/* Set Stop after programmed Count */
i2cSetStop(i2cREG1);

/* Transmit Start Condition */
i2cSetStart(i2cREG1);

/* Send the Word Address */
i2cSendByte(i2cREG1, Slave_Word_address);

/* Wait until Bus Busy is cleared */
while(i2cIsBusBusy(i2cREG1) == true);

/* Wait until Stop is detected */
while(i2cIsStopDetected(i2cREG1) == 0);

/* Clear the Stop condition */
i2cClearSCD(i2cREG1);

UART_putString("I2C Receive start 2\n\r");
/*****************************************/
//// Start receving the data From Slave
/*****************************************/

/* wait until MST bit gets cleared, this takes
* few cycles after Bus Busy is cleared */
while(i2cIsMasterReady(i2cREG1) != true);

/* Configure address of Slave to talk to */
i2cSetSlaveAdd(i2cREG1, Slave_Address);

/* Set direction to receiver */
i2cSetDirection(i2cREG1, I2C_RECEIVER);

/* Configure Data count */
/* Note: Optional - It is done in Init, unless user want to change */
i2cSetCount(i2cREG1, DATA_COUNT);

/* Set mode as Master */
i2cSetMode(i2cREG1, I2C_MASTER);

/* Set Stop after programmed Count */
i2cSetStop(i2cREG1);

/* Transmit Start Condition */
i2cSetStart(i2cREG1);

/* Tranmit DATA_COUNT number of data in Polling mode */
i2cReceive(i2cREG1, DATA_COUNT, RX_Data_Master);

/* Wait until Bus Busy is cleared */
while(i2cIsBusBusy(i2cREG1) == true);

/* Wait until Stop is detected */
while(i2cIsStopDetected(i2cREG1) == 0);

/* Clear the Stop condition */
i2cClearSCD(i2cREG1);
UART_putString("I2C data received 3\n\r");

asm(" nop");
asm(" nop");
asm(" nop");

}

I am not bale to read back data from the senor. Please suggest if i missing something. Baud rate is used is 400 MHz .

H/w connect as below