|
|
| Author |
Message |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 10 March 2006, 3:54 AM Post subject: System Reset cause-codes - how-to? |
|
|
what am I as a noob doing wrong here?
This code prints out zero, as does a power-on reset.
| Code: |
sub main()
console.writeline ("Reset cause: " & cstr(Register.ResetFlags) )
OpenWatchDog(6) ' arg is 16.384 mSec x 2 to the nth power, n=parameter value
end sub
|
|
|
| Back to top |
|
 |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 10 March 2006, 5:02 AM Post subject: |
|
|
Yes there seems to be a problem here.
If you replace Register.ResetFlags by Register.MCUCSR, I think you achieve the same result. I get a 0x1 for power on, 0x11 for external reset and 0x1011 for the watchdog. |
|
| Back to top |
|
 |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 10 March 2006, 17:35 PM Post subject: |
|
|
OK.
Minor problem. |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 19 March 2006, 19:38 PM Post subject: |
|
|
A Firmware Update has been posted that resolves this problem.
It should be noted that at boot time, the reset flags in the MCUCSR register will be copied to Register.ResetFlags and then the reset flags are cleared from MCUCSR. This strategy is necessary since the existing reset flags are not cleared when the processor resets. |
|
| Back to top |
|
 |
|