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.

请教28335 I2C FIFO的发送机制



①对eeprom写入数据的时候,数据固话需要等待一段时间,当对eeprom从某一地址开始写入N个数据的时候,当一个字节的8位数据写完之后在下一位(第9位)立刻产生一个应答位(这样立马进行读操作的时候,数据就会没有固化完毕),或者是eeprom等待数据固化之后,再进行应答,这样就不是第9位了。

②主发模式下,写数据,发送FIFO是在一个数据发送完毕之后等待应答位的到来再发送FIFO的下一个数据么?

3、28335的 “i2c_eeprom" 例子

while(I2CA_ReadData(&I2cMsgIn1) != I2C_SUCCESS)
{
// Maybe setup an attempt counter to break an infinite while
// loop. The EEPROM will send back a NACK while it is performing
// a write operation. Even though the write communique is
// complete at this point, the EEPROM could still be busy
// programming the data. Therefore, multiple attempts are
// necessary.
}

这句话的目的不是很理解

在执行Uint16 I2CA_WriteData(struct I2CMSG *msg) 函数的时候就已经  return I2C_SUCCESS;

为什么还需要这个循环

  • 你好,按我的理解是EEPROM是在它的接收寄存器接收完8bit的数据后,在第九位产生一个应答位,EEPROM不是接收完一bit的数据后就马上烧写,而是接收完一个字节的数据后才开始烧写,所以发送应答位的时候还没有开始烧写。

  • 在FIFO模式下,先配置FIFO中的数据,配置完成后开始自动传输FIFO中的数据。设置FIFO中断,会在FIFO中的所有数据发送完之后产生一个FIFO中断。

  • 之前返回的 I2C_SUCCESS是 I2CA_WriteData的返回值,while(I2CA_ReadData(&I2cMsgIn1) != I2C_SUCCESS)验证的是I2CA_ReadData的返回值。