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 CCS Technical Support

Do I manually must set RCON register or the compiler do it?

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



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

Do I manually must set RCON register or the compiler do it?
PostPosted: Thu Apr 07, 2016 8:39 am     Reply with quote

My first code line inside Main is

Code:
LastRestart=RESTART_CAUSE();


Do I manually must set RCON register or the compiler do it?

µC is PIC18F67J50, Compiler version is 5.048.
_________________
Electric Blue
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu Apr 07, 2016 9:21 am     Reply with quote

the answer is in the datasheet
go back and READ section

4.1 RCON Register

and your question will be answered.

learn too make the datasheet your primary source and much time will be saved.
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Thu Apr 07, 2016 9:46 am     Reply with quote

I already did it, the datasheet say yes; but since the compiler has some automated function I don't wanna do something that is already handled by the compiler and maybe cause some interference on the program behavior.
_________________
Electric Blue
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu Apr 07, 2016 11:06 am     Reply with quote

look at the .LST file your program generates -
then find any reference to the RCON register address in the listing
to see what the compiler does
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Thu Apr 07, 2016 11:07 am     Reply with quote

Restart-cause does everything. It reads the register, and updates it.
But _big caveat_ some bits in the register change when other things are configured, so restart_cause must be called before any major configuration changes after boot, otherwise the value may be invalid.
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