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.

I2C Slave using Starterware and SYS/BIOS

Other Parts Discussed in Thread: AM3359, SYSBIOS

Greetings E2E Community,

I am currently working on a project involving the AM3359.  Currently, it is still in the evaluation stages.  The hardware that I'm using is the ICE v2 dev board with the AM3359.  I already have the SYS/BIOS Industrial SDK, and its prerequisites, installed and setup.  Also, I have a basic CCv6 project based on a typical SYS/BIOS template with Starterware source and header files for I2C.  I've attached a zip file with my CCv6 project.  Before I go any farther, could someone give me some advice as to how to configure the AM3359 as an I2C slave using Starterware?  Basically, I want to create a SYS/BIOS application for the AM3359 that can be an I2C slave, and I'm looking for advice as to the proper way forward before jumping down the rabbit hole :)

Sincerely,

Daniel1055.Test.zip

  • Daniel,

    I assume you are working with sysbios_ind_sdk_2.1.1. You would have to manipulate the I2CSetMode() API in i2c.c. Unfortunately, I don't have an example to share at the moment. 

    If you are looking for an RTOS based example, also take a look at the Processor SDK RTOS package for AM335x. This has an ICEv2 RTOS I2C example located at C:\ti\pdk_am335x_1_0_1\packages\MyExampleProjects\I2C_Example_icev2AM335x_armExampleProject. This configures the EVM as Master, but you might be able to manipulate the APIs to set as slave. Hope this helps.

    Lali

  • Hi Lali,

    Thank you for your response.  I am using the sysbios_ind_sdk_2.1.1.  I know that setting the mode to slave would be one step.  Unfortunately, the TI-RTOS I2C driver is only for master mode; according to the documentation, at least.  There are examples in code and in the documentation for setting the I2C controller as a master (configuring clock, pin mux, etc.).  A source code example may not be necessary.  However, I would like to know the steps involved to configure the controller as a slave.  Is the set mode API call all that is necessary?  Just for my own curiosity, for reading and writing data on the bus as a slave, would using DMA in response to an RTOS Hwi be possible?  If so, what steps would be involved?  I apologize in advance for my inexperience.  I have been reading through documentation and the wikis, and there is a lot of information to sort through.  Thank you for your help.

    Daniel

  • Hi Daniel,

    No need to apologize at all as I understand that there is alot of information :) Shall try to assist.
    I do not know if the API call alone would suffice to put the device in slave mode, but will request some feedback from some folks in the development team regarding the flow needed to set as Slave. If you don't hear back from me within a week, please bump this post for an update. Thanks for your patience.

    Lali
  • Hi Lali,

    Thank you for your assistance; it is much appreciated. In the meantime, could you also investigate using I2C interrupts or the DMA controller with the SYS/BIOS Hwi interface? The idea would be to handle an I2C or DMA interrupt with an Hwi to read data from the master. Sending data to the master will be handled later :). Also, I "liked" your last post; hopefully, that is helpful.

    Sincerely,

    Daniel
  • Hi Daniel,

    I think that using HWI to trigger a DMA based on an I2C interrupt should be possible. However, pay attention to the overhead that is associated with jumping to the HWI from the OS. In the meantime, I'm checking on the I2C slave question.

    Lali