I am trying to interface a Tiva C TM4C1294 (master) with a MCP23017 I/O expander (slave) configured as input. However, I am not reading in the inputs that I want it to but instead I am seeing the following messages on the I2C bus which cycle through the following 5 states roughly 1 seconds apart with all inputs open.
I have copied and pasted my master receive code below. Please let me know what I am doing wrong.
//
// Specify slave address for recieve
//
I2CMasterSlaveAddrSet(I2C7_BASE, address, true);
//
// Initiate recieve of character from Slave to Master
//
I2CMasterControl(I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START);
//
// Wait for recieve to begin
//
while(!I2CMasterBusy(I2C7_BASE));
//
// Delay until recieve completes
//
while(I2CMasterBusy(I2C7_BASE));
//
// Get the character that was recieved in the data register
//
data[0] = I2CMasterDataGet(I2C7_BASE);
//
// Initiate recieve of character from Slave to Master
//
I2CMasterControl(I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
//
// Wait for recieve to begin
//
while(!I2CMasterBusy(I2C7_BASE));
//
// Delay until recieve completes
//
while(I2CMasterBusy(I2C7_BASE));
//
// Get the character that was recieved in the data register
//
data[1] = I2CMasterDataGet(I2C7_BASE);
Thank you,
Andrew