MS51
Nov. 28, 2019
Page
219
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
6.2.4
Reset
Overview
6.2.4.1
The MS51 has several options to place device in reset condition. It also offers the software flags to
indicate the source, which causes a reset. In general, most SFR go to their Reset value irrespective of
the reset condition, but there are several reset source indicating flags whose state depends on the
source of reset. User can read back these flags to determine the cause of reset using software. There
are five ways of putting the device into reset state. They are power-on reset, brown-out reset, external
reset, WDT reset, and software reset.
Power-On Reset (POR) and Low Voltage Reset (LVR)
6.2.4.2
The MS51 incorporates an internal power-on reset (POR) and a low voltage reset (LVR). During a
power-on process of rising power supply voltage V
DD
, the POR or LVR will hold the MCU in reset
mode when V
DD
is lower than the voltage reference thresholds. This design makes CPU not access
program Flash while the V
DD
is not adequate performing the Flash reading. If an undetermined
operating code is read from the program Flash and executed, this will put CPU and even the whole
system in to an erroneous state. After a while, V
DD
rises above the threshold where the system can
work, the selected oscillator will start and then program code will execute from 0000H. At the same
time, a power-on flag POF (PCON.4) will be set 1 to indicate a cold reset, a power-on process
complete. Note that the contents of internal RAM will be undetermined after a power-on. It is
recommended that user gives initial values for the RAM block.
The POF is recommended to be cleared to 0 via software to check if a cold reset or warm reset
performed after the next reset occurs. If a cold reset caused by power off and on, POF will be set 1
again. If the reset is a warm reset caused by other reset sources, POF will remain 0. User may take a
different course to check other reset flags and deal with the warm reset event. For detailed electrical
characteristics, refer to the table 35-7 and 35-8.
PCON
– Power Control
Register
SFR Address
Reset Value
PCON
87H, All pages
POR: 0001_0000b
Others: 000U _0000b
7
6
5
4
3
2
1
0
SMOD
SMOD0
LPR
POF
GF1
GF0
PD
IDL
R/W
R/W
RW
R/W
R/W
R/W
R/W
R/W
Bit
Name
Description
4
POF
Power-on reset flag
This bit will be set as 1 after a power-on reset. It indicates a cold reset, a power-on reset complete.
This bit remains its value after any other resets. This flag is recommended to be cleared via
software.
Brown-Out Reset
6.2.4.3
The brown-out detection circuit is used for monitoring the V
DD
level during execution. When V
DD
drops
to the selected brown-out trigger level (V
BOD
), the brown-out detection logic will reset the MCU if
BORST (BODCON0.2) setting 1. After a brown-out reset, BORF (BODCON0.1) will be set as 1 via
hardware. BORF will not be altered by any reset other than a power-on reset or brown-out reset itself.
This bit can be set or cleared by software.