Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre
Electronic,  Microprocessor,  Mircro Controller and PC  based Projects / Circuits for Engineering Students, Hobbyiest and R&D persons

MICROCONTROLLER TUTORIALS
DALLAS 80C320

Tutorials

 

Circuits

DS80C320

Introduction

Chapter 1
New Instruction Speed

Chapter 2
Dual Data Pointer

Chapter 3
Watchdog

Chapter 4
Power Failure Functions

Chapter 5
Secondary Serial Port

Chapter 6
Timed Access Protection

 

Products

Google
 
Web Hobbyprojects.com

Dallas 80C320 / DS80C320
Kicking the Watchdog

Kicking The Watchdog

As has been explained, the watchdog will wait for the configured amount of time. If the watchdog determines that the program has crashed, it will trigger a Watchdog Interrupt (if EWDI is set) after the configured amount of time. 128 Instruction cycles later, if the program still appears to be crashed, it will reboot the system.

In order to prevent a watchdog reboot, your software must let the watchdog know that it is still alive. It does this by executing the following code:

MOV TA,#0AAh ;Execute the Timed Access Protection
MOV TA,#55h ;code to open the Timed Access window
SETB RWT ;Reset the watchdog timer by setting the RWT bit

Setting the RWT bit (WDCON.0) is how your program lets the watchdog know that everything is ok--that your program hasnt crashed. Doing so will reset the watchdog timer.

You may be asking, "What are those first two MOV instructions for?" The RWT bit is a "protected bit." You may not write to it without executing the two MOV instructions. Note that you must also execute those two same instructions before modifying WDCON.0, WDCON. 1, and WDCON.3. Please see the chapter regarding "Timed Access Protection" for a more full discussion of why this is necessary.

 Click here for >>>> Dallas 80C320 - Chapter 3.2 (Using the Watchdog Interrupt)

<<<<  Back to  DS80C320 Microcontroller Tutorial