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 instruction Vs normal power up

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

View user's profile Send private message

Reset instruction Vs normal power up
PostPosted: Tue Apr 03, 2018 10:04 am     Reply with quote

I have a program running on a PIC18F67J50.

This program receive instructions from UART1 and one of those instructions it starts a software reset.

Before perform the reset I'm saving some variables to an SPI EEPROM and set all the general purpose RAM to zero.
The special register are not changed by my program in any way.

I also clean all the GPRs as soon as the main() starts.

The program runs ok if start from a normal power up but doesn't work as expected after a soft reset or MCLR reset.
Things, like USB CDC doesn't work at all.

I read the datasheet and some special registers remains unchanged on all resets except by POR or BOR.
Can be that the difference?
Any idea about what look for?
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Wed Apr 04, 2018 2:16 am     Reply with quote

The reset instruction is a hardware reset, So is MCLR. Some bits are 'undefined' after these, but these are generally bits that are 'indeterminate' at power on. The exceptions are only the handful of bits in the RCON register. It should function the same. The obvious likely difference is that the other hardware attached, won't have reset. So if (for instance) you have a peripheral chip that you initialise, from a power on reset this will be starting in a 'reset' state, while from a MCLR/soft reset this will already be initialised. You need to look at how you perform your initialisation of every external device, and whether this will work from a warm start.
E_Blue



Joined: 13 Apr 2011
Posts: 403

View user's profile Send private message

PostPosted: Wed Apr 04, 2018 8:45 am     Reply with quote

Thanks for your answer.
I have a GPS and a modem which I turn off with a P MOSFET(high side).
Also I have an SPI EEPROM and an SPI Flash(SPI bus shared) and two one wire temperature sensors.

Now I have noticed that when I shut off the GPS and the modem modules I have 3.27V from TX RX UART, so I changed the program to turn off the UARTs when they are being turned off so I do not have any current flowing to a shuttered module.
_________________
Electric Blue
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