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

do not reset outputs after reset

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



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

do not reset outputs after reset
PostPosted: Wed Jun 13, 2012 1:16 am     Reply with quote

Hi,
I wonder if there is anyway to keep outputs in the same state as before reset when I reset the pic?

Thnx
_________________
Help "d" others and then you shell receive some help from "d" others.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Wed Jun 13, 2012 1:33 am     Reply with quote

Without external hardware latches, no there isn't. During hardware reset all IO become inputs, and need to be set to outputs by code.

Its good practice to use pull-ups or -downs as appropiate (historically it was pull-ups) on all outputs that have to have a defined state during reset/start-up. That's not the same as keeping the last state they had, which requires hardware latches.

Whether warm restarts, in other words resets triggered from code, do the same is another issue. Generally warm starts are much shorter than hardware resets, as the PIC doesn't have to wait for things like the oscillator to start and stabilise.

My main question is: why do you want to hold output states over resets? Do you really need to reset? Is this the best system solution to the problem? What, in fact, is the problem you are trying to solve?

RF Developer
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Wed Jun 13, 2012 2:15 am     Reply with quote

thnx mate,
it is simple, I want to have a choice and if my hardware is running big few KW motor it is not very healthy to reset outputs in case of WDT kicking on. Thnx for the answer, helped a lot.
_________________
Help "d" others and then you shell receive some help from "d" others.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Wed Jun 13, 2012 2:44 am     Reply with quote

If your watchdog timed out and reset the processor, which would have to be an extreme and unlikely event due to serious failure of the PIC, I'd expect everything to shutdown to a safe state: i.e. all motor drives shut off, all brakes engaged, alarm lights etc on. These are the sorts of "defined states" i'd ensure in reset.

Otherwise I'd want the PIC to be controlling that sort of hardware at all times, therefore it must not reset and you should make sure your hardware and software ensures it stays running!

All this is simply good engineering practice and is not something specific to PICs.

RF Developer
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