![](http://datasheet.mmic.net.cn/NXP-Semiconductors/P87C51RB2BN-112_datasheet_99217/P87C51RB2BN-112_40.png)
Philips Semiconductors
Product data
P87C51RA2/RB2/RC2/RD2
80C51 8-bit microcontroller family 8KB/16KB/32KB/64KB OTP
with 512B/1KB RAM, low voltage (2.7 to 5.5 V), low power, high
speed (30/33 MHz)
2003 Jan 24
40
INIT_WATCHDOG:
MOV CCAPM4, #4CH
; Module 4 in compare mode
MOV CCAP4L, #0FFH
; Write to low byte first
MOV CCAP4H, #0FFH
; Before PCA timer counts up to
; FFFF Hex, these compare values
; must be changed
ORL CMOD, #40H
; Set the WDTE bit to enable the
; watchdog timer without changing
; the other bits in CMOD
;
;********************************************************************
;
; Main program goes here, but CALL WATCHDOG periodically.
;
;********************************************************************
;
WATCHDOG:
CLR EA
; Hold off interrupts
MOV CCAP4L, #00
; Next compare value is within
MOV CCAP4H, CH
; 255 counts of the current PCA
SETB EA
; timer value
RET
Figure 31. PCA Watchdog Timer Initialization Code