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
Watchdog System Resets

Watchdog System Resets

If the watchdog timer is allowed to run out and no action is taken to reset the timer in the Watchdog Interrupt, the watchdog will automatically reset the system.

A reset caused by the watchdog is like any other reset with one exception: The WTRF bit (WDCON.2) will be set. That is to say, if WTRF is clear it means the system is booting due to some other non-watchdog related reason. If the bit is set, the boot is due to the watchdog.

You can use this information in your application to execute special code in the event a watchdog reset occurs. Take the following psuedo-code, for example:

    ORG 0000h
    JNB WTRF,NORMAL
    PRINT "The system locked up and was rebooted by the watchdog."
    PRINT "Skipping normal device initialization."
    LJMP MAIN
    NORMAL: LCALL INITIALIZE_LCD
    LCALL INITIALIZE_XRAM_VARIABLES
    MAIN: (continue normal program execution)
     
Note that if you put all your variables in Extended RAM, a watchdog reset will not erase them. Observe in the above psuedo-code that if the system is booting due to a watchdog reset, it skips the LCD and variable initialization routines. Thus, when program execution resumes at MAIN, all variables in XRAM will still be intact.

 Click here for >>>> Dallas 80C320 - Chapter 4 (Power Failure Functions)

<<<<  Back to  DS80C320 Microcontroller Tutorial