4.
Port mode register 3 (PMR3)
PMR3 is an 8-bit read/write register, mainly controlling the selection of pin functions for port 3
pins. Only the bit relating to the watchdog timer is described here. For details of the other bits, see
section 8, I/O Ports.
Bit 5: Watchdog timer source clock select (WDCKS)
WDCKS
Description
0
ø/8192 selected
(initial value)
1
øw/32 selected
9.6.3 Timer Operation
The watchdog timer has an 8-bit counter (TCW) that is incremented by clock input (ø/8192 or
øw/32). The input clock is selected by bit WDCKS in port mode register 3 (PMR3): ø/8192 is
selected when WDCKS is cleared to 0, and øw/32 when set to 1. When TCSRWE = 1 in TCSRW, if
0 is written in B2WI and 1 is simultaneously written in WDON, TCW starts counting up. When the
TCW count reaches H'FF, the next clock input causes the watchdog timer to overflow, and an
internal reset signal is generated one reference clock (ø or ø
SUB
) cycle later. The internal reset
signal is output for 512 clock cycles of the ø
OSC
clock. It is possible to write to TCW, causing TCW
to count up from the written value. The overflow period can be set in the range from 1 to 256 input
clocks, depending on the value written in TCW.
Figure 9-17 shows an example of watchdog timer operations.
Example:
ø = 2 MHz and the desired overflow period is 30 ms.
2
×
10
6
×
30
×
10
–3
= 7.3
8192
The value set in TCW should therefore be 256 – 8 = 248 (H'F8).
237