Page 1 of 1

[Solved] MCUSR reset register on AtMega

Posted: Sun Dec 04, 2016 5:07 pm
by EtsDriver
A option to get MCUSR register value into flowcode variable before its reset by c-code would be nice. This way program could detect the Brown-Out and restart some other chips that might have locked up...

Re: MCUSR register on AtMega

Posted: Mon Dec 05, 2016 1:15 pm
by Benj
Hello,

This should be possible by doing the following.

1) create a global byte variable named ResetType.
2) Add a C code icon to the start of your program containing the following code.

Code: Select all

FCV_RESETTYPE = MCUSR;
3) Check the bits of the ResetType variable for the various reset conditions you need to check for.