Hey guys,
I currently am trying to set up my TivaWare board as an I2C slave that is communicating with a 4D uLCD-24PTU board. When I try to run my code, the interrupt never seems to fire. Also, it looks like an ACK is being sent, but then the SDA line is then left high, causing the 4D board to get confused and stop transmitting. I think this looks like my Pins aren't being properly set up, but I'm not sure what else I need to do. My configure I2C and I2C interrupt functions are below:
void ConfigureI2C(void) //CHARLES
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
GPIOPinConfigure(GPIO_PB2_I2C0SCL);
GPIOPinConfigure(GPIO_PB3_I2C0SDA);
GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);
I2CSlaveInit(I2C0_BASE, 0x23); //address is x23?
I2CIntRegister(I2C0_BASE, UpdateDisplay);
}
void UpdateDisplay(void) //CHARLES
{
if(I2CSlaveStatus(I2C0_BASE) == I2C_SLAVE_ACT_TREQ)
{
I2CSlaveDataPut(I2C0_BASE, data?);
} else if(I2CSlaveStatus(I2C0_Base) == I2C_SLAVE_ACT_RREQ)
{
I2CSlaveDataGet(I2C0_BASE);
}
I2CSlaveIntClear();
I2CSlaveEnable();
}
I'm more concerned about just getting the interrupt to fire at this point, as it seems like my configuration is messing things up. Would you guys be able to help me figure out how to properly configure this so pins B2 and B3 are the SCL and SDA lines respectively?
Thanks a bunch!
Charles