English
Language : 

UPD784938 Datasheet, PDF (388/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 13 WATCHDOG TIMER
13.2 Watchdog Timer Mode Register (WDM)
WDM is an 8-bit register that controls the watchdog timer operation.
To prevent erroneous clearing of the watchdog timer by an inadvertent program loop, writing can only be performed by
a dedicated instruction. This dedicated instruction, MOV WDM, #byte, has a special code configuration (4 bytes), and a
write is not performed unless the 3rd and 4th bytes of the operation code are mutual complements of 1.
If the 3rd and 4th bytes of the operation code are not mutual complements of 1, a write is not performed and an operand
error interrupt is generated. In this case, the return address saved in the stack area is the address of the instruction that
was the source of the error, and thus the address that was the source of the error can be identified from the return address
saved in the stack area.
If recovery from an operand error is simply performed by means of an RETB instruction, an endless loop will result.
As an operand error interrupt is only generated in the event of an inadvertent program loop (with the NEC assembler,
RA78K4, only the correct dedicated instruction is generated when MOV WDM, #byte is written), system initialization should
be performed by the program.
Other write instructions (MOV WDM, A, AND WDM, #byte, SET1 WDM.7, etc.) are ignored and do not perform any
operation. That is, a write is not performed to the WDM, and an interrupt such as an operand error interrupt is not generated.
After a system reset (RESET input), once the watchdog timer has been started (by setting (to 1) the RUN bit), the WDM
contents cannot be changed. The watchdog timer can only be stopped by a reset, but can be cleared at any time with a
dedicated instruction.
WDM can be read at any time by a data transfer instruction.
RESET input clears WDM to 00H.
The WDM format is shown in Figure 13-2.
388
Preliminary User’s Manual U13987EJ1V0UM00