CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PIC24EP512GP806 - restart_cause() clear cause without reboot

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
benoitstjean



Joined: 30 Oct 2007
Posts: 543
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PIC24EP512GP806 - restart_cause() clear cause without reboot
PostPosted: Fri Feb 15, 2019 1:32 pm     Reply with quote

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: 19222

View user's profile Send private message

PostPosted: Fri Feb 15, 2019 1:55 pm     Reply with quote

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: 543
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Fri Feb 15, 2019 2:16 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group