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.

Conflicting formats for CC26xx I2C on SCS

I have a SmartRF06 + CC1310EM and just started to deal with the I2C features on the Sensor Controller Studio.

I loaded the I2C Light Sensor example and saw two formats for the i2cTx(txValue), the first is in the code supplied in the I2C Light Sensor example:

The second one is found in the SCS resources documentation, in the I2C section:

Which one is correct?

  • Hi Caio,

    I have notified a colleague to clarify for you, but I believe that I2C_OP_WRITE should be used. Not sure why the documentation states I2C_WRITE. Looking at the list file from the I2C light sensor example only I2C_OP_WRITE is used.

  • Sorry if I wasn't clear enough, but the main question here is whether the write/read bit should come before or after the I2C device address when assembling the byte, or if it doesn't matter at all. Maybe I'm lacking knowledge about I2C and transmit order - LSB first or MSB first etc, but I expected to have this info in the documentation and examples with no room for doubt and guessing.

    But yeah, the code supplied in the I2C Light Sensor differs from the code used as example in the SCS programming documentation in more than one way.

  • Hello Caio,
    Glad to hear you are checking out the sensor controller :).
    It does not matter as it is an OR operation between two single bytes and the write/read is placed at bit index 0. 7-bits address + 1 bit R/W. The I2C_OP_WRITE and I2C_OP_READ is hard coded into SCS meaning that you don't have to worry about the correct sequence. The general implementation follow the general I2C bus specification from Philips Semiconductor (now NXP Semiconductors).

    The example given in the help Viewer is for an Accelerometer sensor while the I2C light sensor is for a light sensor and therefore the implementation will differ. But if there are other discrepancies that does not make sense please let us know so we can look into it. I think the I2C_WRITE constant mentioned above was a a typo and the version I am looking at now which will be released this month (version 1.2.0) has the correct naming.

  • Thank you Eirik, this clarifies it.
    I overlook the OR operation and saw it as some sort of concatenation. Now it makes sense.
    Thanks again