388
CHAPTER 16 INTERRUPT FUNCTIONS
16.3.5 Watchdog timer mode register (WDM)
The PRC bit of the WDM specifies the priority of NMI pin input non-maskable interrupts and watchdog timer overflow
non-maskable interrupts.
The WDM can be written to only 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.
If the 3rd and 4th bytes of the operation code are not complements, 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.
The WDM can be read at any time by a data transfer instruction.
RESET input clears the WDM register to 00H.
Figure 16-5. Format of Watchdog Timer Mode Register (WDM)
Caution The watchdog timer mode register (WDM) can be written only by using a dedicated instruction (MOV
WDM, #byte).
RUN
0
0
PRC
0
WDI2
WDI1
0
7
6
5
4
3
2
1
0
RUN
Specifies Operation of Watchdog Timer
(refer to
Figure 12-2
).
WDM
Address : 0FFC2H On reset : 00H R/W
PRC
0
1
Priority of Watchdog Timer Interrupt Request
Watchdog timer interrupt request
< NMI pin input interrupt request
Watchdog timer interrupt request
> NMI pin input interrupt request
WDI2
Specifies count clock of watchdog
timer (refer to
Figure 12-2
).
WDI1