使用下面的代码对AT32C256 EEPROM读取数据,发现在第二次start信号前多发了stop信号,但是数据貌似也读出来了没问题。如何能不让这个stop信号产生?
uint8_t RX_Data_Master[10]={0xaa,0xbb};
/* wait until MST bit gets cleared, this takes
* few cycles after Bus Busy is cleared */
// while(i2cIsMasterReady(i2cREG1) != true);
/* Configure address of Slave to talk to */
i2cSetSlaveAdd(i2cREG1, SLA_ADDR);
/* Set direction to Transmitter */
/* Note: Optional - It is done in Init */
i2cSetDirection(i2cREG1, I2C_TRANSMITTER);
/* Configure Data count */
/* Slave address + Word address write operation before reading */
i2cSetCount(i2cREG1, 2);
/* Set mode as Master */
i2cSetMode(i2cREG1, I2C_MASTER);
/* Set Stop after programmed Count */
i2cSetStop(i2cREG1);
/* Transmit Start Condition */
i2cSetStart(i2cREG1);
/* Send the Word Address */
i2cSendByte(i2cREG1, 0x00);
i2cSendByte(i2cREG1, 0x10);
/* Wait until Bus Busy is cleared */
while(i2cIsBusBusy(i2cREG1) == true);
/* Wait until Stop is detected */
while(i2cIsStopDetected(i2cREG1) == 0);
/* Clear the Stop condition */
i2cClearSCD(i2cREG1);
/*****************************************/
/*****************************************/
/* wait until MST bit gets cleared, this takes
* few cycles after Bus Busy is cleared */
while(i2cIsMasterReady(i2cREG1) != true);
/* Configure address of Slave to talk to */
i2cSetSlaveAdd(i2cREG1, SLA_ADDR);
/* Set direction to receiver */
i2cSetDirection(i2cREG1, I2C_RECEIVER);
/* Configure Data count */
/* Note: Optional - It is done in Init, unless user want to change */
i2cSetCount(i2cREG1, 5);
/* Set mode as Master */
i2cSetMode(i2cREG1, I2C_MASTER);
/* Set Stop after programmed Count */
/* Transmit Start Condition */
i2cSetStart(i2cREG1);
/* Tranmit DATA_COUNT number of data in Polling mode */
i2cReceive(i2cREG1, 5, RX_Data_Master);
i2cSetStop(i2cREG1);
/* Wait until Bus Busy is cleared */
while(i2cIsBusBusy(i2cREG1) == true);
/* Wait until Stop is detected */
while(i2cIsStopDetected(i2cREG1) == 0);
/* Clear the Stop condition */
i2cClearSCD(i2cREG1);


