Is the M324's eeprom known to have the same issues as M32? As in, forgetting the value in eeprom address zero at random intervals, particularly at low voltages?
I have the following code:
char engine_type __attribute__ ((section(".eeprom"))); char display_mode[4] __attribute__ ((section(".eeprom")));
as the first and only definitions to the eeprom. Elsewhere, my code compares engine_type for a sane value and resets display_mode to sane values if it doesn't find them.
In the previous version, (M32 at 3.3v) I used the brownout detector at 2.7v to keep the chip in reset until the power got happy and that made the issue go away.
I find I have accidentally programmed a couple of M324 units with the BOD disabled; one worked fine for a week and then reset itself today and one reset itself every time it is turned on.
Ho hum...
Neil