MCF52233 - How to turn on Watchfdog timer - using Nichelite stack

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

MCF52233 - How to turn on Watchfdog timer - using Nichelite stack

441 Views
TVNAIDU
Contributor III

Need badly how to turn ON watchdog timer in 52233 demo board. Currently I get board hangup - I need to reset board automatcically , appreciated.

Labels (1)
0 Kudos
1 Reply

273 Views
TomE
Specialist II

This chip has a very simple watchdog. The Reference Manual makes it clear how to use it.

 

Just write a byte to CWCR to enable the watchdog to reset the CPU after an appropriate timeout (between 2^9 and 2^31 bus clocks), and then regularly write the required values to CWSR from some appropriate execution path in your code.

 

When the Watchdog triggers you'll lose all ability to find out what went wrong. I usually set up a hardware watchdog and also a software one (spare timer casuing an NMI) set to trip before the hardware one does that prints where it interrupted the mainline and that the hardware watchdog is about to trigger.

 

The fact that the last reset was caused by the watchdog is available in the RSR. You should check this on startup and do something sensible (like count it in EEPROM) if the last reset was caused by the watchdog.

 

Tom

 

0 Kudos