Browsing this Thread:
2 Anonymous Users
|
有關W401 ex 6-2c
|
|
新會員
Joined
: 2006/2/4 23:50 最後登入時間
: 2009/10/23 15:49
Group:
註冊會員
Level : 3 HP : 0 / 52 MP : 6 / 2851 EXP : 9
|
版主 你好:<br />有關W401 ex 6-2c <br />void EEPROM_ACK(unsigned char ctrl)<br />{<br /> int i;<br /> IdleI2C(); // ensure module is idle<br /> StartI2C(); // Start condition<br /> I2C_Done(); // Wait Start condition completed<br /> WriteI2C(ctrl); // Write Control to EEPROM (WRITE)<br /> I2C_Done(); // Clear SSPIF flag<br /> while (SSPCON2bits.ACKSTAT) // <br /> {<br /> for (i=0;i<100;i++); // Delay for next Repet-Start<br /> RestartI2C(); // initiate Repet-Start condition<br /> I2C_Done(); // Wait Repet-Start<br /> WriteI2C(ctrl); // Write Control to EEPROM (WRITE)<br /> }<br /> I2C_Done(); // Clear SSPIF flag <br /> StopI2C(); // send STOP condition<br /> I2C_Done(); // wait until stop condition is over <br />}<br /><br />執行時一直在第三I2C_Done();跑回圈<br />請問第二I2C_Done();已將SSPIF clear<br />如果沒進while<br />第三I2C_Done();將一直等待SSPIF = 1<br /> 這是BUG 嗎?
發表於: 2008/6/8 21:23
|
|
You can view topic.
你 不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.