I'm having problems with my uno sketch running for extended periods and I suspect that brownouts might be the problem. However my attempts to monitor the MCU Status Register are not working.
Checking the IDE Brown out detection is on by default so I should be able to find out if this is a problem
Ive added the following into the loop
_mcusr = MCUSR && 0x0F;
Serial.println ((int)_mcusr);
if (_mcusr && B00000100) client.println("Brown out");
.....
Which compiles ok but I'm when I press the reset button to test that I'm actually reading the MCUSR I get the following or something similar
0
0
0
þ0 <<Reset pressed here
0
0
0
The character output is always an accented character above ASCII 128! Despite the && 0x0F filters etc
From my reading of the 328P data sheet it implies that the MCUSR only clears on a power on reset
which I have not done, yet it is being cleared.
This does not bode well for detecting the Brown out problem.
Suggestions would be welcome