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.

C6678: I2C to set a IO Exapnder Bit

Other Parts Discussed in Thread: TCI6638K2K

Hi,

I want to set a line in the IO Expander using I2C. How to go by doing this? Can some one point to some code samples if there are any. I found the evmc66x_eeprom.c and .h files, can i modify these files for my usage?

Since all the source files in projects are linked, how and where can i add these new functions?

Regards

Pradeep

  • Hi Pradeep,

    Are you referring to a particular EVM? I'm not sure what I2C expander that you are asking about.

    Regards, Bill

  • Hi Bill,

    I am working on a daughter card for TCI6638K2K EVM. There are IO Expanders on the card. I want to access this IO Expander lines using i2C. The only software related to I2C in 6638 is the evmc66x_eeprom.c. Can i modify these files to suit my needs? Are there any other software resources for I2C on C66 series of TI DSP?

    If there i any other way can you please tell me?

    Regards

    Pradeep

  • Hi Pradeep,

    The IO expanders on the TCI6638K2K EVM are programmed using the SPI interface from the BMC microcontroller and not by an I2C from the TCI6638. Which expander are  you referring to?

    Regards, Bill

  • Hi Bill,

    In TCI6638K2K, I2C2 is routed to the 120 pin connector. We are connecting our daughter card to this connector and using this I2C2 to access few IOExpander lines on the Daughter card connected to the TCI6638K2K EVM. Is there any test code to access ioExpanders using I2C2 or any related code> I only see the I2CEEPROM code in the MCSDK. Can i use this for my needs?

    Regards

    Pradeep

  • Hi Pradeep,

    Sorry for the confusion. I2C is a standard interface but some devices use multiple accesses to expand the addressing capability. The I2C expander that you are using probably only has a couple of control registers and can use the address bits built into the standard I2C access. You can use the MCSDK software as a starting point. You'll have to look up the device address for the expander and add the external address bits. The EEPROM on the EVM is a 400KHz device. If you expander also supports 400KHz then the clock configuration should be the same as found in the MCSDK code. More details on the registers can be found in the I2C Users Guide on the TCI6638K2K website.

    Regards, Bill

  • Thanks bill. I'll see what i can do

    Regards

    Pradeep