Searching \ for 'Stack after WDT' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=stack+after+wdt
Search entire site for: 'Stack after WDT'.

Truncated match.
PICList Thread
'Stack after WDT'
1999\10\18@055751 by Dr. Imre Bartfai

flavicon
face
Hi Piclisters,

I have a maybe silly question, but I did not found any answer in the
manuals. The question:

does the watchdog reset clean up the PIC return stack or not?

Thank you,

Imre

1999\10\18@085216 by paulb

flavicon
face
Dr. Imre Bartfai wrote:

> I have a maybe silly question, but I did not found any answer in the
> manuals. The question:
> Does the watchdog reset clean up the PIC return stack or not?

 Yeah, considering the operation of the PIC stack, the question is a
trifle silly.

   AFAIK or at least I *presume* it resets the internal stack pointer,
but doesn't clear the registers.  But one must ask: Why would it ever
matter?

 The stack is circular, and if you ever perform more RETURNS than you
have CALLed, you will be "doing a Star Trek".
--
 Cheers,
       Paul B.

1999\10\18@163511 by Jose Souto

flavicon
face
You will never need to clean it up. Just use it.
If it's 12 bit core for example use it two calls deep.
:-)
JSouto

"Dr. Imre Bartfai" wrote:

{Quote hidden}

1999\10\18@202629 by gdaniel

flavicon
face
Hi Imre,
when the watchdog resets the chip then you will visit the *reset
address*    If you then do a "return" then it is most uncertain where
you will return to, if you push an address on to the stack with a "call"
then there is, as usual, no problem.
If you keep calling the same address without returning:

silly_loop    call    silly_loop
+triggers watchdog
+restarts at defined reset location.
+as stack is hardware stack only, no important ram locations have been
overwritten by repeat "call"s

regards,
Graham Daniel.


"Dr. Imre Bartfai" wrote:

{Quote hidden}

1999\10\19@041426 by Dr. Imre Bartfai

flavicon
face
On Mon, 18 Oct 1999, Paul B. Webster VK2BZC wrote:

> Dr. Imre Bartfai wrote:
>
> > I have a maybe silly question, but I did not found any answer in the
> > manuals. The question:
> > Does the watchdog reset clean up the PIC return stack or not?
>
>   Yeah, considering the operation of the PIC stack, the question is a
> trifle silly.
>
>     AFAIK or at least I *presume* it resets the internal stack pointer,
> but doesn't clear the registers.  But one must ask: Why would it ever
> matter?

Here is the background:

I'm programming in PIC BASIC Pro. At a particular point of program, I need
to reset the processor completely. I tought, a simple Jmp $ would do it.
However, it is tedious to implement it in Basic as it inserts the
necessary ClrWdt instrucions wherever it fits. So far, so good, I'll do in
in inline assembly. However, it is possible only CALL an assembly label, a
GOTO or equivalent is not allowed. And that was the question:

CALL    Reset
.
.
ASM
_Reset  Jmp     _Reset

causes a WDT reset, indeed. However, I do more CALLs such way then RETURNs
(exactly the opposite you write). So, I can achieve a stack overflow
- if I repeat this process and
- WDT does not clean up the stack

That is why I asked.

Regards,
Imre

>
>   The stack is circular, and if you ever perform more RETURNS than you
> have CALLed, you will be "doing a Star Trek".
> --
>   Cheers,
>         Paul B.
>
>

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...