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.

TMS320F280040-Q1: C2000Ware I2C driver example

Part Number: TMS320F280040-Q1
Other Parts Discussed in Thread: C2000WARE

I am referring C2000Ware I2C sample code to write my own driver for TMS320F280040PMQR . One questions comes up. From datasheet, the I2C for this MCU uses GPIO0,1. But in the sample code for F28004x, it uses GPIO32, 33. I think this need to be changed. Is it right?

  • Hi Crane,

    The I2C peripheral is muxed onto multiple GPIO pins for C2000 devices. It is available on GPIO0,1/GPIO32,33 as well as other GPIOs. As long as you select the correct mux through software, you can use an I2C peripheral through the GPIOs that list I2C on the datasheet. I suggest you to check out C2000 Academy(https://dev.ti.com/tirex/global?id=c2000Academy) for more information about our devices.

    Regards

    Peter

  • Thanks Peter. I am sure it needs to be changed.

    Which value should I write to GPyMUX1 register then if I choose these two pins for I2C. I am checking data sheet and haven't found yet. 

    In the example code, it writes 1 to the corresponding bit in GPyMUX1. Since it doesn't work when I write my code the same way, I am checking now. 

  • Hi Crane,

    If you look at table 8-5 on page 866 of the technical reference manual, you can see that for GPIO32 and GPIO33 if the GPyMUX has a value of 1, the I2C data and clock lines are selected. You can refer to this table to see the muxing options available for all GPIO pins (GPyMUX1 and GPyMUX2 together hold the four bits to configure the mux).

    Best regards,

    Omer Amir

  • Great! Thanks Omer for your help!