I2C is an Interface for serial communication between different devices. Therefore, one device acts as a master, other participants of the I2C-Bus act as slaves. Each slave has it's own, unique slave address. The master can address the slaves via this address.
The Microcontroller offers one I2C-Interface, which is on GPIO32 and GPIO33. GPIO32 can be configured as I2C-SDA-Pin for Datatransmission, GPIO33 can be configured as I2C-SCL-Pin for sending or receiving the Clock-Signal for I2C-operations. The TMS320F28335 can operate in I2C-Master and in I2C-Slave mode. In master mode, the Microcontroller can send data actively, in slave mode, all operations for receiving and sending data are managed via interrupts.
Slave-Address-Length is configured to 7 Bit.
Valid values are from 0x01 to 0x3F. Address 0x00 is used for broadcast to send data to all slaves on I2C-Bus.
For Rx- and Tx-operations, I2CMSG_transmit type can be used by assigning values for slave address, Register-Address-Length, Register-Address-High- and -Low-Byte, Data-Length and Databytes to each object.
In Master Mode, TMS320F28335 provides I2C-operations with 100 Kbit per second with 100 kHz on SCL. The maximal length of databytes per transmission is 16 byte.
When TMS320F28335 is configured as I2C-Slave, Master always has to send 2 Registerbytes and 2 Databytes for successful Tx-communication. Make sure that the exact Register-address of I2C-Slave is used to prevent misconfiguration. For successful Rx-communication, Master has to send two Registerbytes to TMS320F28335 -I2C-Slave. Slave will write the value of requested register to I2C-Bus then.
Configuration as I2C-Master
Configuration as I2C-Slave