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.

CC2652P: I2C example code

Part Number: CC2652P
Other Parts Discussed in Thread: SYSCONFIG

Hi Team,

We would like to ask your help regarding our customer's inquiry below.

My circuit has some peripherals that must communicate with the microcontroller through the I2C protocol.

Using the IDE environment I could create the pin definition.

However, when I try to run the firmware I don't see the I2C signals on my board.

Most of the definitions are in the config files and they are hidden somehow, because they must be generated by the IDE mechanism.

I would like to access this hidden files to understand how the routines are defined.

I2C_init()

I2C_open()

etc...

How can I find these routines in my code? What would be the steps to troubleshoot my I2C protocol?

Is there any example codes that could be provided in this case?

Is there any restrictions for the IO pins to be used as SDA and SCL?

I would like to discuss these issues with some deeper detail with someone more experienced in developing with this platform.

LDF_V0.5.zip

Regards,

Danilo

  • The I2C driver source code can be found under SDK folder\source\ti\drivers and you can put I2C source files into your project to debug it.

  • Hi Danilo,

    Have the customer follow YK's answer as well as evaluate i2ctmp  using a CC1352P-2 project.  If they are not using a LaunchPad or the default pins then they should ensure they have proper pull-up resistors on the SDA/SCL lines.  And DIO on the SimpleLink device can be used so long as it does not conflict with some other functionality.  They can further debug their program to determine whether the code is spinlocking or asserting, and connect an oscilloscope or logic analyzer to the I2C pins to further evaluate their behavior.

    Regards,
    Ryan

  • Hi Ryan,

    Here is the feedback of our customer.

    We are making some tests with our board, and we could observe the i2ctmp file uses Pin 9 as SCL and Pin 10 as SDA.
    In our board design we are using them in an opposite configuration, with Pin 9 as SDA and Pin10 as SCL. I don't believe this could be a problem, I believe the chip should accept both configurations, since these are GPIO pins. Could you please confirm this setup is possible?
    In our tests we could also observe just the data signal running properly, with the signal switching between "0" and "1". 
    How could I troubleshoot the clock? I would like to have a 400kHz clock for this I2C communication, how can I check it on the config file?
    Regards,
    Danilo
  • Yes, any GPIO can be used for either I2C pin, which is configured inside the SysConfig's I2C module under the PinMux header.  The bit rate is determined by the I2C_Params bitRate which is set before I2C_open.  Using a logic analyzer or oscilloscope, they should be able to output data by modifying the example previously referred to and observe the SCL/SDA lines being pulled.

    Regards,
    Ryan