[Solved] MCUSR reset register on AtMega
Moderator: Benj
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
[Solved] MCUSR reset register on AtMega
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...
Ill just keep the good work up!
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: MCUSR register on AtMega
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.
3) Check the bits of the ResetType variable for the various reset conditions you need to check for.
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;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel