Q-34:EEprom data polling, how does it work? Thomas Scherrer: After writing to EEprom it will internaly save the data in its cells, this take from about 1 - 40 mSecs. Then you keep reading from that address last written to, and when Read-data that is EQUAL to the data you wrote then you are ready to proceed to the next address location.. Examble:
poll:
ld
a,65
; just some data..
ld ld ld cp jp
(EErom),a b,a a,(EErom) b nz,poll
; ; ; ; ;
write data to EEprom save ok written data. read data from EEprom compare read with written if Not Equal read again.
next: You could also use the instruction "CP (HL)" this will speed up, like this:
poll: next:
ld ld
a,65 hl,EEprom
; just some data.. ; HL point to EEprom location,
ld cp jp
(HL),a (HL) nz,poll
; write data to EEprom ; compare read with written, (a reg) ; if Not Equal read again.