以前からEEPROMの内容が消えてしまうのに悩まされていたんですが、こちらのサイトに解決策が載ってました。これはブラウンアウトリセットが設定されていないと電源ON、OFF時にCPUの動作が不安定化し、EEPROMの内容が消えてしまうことがあるようです。以下のようにフューズビットの設定を変えたところ問題は解決しました。

I have had a problem that the contents of EEPROM evaporate on powering up of the CPU. I found a countermeasure for this problem in a Japanese AVR site. If BOD (brown out detection) level is not set, the operation of CPU may become unstable while powering down and destroy the contents of EEPROM. So I changed fuse bit setting as below to allow brown out reset and the problem is solved.

Set “BODLEVEL” to 4.3V.

BODLEVELの設定を4.3Vにする。


 

 
inserted by FC2 system