The EEPROM is often used in project development, and now lists the pitfalls and their own solutions that have been encountered in their own development. (1) Phenomenon: The ID of the encrypted remote control is automatically lost and changed.
Cause: During the update of the EEPROM, disconnect the power supply.
Workaround:
A. Change the design to avoid disconnecting the power supply during writing to the EEPROM;
B. Increase the capacitance of 100uF, the instantaneous maintenance of the EEPROM power supply normal to the EEPROM write completion.
(2) Phenomenon: The configuration information stored in the EEPROM is changed automatically.
Cause: In the EEPROM read and write process into the Interrupt service program, and interrupt service program also called the EEPROM read and write function.
Workaround:
A. The first sentence guaranteeing the EEPROM read and write function is the CLI (), and the last sentence is Sei ();
B. The interrupt service program does not call the EEPROM read-write function directly, if the SRAM is large enough to use the read-write buffer instead of the direct read/write EEPROM, the interrupt returns the EEPROM in the main loop;
C. If the EEPROM is detected to be occupied, then go into a blocking state, wait for the EEPROM to be released after the execution;
D. If the data length in the EEPROM is greater than the EEPROM minimum storage unit, it must be guaranteed that the data is read and written without interruption.
(3) Phenomenon: The EEPROM data is occasionally lost when a power outage occurs suddenly. Cause: In the case of a power outage, the EEPROM write operation happens.
Solution: Increase the capacity of the power filter capacitance, add voltage detection function, when the voltage is low, the EEPROM write operation is forbidden.
(4) Phenomenon: When high-power AC or DC motor start or after the EEPROM data automatically lost or changed.
Cause: EMI interference is large in high-power motor starting or disconnecting moment.
Workaround:
A. Avoid reading and writing EEPROM at these times.
B. If you cannot avoid these times, start the EEPROM write protection feature, and save multiple copies of each data.
C. Keep signal lines such as EEPROM and EEPROM dat,clk away from elements that may cause interference, and avoid forming large loops.
D. Use EMI suppression circuitry to reduce interference amplitude
Common pitfalls of EEPROM read and write operations