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 />

A LOCKed instruction sequence that is similar to the reload sequence disables the Watchdog<br />

Timer. The Watchdog Timer Disable (WDTDIS) Register expects a sequence of two bytes,<br />

which must be written by a single LOCKed instruction. The first byte must be 55H and the second<br />

must be 0AAH (the reverse of the reload sequence). Writing any other data values or using two<br />

separate LOCKed instructions will not disable the WDT. The Watchdog Timer cannot be disabled<br />

once it has been reloaded by the system software. Similarly, it cannot be enabled once it<br />

has been disabled.<br />

Examples 12-3 and 12-4 show the code necessary to disable the Watchdog Timer Unit when the<br />

Peripheral Control Block is located in I/O and memory space, respectively.<br />

wdt_data<br />

segment<br />

wdt_off DB 055H, 0AAH<br />

wdt_data<br />

wdt_code<br />

ends<br />

segment<br />

assume cs:wdt_code<br />

mov ax, seg wdt_off<br />

mov es, ax<br />

mov si, offset wdt_off<br />

mov dx, WDTDIS ;ES:SI points to wdt_key<br />

;disable value of WDT<br />

cld<br />

;clear direction flag (autoincrement)<br />

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

lock rep outsb es:[si], dx ;LOCKed disable sequence.<br />

;The WDT is disabled<br />

wdt_code ends<br />

Example 12-3. Disabling the Watchdog Timer (Peripheral Control Block in I/O Space)<br />

12-7

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

Saved successfully!

Ooh no, something went wrong!