Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: IO-EXPANDER-EVM
Team,
Our customer is having some trouble with using the IO-EXPANDER-EVM, along with a TIVA TM4C129X development board and I2C interface.
They can successfully receive data (S1 ans S2) thanks to this reference code :
I2CMasterSlaveAddrSet(I2C1_BASE,0x23, false);
I2CMasterDataPut(I2C1_BASE, 0x00);
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
I2CMasterSlaveAddrSet(I2C1_BASE, 0x23, true);
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
rec = I2CMasterDataGet(I2C1_BASE);
while(I2CMasterBusy(I2C1_BASE));
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
However, they can’t seem to send data through the IO EXPANDER, having tried code like this:
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_START);
I2CMasterSlaveAddrSet(I2C1_BASE, 0x23, false);
I2CMasterDataPut(I2C1_BASE, 0x02);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
I2CMasterDataPut(I2C1_BASE,0x55);
while(I2CMasterBusy(I2C1_BASE));
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
They have tried U2 and U1 unfortunately without success.
FYI: For initialization, they have this code :
SysCtlPeripheralEnable(PORT_PINS_I2C_IOEXP_PERIPH);
GPIOPinConfigure(PIN_SCL_IOEXP_CONFIG);
GPIOPinConfigure(PIN_SDA_IOEXP_CONFIG);
GPIOPinTypeI2CSCL(PORT_PINS_I2C_IOEXP_BASE, PIN_SCL_IOEXP);
GPIOPinTypeI2C(PORT_PINS_I2C_IOEXP_BASE, PIN_SDA_IOEXP);
SysCtlPeripheralEnable(PORT_I2C_IOEXP_PERIPH);
I2CMasterInitExpClk(I2C1_BASE, SysCtlClockFreqSet(SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480,80000000), false);
//clear I2C FIFOs
HWREG(I2C1_BASE + I2C_O_FIFOCTL) = 80008000;
Upon checking the SDA and SCL lines on an oscilloscope, all seems ok (Start, address, ack, data (0x55) etc).
I haven't worked as much with this combination of EXPANDER board plus TM4C LP.
Has anyone else worked at all with the IO EXPANDER + Tiva EVM?
Comments welcomed and appreciated!
TY,
CY