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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

WATCHDOG TIMER UNIT<br />

wdt_data<br />

segment<br />

wdt_key DB 0AAH, 055H<br />

wdt_data<br />

ends<br />

pcb_image segment ;image of PCB<br />

WDTCLR EQU XXXXH ;replace “XXXX” with appropriate<br />

;offset from PCB+0.<br />

WDTCLR DW <br />

pcb_image<br />

wdt_code<br />

ends<br />

segment<br />

assume cs:wdt_code<br />

mov ax, seg wdt_key<br />

mov ds, ax<br />

mov si, offset wdt_key<br />

;DS:SI = address of WDT reset value<br />

mov ax, seg WDTCLR<br />

mov es, ax<br />

mov di, offset WDTCLR<br />

;ES:DI = address of WDTCLR register<br />

cld<br />

;clear direction flag (autoincrement)<br />

mov cx, 2 ;2 bytes in key<br />

lock rep movsb ;LOCKed reload sequence<br />

;The WDT down counter<br />

;has been reloaded.<br />

wdt_code ends<br />

Example 12-2. Reload Sequence (Peripheral Control Block Located in Memory Space)<br />

12.2.3 Initialization<br />

The Watchdog Timer Unit is enabled following a reset. The initial value in the down counter is<br />

0FFFFH. The system software must program or reload the Watchdog Timer within 65,535 clock<br />

cycles of a reset to prevent the WDTOUT signal from being asserted.<br />

Use the following sequence to initialize the Watchdog Timer:<br />

1. Program the upper 16 bits of the WDT Reload Value (in the WDTRLDH register).<br />

2. Program the lower 16 bits of the WDT Reload Value (in the WDTRLDL register).<br />

3. Execute the appropriate LOCKed instruction sequence to reload the down counter and<br />

lock accesses to the WDT Reload Value.<br />

12-5

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

Saved successfully!

Ooh no, something went wrong!