View previous topic :: View next topic |
Author |
Message |
benoitstjean
Joined: 30 Oct 2007 Posts: 566 Location: Ottawa, Ontario, Canada
|
PIC24EP512GP806 - restart_cause() clear cause without reboot |
Posted: Fri Feb 15, 2019 1:32 pm |
|
|
Device: PIC24EP512GP806
Compiler: IDE 5.071, PCB/M/H/D 5.026 (hald-assed to circumvent bugs!)
Hi guys,
How does the internal restart cause get cleared other than by rebooting the MCU?
I can read it using <restart_cause()> but how do I reset it? Or can it even be done?
Thanks!
Ben |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Fri Feb 15, 2019 1:55 pm |
|
|
When you read it, the bits in the RCON register are reset by the read.
Some others are affected by things that program things that can cause
a restart. This is why reading should always be near the start of the main
or bits can get changed. |
|
|
benoitstjean
Joined: 30 Oct 2007 Posts: 566 Location: Ottawa, Ontario, Canada
|
|
Posted: Fri Feb 15, 2019 2:16 pm |
|
|
Thanks! Do you sleep sometimes, TTelmah? ah! ah!
That's what I figured - that I had to read it - but just thought I'd check. I was able to get the code to do what I wanted.
Thanks and have a nice week-end!
Benoit |
|
|
|