Searching \ for '[PIC] register state 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/microchip/devices.htm?key=pic
Search entire site for: 'register state after WDT'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] register state after WDT'
2005\11\04@094103 by toftat

flavicon
face
Well folks, my frontpanel code has finally ticked me off to the point
where I need to debug it, unfortunatly I don't have a fancy in-circuit
debugger, and I think the problems lies with receiving serial data (which
simulators seem to emulate universally poorly)

I want to use the WDT to "reign in" the wayward handler, and I'd like to
use a flag to indicate where it was. Will this flag be available after the
WDT reset? The data sheet doesn't mention what happens except that
STATUS:4 will be cleared when it is reinitialized. I would like to use
that bit, to write the point of error into EEPROM so I can find out what
is happening.

Will this work?

2005\11\06@074137 by Andrew Warren

face
flavicon
face
toftat@cowshed.us <spam_OUTpiclistTakeThisOuTspammit.edu> wrote:

> I don't have a fancy in-circuit debugger, and I think the problems
> lies with receiving serial data (which simulators seem to emulate
> universally poorly)
>
> I want to use the WDT to "reign in" the wayward handler, and I'd like
> to use a flag to indicate where it was. Will this flag be available
> after the WDT reset?

Yes, but there's no reason for the watchdog timer to expire and
trigger the reset anywhere near the error in your code; the reset is
likely to happen long after the error, so you may not get much
information from it.

If you have an oscilloscope (digital or analog storage preferred, but
not absolutely required), you'd probably have more luck tracking the
progress of the PIC by toggling I/O pins on and off at strategically-
located points in the code.

If you don't have a scope, Microchip's simulator -- although
moderately painful to configure -- IS actually pretty good.

Of course, if you're using the WDT to "fix" the problem rather than
debug it, the coarse program-counter info you'd get from your method
will probably be fine.

-Andrew

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com

2005\11\06@160811 by Anthony Toft

flavicon
face
> Yes, but there's no reason for the watchdog timer to expire and
> trigger the reset anywhere near the error in your code; the reset is

No, but if I put the CLRWDT in my wait loop I can at least see where in
the code it got, I have a suspicion that it gets into an endless loop
somewhere (although it shouldn't) and if I can use it to narrow down my
search then I can make my job easier.

> not absolutely required), you'd probably have more luck tracking the
> progress of the PIC by toggling I/O pins on and off at strategically-
> located points in the code.

This too is a plan, but I'd like to track out where to start toggling
first.

> If you don't have a scope, Microchip's simulator -- although
> moderately painful to configure -- IS actually pretty good.

I have tried, but they don't simulate the usart, and I am almost certain
it is handling a RCIF where the troubles start.

--
Anthony Toft <toftatspamKILLspamcowshed.us>
    I'm Anton, and I approve this message

2005\11\06@162709 by olin piclist

face picon face
Anthony Toft wrote:
> I have tried, but they don't simulate the usart, and I am almost certain
> it is handling a RCIF where the troubles start.

I thought the new version did simulate the UART.  However, I've debugged a
lot of UART code with earlier versions that didn't simulate it directly.
It's really not that hard.  You can manually set the flag bits and
registers, then see how your code responds.  Once the low level code that
deals with the hardware is debugged, you can feed bytes into the rest of the
logic one at a time.  Set a breakpoint in the routine that gets a byte from
the UART and feed it one manually instead.  It's really not all that hard.

You can't expect everything to be on a silver platter.  Instead of saying
the tools can't do something, think of how to use the tools you do have to
do what you need in the end.


******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014.  #1 PIC
consultant in 2004 program year.  http://www.embedinc.com/products

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