Part Number: F28377D-SEP
Other Parts Discussed in Thread: C2000WARE
The F28379D controller has two I²C interfaces: I2C0 and I2C1.
On I2C0, an EEPROM and RTC are connected, and this interface is working fine.
Now, I am trying to connect I2C1 to the processor via the backplane. I have configured the slave address as 0x4A, but I am not sure whether this address is correct or not. Here, the F28379D is configured as an I²C slave for the Processor card.
However, the I²C slave address is not detected on the processor card. I want to confirm whether configuring the F28379D as an I²C slave will work in this setup or not.
Whether my slave address is correct or not ?
Please check my below code.
#define I2C1_SLAVE_ADDR 0x31 // choose any free 7-bit address
void i2c1_slave_init(void)
{
// Disable module before config
I2C_disableModule(I2CB_BASE);
// Init clock (speed irrelevant for slave, but required)
I2C_initController(I2CB_BASE,
DEVICE_SYSCLK_FREQ,
100000,
I2C_DUTYCYCLE_50);
// Configure as SLAVE
I2C_setConfig(I2CB_BASE, I2C_SLAVE_RECEIVE_MODE);
// Set OWN slave address (this is what master scans)
I2C_setOwnAddress(I2CB_BASE, I2C1_SLAVE_ADDR);
// 7-bit addressing
I2C_setAddressMode(I2CB_BASE, I2C_ADDR_MODE_7BITS);
// Standard 8-bit data
I2C_setBitCount(I2CB_BASE, I2C_BITCOUNT_8);
// Disable loopback
I2C_disableLoopback(I2CB_BASE);
// FIFO not required since no data transfer
I2C_disableFIFO(I2CB_BASE);
// Clear pending status
I2C_clearStatus(I2CB_BASE,
I2C_STS_NO_ACK |
I2C_STS_ARB_LOST |
I2C_STS_STOP_CONDITION);
// Enable module
I2C_enableModule(I2CB_BASE);
}
call the below function in main
i2c1_slave_init();