Hi,
I plan to use Atmega328P in product where the device is running on a pair of AA cells and sleeping most of the time.
I am leaving BOD enabled in fuse bits, but to save power, I intend to disable BOD before going to sleep. As per datasheet, BOD is needed for flash and EEPROM corruption prevention. However, I am never going to write to flash and I can detect battery voltage via a pin and avoid writing to EEPROM (my app does write to EEPROM) if voltage is lower.
During sleep state the voltage would fall very slowly and the brown out condition will not arise. During the active state the voltage will fall faster, if brown out occurs, since BOD is active, it will reset the processor and the system will never boot now till the batteries are replaced leaving the EEPROM contents intact.
Is there any way flash can get corrupted in this scenario?
Also before going to sleep if I disable BOD then what happens if reset is pressed (without removing power), is BOD active or not ?
Thanks and Regards,
WonderfulIOT