Other Parts Discussed in Thread: TCA9555
I am trying to interface an LED display board based on TCA9555 through i2c. Used I2C0 in TM4c1294NCPDT. Configured Port0 as output in TCA9555. However the LED is not on. The code snippet below.
void iniitiic1(void)
{
//
// Enable the I2C0 peripheral
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
//
// Wait for the I2C0 module to be ready.
//
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_I2C0))
{
}
//
// Initialize Master and Slave
//
I2CMasterInitExpClk(I2C0_BASE, SysCtlClockGet(), true); //400 speed
//
// Specify slave address
//
I2CMasterSlaveAddrSet(I2C0_BASE, 0x27, false); //0x27 is the address and write only
//
// Place the character to be sent in the data register
//
I2CMasterDataPut(I2C0_BASE, 0x06); //configuration register command
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while(I2CMasterBusy(I2C0_BASE));
I2CMasterDataPut(I2C0_BASE, 0x00); //configuration register write bits
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
while(I2CMasterBusy(I2C0_BASE));
I2CMasterSlaveAddrSet(I2C0_BASE, 0x27, false); //0x27 is the address and write only
I2CMasterDataPut(I2C0_BASE, 0x02);// data register command
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while(I2CMasterBusy(I2C0_BASE));
I2CMasterDataPut(I2C0_BASE, 0xAA); // data register data
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
}
I just tried the TivaWare Peripheral Driver Library example with code added specific for TCA9555.
Help will be appreciated.
Regards,
Ramesh