Section 11 Watchdog Timer (WDT)
11.5
Usage Notes
11.5.1
Notes on Register Access
The watchdog timer's TCNT, TCSR, and RSTCSR registers differ from other registers in being
more difficult to write to. The procedures for writing to and reading these registers are given
below.
(1)
Writing to TCNT, TCSR, and RSTCSR
TCNT and TCSR must be written to by a word transfer instruction. They cannot be written to by a
byte transfer instruction.
For writing, TCNT and TCSR are assigned to the same address. Accordingly, perform data
transfer as shown in figure 11.4. The transfer instruction writes the lower byte data to TCNT or
TCSR.
To write to RSTCSR, execute a word transfer instruction for address H'FFA6. A byte transfer
instruction cannot be used to write to RSTCSR.
The method of writing 0 to the WOVF bit in RSTCSR differs from that of writing to the RSTE bit
in RSTCSR. Perform data transfer as shown in figure 11.4.
At data transfer, the transfer instruction clears the WOVF bit to 0, but has no effect on the RSTE
bit. To write to the RSTE bit, perform data transfer as shown in figure 11.4. In this case, the
transfer instruction writes the value in bit 6 of the lower byte to the RSTE bit, but has no effect on
the WOVF bit.
TCNT write or writing to the RSTE bit in RSTCSR:
Address: H'FFA4 (TCNT)
TCSR write:
Address: H'FFA4 (TCSR)
Writing 0 to the WOVF bit in RSTCSR:
Address: H'FFA6 (RSTCSR)
Rev. 3.00 Mar. 14, 2006 Page 374 of 804
REJ09B0104-0300
H'FFA6 (RSTCSR)
Figure 11.4 Writing to TCNT, TCSR, and RSTCSR
15
8 7
H'5A
15
8 7
H'A5
15
8 7
H'A5
0
Write data
0
Write data
0
H'00