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.

[FAQ] PROCESSOR-SDK-AM64X: I2C Integration Guide

Part Number: PROCESSOR-SDK-AM64X
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

On Sitara Family of Processors, there are multiple instances of I2C present.

Some of the I2C instances are available in the MAIN Domain[example: SoC_I2C0] while few of them are from MCU Domain[example: MCU_I2C0].

Few questions from development point of view are as follows:

  1. How to configure I2C in MCU PLUS SDK?
  2. How to configure a MCU or MAIN domain I2C using SysConfig tool?
  3. How to configure different parameters for I2C?
  4. What are the different I2C Transaction parameters?

Let's address each of these questions.

  • How to configure I2C in MCU PLUS SDK?

    To configure I2C we will use the SysConfig tool TI provides. So for a custom application, you will have an example.syscfg file present in the project directory.

    Open the example.syscfg directly if you are in the CCS IDE or from the command line write : gmake syscfg-gui to open the SysConfig tool.

    It should look as follows. 

    Now go ahead and add the I2C by clicking on the ADD button inside the I2C tab.

    Post adding it should look as follows:

    You have just added a I2C instance ready to be used for your application.

  • How to configure a MCU or MAIN domain I2C using SysConfig tool?

    Talking about different SoCs, we have different I2C instances present and can be found below.

    AM64x:

    4 * MAIN Domain I2C, 2 * MCU Domain I2C

    AM62x, AM62P, AM62A each having:

    4 * MAIN Domain I2C, 1 * MCU Domain I2C, 1 * WKUP Domain I2C

    So for, let's say AM62x, you want to configure Main Domain I2C then you can go ahead and select the option I2C Instance as stated below:

    For selecting the MCU Domain Instance, go ahead and check the box "Use MCU Domain Peripherals" and then select the instance:

    For selecting the WKUP Domain Instance, go ahead and check the box "Use Wakeup Domain Peripherals" and then select the instance:

    Now you have successfully learnt to configure I2C Instances from different domains.

  • How to configure different parameters for I2C?

    Frequency can be set by modifying the Bit Rate field.

    Choosing between Interrupt and Polling mode can be done by checking the box Enable Interrupt and vice versa.

    Transfer Mode can be selected between the following options:

    Blocking and Callback mode: https://github.com/TexasInstruments/mcupsdk-core/blob/next/test/drivers/i2c/test_i2c.c

  • What are the different I2C transaction parameters?

    controllerMode: set to true as by default the I2C acts as a Controller, but you can set to to false to make sure I2C acts as a Peripheral/Slave.

    writeBuf: a buffer which contains data to be sent to the slave part.

    readBuf: an empty buffer which expects data to be received from the slave part.

    writeCount and readCount: number of values to be sent/written and received respectively.