Re: 有關W401 ex 6-2c
|
||||
---|---|---|---|---|
新會員
|
Hi byte addr 已加上 問題不在此處
ex6-2.c之101行及123行 EEPROM_ACK(0xA0);刪除 程式就OK 不知未何要在 EEPROM_Write (0xA0,EE_Addr,Rec_Data); 之後加上 EEPROM_ACK(0xA0);
發表於: 2008/6/10 21:06
|
|||
|
Re: 有關W401 ex 6-2c
|
||||
---|---|---|---|---|
高級會員
|
如果是EEPROM的練習,
我記得RTC's APP001 是 24LC02 (2kB) 自己購買's APP001 是 24LC32(32kB) 差別在 送cmd時要多 High byte addr 不知道你是不是遇到這個問題 希望有幫助
發表於: 2008/6/9 13:15
|
|||
|
有關W401 ex 6-2c
|
||||
---|---|---|---|---|
新會員
|
版主 你好:
有關W401 ex 6-2c void EEPROM_ACK(unsigned char ctrl) { int i; IdleI2C(); // ensure module is idle StartI2C(); // Start condition I2C_Done(); // Wait Start condition completed WriteI2C(ctrl); // Write Control to EEPROM (WRITE) I2C_Done(); // Clear SSPIF flag while (SSPCON2bits.ACKSTAT) // { for (i=0;i<100;i++); // Delay for next Repet-Start RestartI2C(); // initiate Repet-Start condition I2C_Done(); // Wait Repet-Start WriteI2C(ctrl); // Write Control to EEPROM (WRITE) } I2C_Done(); // Clear SSPIF flag StopI2C(); // send STOP condition I2C_Done(); // wait until stop condition is over } 執行時一直在第三I2C_Done();跑回圈 請問第二I2C_Done();已將SSPIF clear 如果沒進while 第三I2C_Done();將一直等待SSPIF = 1 這是BUG 嗎?
發表於: 2008/6/8 21:25
|
|||
|