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 in Code Composer Studio

I'm trying to establish I2C communication between the DSK C6713 and a PIC18F4523. The PIC will act as a master transmitter and the DSK will be the slave reciever. My problem is that I do not know how to use the functions that are described in the I2C manual http://focus.ti.com.cn/cn/lit/ug/spru175d/spru175d.pdf I'm aware that I have to set up the OWN ADDRESS REGISTER (I2COAR) but as far as initialization goes, I am clueless as to what to do in Code Composer Studio.  Can anyone provide any example code used to implement the receiving end of I2C on the DSK C6713 for Code Composer Studio?

  • Hi Cristina,

    Have you seen page 30 - Programming Guide of the I2C manual. It vividly describes the  step-by-step procedure to set up I2C communication. Follow it and it should be done. There also a flowchart which should simplify things more.

    Using CCS, initially you need GEL file to set up the reset status of C6713 and a linker (.cmd) file to describe memory map. Then while writing the code, the I2C registers have predefined names and addresses. Just assign the appropriate register value to the register to configure it.

    Eg. *(volatile Uint32*)(I2CADDR) = 0x00001000 (This is just the syntax example, the address names vary)

    Hope this helps.

    Regards,

    Sid

  • Sid,

    Thank you for your response.  I have read all of the Programming Guide of the I2C manual and have a general idea on how to implement this.  Although, I quite don't understand what you mean about the GEL file and (.cmd) file.  How do I create both files in CCS?  I have never used GEL file nor linker file before since I am a beginner to programming the dsk6713.  I have been working on this for a couple weeks now so your assistance will be greatly appreciated.  Thank you.

     

    Christina

  • GEL file is a start up script that can initialize the device.  This wiki article has more explanations: http://processors.wiki.ti.com/index.php/GEL.  Command file is a memory map of the device.

    I haven't found any C6713 i2c examples, but the following two software packages should help.

    • Chip support library for the C6000

    --Christina