I think something like that have to work
Code:
<font color="#000000">Address <font color="#000080">VAR WORD
</font>OldAddress <font color="#000080">VAR WORD
</font>ControlByte <font color="#000080">VAR BYTE
</font>Block0 <font color="#000080">CON </font>%10100000
Block1 <font color="#000080">CON </font>%10101000
Address=0
ControlByte = Block0
Start:
<font color="#000080">I2CWRITE </font>SDA, SCL, ControlByte, Address, [0]
<font color="#000080">PAUSE </font>10
OldAddress = Address
Address = Address + 1
<font color="#000080">IF </font>Address<OldAddress <font color="#000080">THEN </font><font color="#008000">' Overflow?
' ---- YES
</font><font color="#000080">IF </font>ControlByte=Block0 <font color="#000080">THEN </font><font color="#008000">' Are we in Block0?
' ---- YES
</font>ControlByte=Block1 <font color="#008000">' Switch To Block1
</font>Address = 0 <font color="#008000">' Start at first address
</font><font color="#000080">ELSE </font><font color="#008000">' ---- NO
</font><font color="#000080">STOP </font><font color="#008000">' EEPROM is full..
</font><font color="#000080">ENDIF </font><font color="#008000">'
</font><font color="#000080">ENDIF
GOTO </font>Start
Now you just need to keep track of ControlByte and Address values.
HTH
Bookmarks