MS51
Dec. 17, 2019
Page
163
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
WDCON
– Watchdog Timer Control
Regiser
Address
Reset Value
WDCON
AAH, all pages, TA protected
POR 0000_0111b
WDT 0000_1UUUb
Others 0000_UUUUb
7
6
5
4
3
2
1
0
WDTR
WDCLR
WDTF
WIDPD
WDTRF
WDPS[2:0]
R/W
R/W
R/W
R/W
R/W
R/W
Bit
Name
Description
3
WDTRF
WDT reset flag
When the CPU is reset by WDT time-out event, this bit will be set via hardware. This flag is
recommended to be cleared via software after reset.
6.2.8
Software Reset
The MS51 provides a software reset, which allows the software to reset the whole system just similar
to an external reset, initializing the MCU as it reset state. The software reset is quite useful in the end
of an ISP progress. For example, if an ISP of Boot Code updating User Code finishes, a software
reset can be asserted to re-boot CPU to execute new User Code immediately. Writing 1 to SWRST
(CHPCON.7) will trigger a software reset. Note that this bit is writing TA protection. The instruction that
sets the SWRST bit is the last instruction that will be executed before the device reset. See demo
code below.
If a software reset occurs, SWRF (AUXR0.7) will be automatically set by hardware. User can check it
as the reset source indicator. SWRF keeps unchanged after any reset other than a power-on reset or
software reset itself. SWRF can be cleared via software.