REM $INCLUDE: '7188.bi' REM $INCLUDE: 'printf.bas' dim i,j,t,k,c,temp as integer ChangeLine$=CHR$(10)+CHR$(13) InitLib ' driver initial Init5DigitLed ' 5-digit LED initial temp = InstallCom(4, 57600, 8, 0, 1) EnableEEP ' enable for write operation temp=print4(ChangeLine$+"Write EEPROM : ") for j=0 to 7 'write initial value to all 2K bytes data temp=print4(ChangeLine$+"writing block="+STR$(j)+ChangeLine$) for i=0 to 255 temp=WriteEEP(j,i,(i+j) AND &HFF) temp=print4(ChangeLine$+"addr=("+STR$(j)+","+STR$(i)+"),data="+STR$((i+j) AND &Hff)) next i next j temp=print4(ChangeLine$) ProtectEEP ' protect data in EEPROM for k=0 to 255 if (i=0) then LedOn else LedOff endif temp=print4(ChangeLine$+"Read EEPROM : address="+STR$(k)+"("+HEX$(k)+") data in block 0-7=") for j=0 to 7 t=ReadEEP(j,k) ' read back EEPROM for check temp=print4(HEX$(t)+" ") next j Delay(200) ' delay 0.2 sec waitkey: temp=IsCom(4) if temp<>0 then c=ReadCom(4) if c=ASC("q") OR c=ASC("Q") then exit for temp=print4("("+CHR$(c)+")") end if next k temp=RestoreCom(4)