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.

CC13xx I2C Example

Other Parts Discussed in Thread: CC1310, TMP006

Hi,

I don't see any example about i2C for the CC1310 in the TI-rtos example folder. Is it possible to have a quick overview on how to handle i2c with the CC1310 launchpad ?

Thank you in advance,

Regards,

Yannick

  • Hi Yannick,

        I've attached example sources that uses the I2C driver to communicate with a TMP006 temperature sensor. You can take a look at i2ctmp006.c file to see how we open and carry out I2C transfers using the I2C driver. In CC1310_LAUNCHXL.c I added the necessary pin config settings for Board_I2C0_SDA0/SCL0 to the BoardGpioInitTable array. I recommend also looking at the I2C driver API reference here to help your understanding.

    Let me know if this helps

    Moses

    8524.i2ctmp006.c

    0871.CC1310_LAUNCHXL.c

    3051.CC1310_LAUNCHXL.h

    0045.Board.h

  • Hello Moses,

    Thank you for the provided I2C example.

    I was looking for the TI-RTOS I2C example as well, until I came across your example. I have implemented it on the CC1310_LaunchPad and it works perfectly out of box.

    Do you have any examples for CC1310_LaunchPad UART RS232,  UART RS485 and the AES ? 

    Any feedback is appreciated.

    Sincerely,

    Admir M.

  • There is a UART example in the TI-RTOS product. There is not an AES example currently, but the driver is there. You can look at the Crypto Driver doxygen for an overview of the module. Open the TI-RTOS/docs/Documentation_Overview_tivac.html file and navigate to the TI-RTOS Drivers Runtime APIs (doxygen) link.

    Todd

  • Hello Todd,

    Thank you for your feedback. I found the uartecho example and got my RS485 working. The next thing is the AES. I will look into the driver guide and go from there.

    Thanks again for your time,


    Admir

  • Hi all,

    I am having some difficulties trying to understand how to use I2C. In the drivers documentation, the sequence for doing a write is given as follows:

    unsigned char writeBuffer[3];

    I2C_Transaction i2cTransaction;
    i2cTransaction.slaveAddress = 0x50;
    i2cTransaction.writeBuf = writeBuffer;
    i2cTransaction.writeCount = 3;
    i2cTransaction.readBuf = NULL;
    i2cTransaction.readCount = 0;
    status = I2C_transfer(i2c, &i2cTransaction);
    if (!status) {
    // Unsuccessful I2C transfer
    }
    This examples show writing 3 bytes to the i2c slave at address 0x50. But I need to define the register to write to and the data that I want to write to the register. In this case does writeBuffer[0] correspond to the register address, writeBuffer[1] correspond to the 8 bit data that I want to write into the register? When what is writeBuffer[2] for?
  • Hi Kian,
    We generally discourage posting a new question to an answered thread. It weakens the search feature of the forum. For this reason, I suggest you start a new thread with your question and reference this thread.

    Thank you