This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Delay required between repeated IIC reads

Hello,

TIVA microcontroller is Master and the Slave is connected by 1/2 meter RJ-25 cable.

TIVA reads continuously from the slave.

The Issue is that :

There is a considerable amount of delay of around  15 ms that is required to put in between 2 consecutive reads.

Is this amount of delay ok as per this IIC connection of master n slave ?

And if Delay in NOT put then, same value is read as in previous read operation by IIC read API.

 

Here is my code:

 

int buff[256] = 0;
ROM_I2CMasterEnable(I2C8_BASE);
ROM_I2CMasterInitExpClk(I2C8_BASE,SysCtlClockGet(),false); // IIC will use system clock for iic communication.
ROM_I2CMasterSlaveAddrSet(I2C8_BASE,0x30,true); // Master initiating a read from slave.

while( I2CMasterBusy(I2C8_BASE) );
ROM_I2CMasterControl(I2C8_BASE,I2C_MASTER_CMD_BURST_RECEIVE_START);
while( I2CMasterBusy(I2C8_BASE) );
onemillisecdelay(); // 7.5 ms delay
onemillisecdelay(); // 7.5 ms delay
buff[0] = ROM_I2CMasterDataGet(I2C8_BASE);
UARTprintf("\nThe buffer received is %x\n",buff[0]);
onemillisecdelay();
for(i = 1; i < 256 ;i++)
{
while( I2CMasterBusy(I2C8_BASE) );
onemillisecdelay(); // 7.5 ms delay
onemillisecdelay(); // 7.5 ms delay
ROM_I2CMasterControl(I2C8_BASE,I2C_MASTER_CMD_BURST_RECEIVE_CONT);
while( I2CMasterBusy(I2C8_BASE) );

if(I2C_MASTER_ERR_NONE == ROM_I2CMasterErr(I2C8_BASE) )
{
buff[i] = ROM_I2CMasterDataGet(I2C8_BASE);
}
else
buff[i] = -1;
}
while( I2CMasterBusy(I2C8_BASE) );
ROM_I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
while( I2CMasterBusy(I2C8_BASE) );

buff[i] = ROM_I2CMasterDataGet(I2C8_BASE);
while(1)
{
//loop forever...
}

Please suggest .

Thanks,

Sanchit Mehra