Watchdog for MC9S12A128B

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Watchdog for MC9S12A128B

2,254 Views
golf
Contributor I
Hi.
 
Is there any bit indication, which tells me wheter the Reset happened due to Watch dog(COP) or due to some other reasons?
 
Thanks.
0 Kudos
Reply
4 Replies

620 Views
golf
Contributor I
Is there any bit indication, which tells me wheter the Reset happened due to Watchdog(COP) without debuger?
 
Thanks. 
0 Kudos
Reply

620 Views
J2MEJediMaster
Specialist I
There is not bit indication signaling a COP reset that I can tell. For a typical reset, the address vector xFFFE is taken. For a COP reset, the address vector xFFFA is used. As Alban explained, you'd have the COP interrupt handler code do whatever you're trying to accomplish, such as a partial recovery. The different vectors are taken both in debug mode and standalone mode.
 
---Tom
0 Kudos
Reply

620 Views
Alban
Senior Contributor II
Hello,

A different Reset vector is taken.

Up to you to execute different code or set a bit before starting the code again so you can keep trace of which vector was taken.

Cheers,
Alban.
0 Kudos
Reply

620 Views
AndroTec
Contributor I
Hi,

I tried the "different reset vector" strategy:

My *.PRM file contains:
VECTOR 0 _Startup /* reset vector*/
VECTOR 2 _COPStartup /* COP reset vector: called when watchdog has triggered */

Via debugger I see:
00FFF8 FF FF C0 19 FF FF C0 00

0xC019 is the address of _COPStartup(), 0xC000 points to _Startup()


So far so good, but _COPStartup() is never executed. In case of a watchdog timeout, the CPU restarts with _Startup() instead of _COPStartup().

What goes wrong??

Thanks in advance!!
0 Kudos
Reply