-----Original Message----- From: Jinx Date: Mon, 13 Aug 2001 01:32:13 +1200 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: How to reset PIC (without WDT enabled) by the s/w) Perhaps you might check the status register bits for powerup and timeout, and make separate initilization routines depending on whether this is a powerup, a watchdog reset, an MCLR event, or a manual reset, and set things appropriately. alice > > Well, if I could imitate the RESET by "goto 0", I would be glad. > > But there are a few problems: > > > 1) I need to convert my "interrupt thread" into the "main thread", > > is setting of GIE, PEIE... enough to achieve it? > > Unfortunately you know your program flow better than we do so > that's a little hard to answer. Just think of the ISR as just another > routine. The RTI address that will be unresolved by goto 0 from > the ISR will eventually be over-written (if that even matters at all) > > > 2) I should extend my INIT routine so that it sets the initial values > > in all important registers... > > The data book will show the post-reset state of the micro's registers. > These will also be how they will have been set when you power up, > so you're already dealing with that. That leaves just your RAM > locations, which are also dealt with by the program you have now, > so goto 0 doesn't seem to present a problem > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > -- _______________________________________________ FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Talk More, Pay Less with Net2Phone Direct(R), up to 1500 minutes free! http://www.net2phone.com/cgi-bin/link.cgi?143 -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.