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.

I2C读写EEPROM的问题



void Write_Sram(Uint16 addr,Uint16 data)
{
I2C_start();
while (!I2C_xrdy());
I2C_writeByte(0xDE);          //写器件地址
while (!I2C_xrdy());
I2C_writeByte(0x00);          //写高位地址
while (!I2C_xrdy());                 //卡在这儿啦
I2C_writeByte(addr);         //写低位地址
while (!I2C_xrdy());
I2C_writeByte(data);           //写数据
I2C_sendStop();

delay(5000);
}

我用I2C读写EEPROM,写了个写数据子程序,调用时发现卡住了,位置见上面。

请问高手,哪里有问题?谢谢!