You are on page 1of 1

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:
ld a,65 ; just some data..

ld (EErom),a ; write data to EEprom


ld b,a ; save ok written data.
poll: ld a,(EErom) ; read data from EEprom
cp b ; compare read with written
jp nz,poll ; if Not Equal read again.
next:

You could also use the instruction "CP (HL)" this will speed up, like this:

ld a,65 ; just some data..


ld hl,EEprom ; HL point to EEprom location,

ld (HL),a ; write data to EEprom


poll: cp (HL) ; compare read with written, (a reg)
jp nz,poll ; if Not Equal read again.
next:

You might also like