打印
[DSP编程]

I2C读写EEPROM的问题

[复制链接]
861|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
wangch_sh|  楼主 | 2014-11-11 11:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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,写了个写数据子程序,调用时发现卡住了,位置见上面。
请问高手,哪里有问题?谢谢!

相关帖子

沙发
wangch_sh|  楼主 | 2014-11-11 15:22 | 只看该作者
高手支招啊!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:为江山踏坏了乌骓马,为社稷拉断了宝雕弓。

318

主题

2817

帖子

5

粉丝