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.

LAUNCHXL-CC3235SF: as a master CC3235sf i2c Connection

Part Number: LAUNCHXL-CC3235SF

HI Ti,

i try to send a data through i2c but didn"t find a error. please help me.

void writecommand(uint8_t *cmd, uint8_t cmdlen)
{
// I2C command write.
uint8_t checksum;
uint8_t txBuffer[9];
// uint8_t rxBuffer[0];

cmdlen++;

usleep(2000);

// I2C START

i2cTransaction.writeBuf = txBuffer;
// i2cTransaction.readBuf = rxBuffer;
i2cTransaction.writeCount = 9;
// i2cTransaction.readCount = 0;
checksum = PN532_PREAMBLE + PN532_PREAMBLE + PN532_STARTCODE2;

i2cTransaction.slaveAddress = PN532_I2C_ADDRESS;

txBuffer[0] = PN532_PREAMBLE; // 0x00
txBuffer[1] = PN532_PREAMBLE; // 0x00
txBuffer[2] = PN532_STARTCODE2;// 0xFF
txBuffer[3] = cmdlen;
txBuffer[4] = ~cmdlen + 1;
txBuffer[5] = PN532_HOSTTOPN532;// 0xD4
checksum += PN532_HOSTTOPN532;

uint8_t i = 0;
for (i=0; i<cmdlen-1; i++) {

txBuffer[6]=cmd[i];
checksum += cmd[i];
}
txBuffer[7]=~checksum;
txBuffer[8]=PN532_POSTAMBLE;


I2C_transfer(i2c, &i2cTransaction);

// I2C STOP
I2C_close(i2c);

}

  • What is not working? Are you having an issue with simplelink I2C driver? Have you validated your schematic? Have you used a logic analyzer on the I2C bus? Are you getting an acknowledge from the I2C slave device? Please attempt these common debug steps before posting.

    Did you already call I2C_init() and I2C_open()? Please follow the I2Ctmp example from the TI Drivers folder in CC32xx SDK. 

    Please describe your issue and setup in detail. 

  • i am working on I2C communication with PN532 RFID. i have mention in post that data is sending through I2c_transfer with the help of cc32xx simplelink i2c driver But data will be not send debug stop after I2C_transfer(i2c, &i2cTransaction). i have already call I2C_init() and I2C_open() and i2c method apply as use in i2ctmp example but always fail.

    coding part:

  • Step into I2C_transfer and enter line by line to see where the fail is occurring.

    Please provide logic analyzer scope. Is the rfid chip providing acknowledge?