03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

WATCHDOG TIMER UNIT<br />

12.2.2 Watchdog Timer Reload Value<br />

The Watchdog Timer Reload Value is controlled by the WDTRLDL and WDTRLDH registers<br />

in the Peripheral Control Block. These two registers make up the 32-bit reload value.<br />

The Watchdog Timer Reload Value cannot be modified after the Watchdog Timer is reloaded using<br />

the reload instruction sequence. Locking the WDT Reload Value prevents errant code from<br />

affecting Watchdog Timer operation.<br />

The WDT Reload Value should be calculated based on the design of the system software. If the<br />

system is executing a simple control loop, the Reload Value should be slightly longer than the<br />

longest path through the loop. If the Watchdog Timer is reloaded during the timer tick service,<br />

the Reload Value should be slightly longer than the timer tick interval. In general, determining<br />

the Reload Value involves analysis of the system software and some amount of experimentation.<br />

wdt_data<br />

segment<br />

wdt_key DB 0AAH, 055H<br />

wdt_data<br />

wdt_code<br />

ends<br />

segment<br />

assume cs:wdt_code<br />

mov<br />

mov<br />

mov<br />

ax, wdt_key<br />

ds, ax<br />

si, offset wdt_key<br />

;ES:SI points to reset value for<br />

;WDTCLR<br />

mov dx, WDTCLR ;I/O address of WDTCLR<br />

cld<br />

;clear direction flag (autoincrement)<br />

mov cx, 2 ;2 bytes will be written<br />

lock rep outsb es:[si] ;LOCKed reload sequence<br />

;The WDT down counter<br />

;has been reloaded.<br />

wdt_code<br />

ends<br />

Example 12-1. Reload Sequence (Peripheral Control Block Located in I/O Space)<br />

12-4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!