/* Eeprom-w: 1. Writting a value to EEPROM. 2. The value will auto-plus 1 when it's writted to next address. Compiler: MSC 6.0, MSVC 1.52. Compile mode: Large Project: Eeprom-w.c ..\lib\7188el.lib Hordware: 7188E with EEPROM Detail description: Following list is where the user should avoid to write to For 7188XA/B/C ==> block 7 For 7188E(Xserver) ==> block 0, 7 For 7188E-MTCP ==> block 0,1,2,3,7 For 8x1x ==> block 7 For 8x3x (Xserver) ==> block 0,7 For 8000E-MTCP ==> block 0,1,2,3,7 [30,Jan,2007] by Liam [Aug,4,2011] by Nicholas */ #include #include #include #include #include #include "..\..\lib\7188e.h" void main(void) { int i, j, addr=0, block, data; char buf[100]; Print("Warning:The block of 0 address is used by system\n"); Print("\r\nPLease insert a value writting to 1 block of EEPROM only:"); LineInput(buf, 99); sscanf(buf, "%d", &data); EE_WriteEnable(); while(addr<256) { WriteEEP(1, addr, data); Print("\rWritting the value %d to address %d of EEPROM\n", data, addr); addr=addr++, data=data++; } EE_WriteProtect(); }