Saturday, March 31, 2007

RTC, DS1340

Interface: I2C
Device address: 0b1101000x
SPEC裡說明讀取的部份不是很清楚,
Start == Read Command == Data == ... == Stop
Command: Device address + Read bit.
照著上列順序並沒辦法讀到資料。

在讀取資料前必須先以Write command將欲讀取的位址寫入才可。
Start == Write Command == Data Address

完整的讀取順序:
Start == Write Command == Data Address == Re-Start == Read Command == Data == ... == Stop

Code Reference

No comments: