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

Reset PIC Method

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



Joined: 21 May 2015
Posts: 181

View user's profile Send private message

Reset PIC Method
PostPosted: Sun Jul 14, 2019 8:09 am     Reply with quote

Hi,
I would like to know is there is any method to reset PIC by coding ?
Normally people will connect MCLR pin of PIC to ground.

Hope someone can share their ideas or codes.

Thank you
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sun Jul 14, 2019 8:51 am     Reply with quote

I don't know which PIC you're using.

The PIC manual shows a software reset instruction for PIC18(L)F2X/4XK22 type chips, and presumably most others.

There SHOULD be something similar in the CCS manual.

If not use the machine code instruction in assembler.

Mike

PS I found it. The CCS version seems to be reset_cpu().
art



Joined: 21 May 2015
Posts: 181

View user's profile Send private message

PostPosted: Mon Jul 15, 2019 6:00 am     Reply with quote

Thank you mike,

I'm using pic18f4550. I really hope reset_cpu() works.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Mon Jul 15, 2019 6:50 am     Reply with quote

reset_cpu, issues the processor's own reset instruction.
Understand that this gives a different code from 'restart_cause', than
a power on reset (POR).
It also boots quicker than a POR, not giving any oscillator delay (since this
is already running).
Some bits are left unchanged by the reset instruction. For instance
STKFUL and STKUNF are both 'unchanged' by this reset, but are clear
after a POR. Look at the table entitled:

STATUS BITS, THEIR SIGNIFICANCE AND THE INITIALIZATION CONDITION
FOR RCON REGISTER

in the data sheet. This and the next table detail what is reset and what is left
unchanged.
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