I have found a problem on some devices I have with ATmega48PA. I have to copy a flash variable to EEPROM memory everytime I reset the device, but sometimes the lower bits are written to 0xFF. The only solution I have found is to disconnect AVcc pin from V+. In this case it works properly but it is not the best solution I think.
I have also tried different solutions without good results:
- To add L-C filter to AVcc.
- To add 100nF cap to V+ and GND.
- To add 100nF cap to Aref and GND.
- To add a regulator to V+.
This problem happens only in some devices and not always. And the devices are powered by a 6V battery.
Could you help me solving this issue, please?
Thanks in advance.