Hi all, What happens if during saving the parameter in byte of EEPROM( it takes about 5-10 msec)the Power Down occurs.What should be in the byte programmed ? The same value/ The next value/ Undetermined? I developed the diesel controller card which uses AT89C51ED2 processor(
2K bytes onchip EEPROM).The system manages failure table for various parameters and in case of failure the appropriate byte in EEPROM is incremented ( counting failures).Each failure counter consists of 2 bytes ( counting up to FFFF).The system may be switched off (Power down) occasionally during programming and this may lead to errors such as: 1) when writing ( incrementing) low order byte (its value is less than FF)and Power Down occurs,I am not sure what this byte will contain after next Power On. 2) when the value in counter is 0x00FF, incrementing means writing 0x00 to low order byte and then writing 0x01 to the high order byte. If Power Down happens after writing the low order byte the system will show error value 0x0000 after next Power On.One solution may be to use checksum on all block of data, and always recalculate the new checksum after each parameter change.If the checksum is not OK I can clear all parameters.I don't like this solution because in case of one error I should clear all the list of failures. Is there any other solution or suggestion how to solve this problem? Thanks! Joseph