" Caution: An interrupt between step 5 and step 6 will make the write cycle fail, since the EEPROM Master Write Enable will time-out. If an interrupt routine accessing the EEPROM is interrupting another EEPROM access, the EEAR or EEDR Register will be modified, causing the interrupted EEPROM access to fail. It is recommended to have the global interrupt flag cleared during the four last steps to avoid these problems."
SZ> äÁ É ×ÏÏÂÝÅ × ÍÉÒÅ, Á ÔÅÍ ÂÏÌÅÅ × ÏÂÌÁÓÔÉ SZ> embedded, ÍÁÌÏ ÒÅÛÅÎÉÊ, ËÏÔÏÒÙÅ ÂÙÌÉ ÂÙ ×ÅÒÎÙÍÉ "ÁÂÓÏÌÀÔÎÏ".
SZ> ôÕÔ ÏÂÎÁÒÕÖÉÌ, ÞÔÏ IAR C for AVR 2.28 ÐÒÉ ×ÈÏÄÅ × ÐÒÅÒÙ×ÁÎÉÅ SZ> ÎÅ ÓÏÈÒÁÎÑÅÔ EEAR, EEDR, ÅÓÌÉ ÉÈ ÐÏÒÔÉÔ. ðÏÓÍÏÔÒÅÌ SZ> ÉÓÈÏÄÎÉËÉ __eeput, __eeget - ÔÁÍ ÐÒÉ ÚÁÐÉÓÉ É ÞÔÅÎÉÉ EEPROM SZ> ÚÁÐÒÅÝÅÎÉÑ ÐÒÅÒÙ×ÁÎÉÑ ÎÅÔ. ðÏÌÕÞÁÅÔÓÑ, ÞÔÏ × ÐÒÅÒÙ×ÁÎÉÉ SZ> ÐÏÌØÚÏ×ÁÔØÓÑ ÐÅÒÅÍÅÎÙÍÉ, ÏÂßÑ×ÌÅÎÎÙÍÉ __eeprom, ÎÅÌØÚÑ, ÎÕ SZ> ÉÌÉ ×ÒÕÞÎÕÀ ÉÚ×ÒÁÝÁÔØÓÑ Ó ÓÏÈÒÁÎÅÎÉÅÍ ËÏÎÔÅËÓÔÁ. SZ> äÏ×ÏÌØÎÏ ËÏ×ÁÒÎÏ. üÔÏ ÂÁÇ ÉÌÉ ÆÉÞÁ? Protecting the eeprom write mechanism A typical example of when it can be necessary to use the __monitor keyword is when protecting the eeprom write mechanism, which can be used from two threads (for example, main code and interrupts). Servicing an interrupt during an EEPROM write sequence can in many cases corrupt the written data.