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.

CCS/RM46L852: I2C and how it works

Part Number: RM46L852
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello! :-)

I'm new to I2C and want to implement a RTC to my project. My question is relating to the output of the i2c bus.

DS3231 wants me to send a byte with the slave address, a byte with the register address and the data byte.

When i use the sciSend function, which HalCoGen creates for me, does it automatically send the slave adress and writes the R/W Bit into it? So, do I only need to send register address and data?

Thanks for your help,

Greetings

  • Hello Kubiks,

    If you just write data to RTC, send() is ok. If you want to read data back from RTC, you need to follow the protocol defined in RTC datasheet.

    You can use i2cSendByte(..) for this purpose:

    1. /* Configure address of Slave to talk to */
    i2cSetSlaveAdd(i2cREG1, Slave_Add);
    2. /* send the read address */
    i2cSendByte(i2cREG1, Read_Add);