![Sino Wealth SH79F3283 Скачать руководство пользователя страница 118](http://html1.mh-extra.com/html/sino-wealth/sh79f3283/sh79f3283_manual_1283063118.webp)
SH79F3283
118
8.11 Watchdog Timer (WDT) and Reset State
8.11.1 Feature
Auto detect Program Counter (PC) over range, and generate OVL Reset
WDT runs even in the Power-Down mode
Selectable different WDT overflow frequency
OVL Reset
To enhance the anti-noise ability, SH79F3283 built in Program Counter (PC) over range detect circuit, if program counter value is
larger than flash Rom size, or detect operation code equal to A5H which is not exist in 8051 instruction set, a OVL reset will be
generate to reset CPU, and set WDOF bit. So, to make use of this feature, you should fill unused flash Rom with A5H.
Watchdog Timer
The watchdog timer is a down counter, and its clock source is an independent built-in RC oscillator, so it always runs even in
the Power-Down mode. The watchdog timer will generate a device reset when it overflows. It can be enabled or disabled by
the code option.
The watchdog timer control bits (WDT.2-0) are used to select different overflow time. The watchdog timer overflow flag
(WDOF) will be automatically set to “1” by hardware when overflow happens. To prevent overflow happen, by reading or
writing the WDT register RSTSTAT, the watchdog timer should re-count before the overflow happens.
There are also some reset flags in this register as below:
8.11.2 Register
Table 8.43
Reset Control Register
B1H, Bank0
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
RSTSTAT
WDOF
-
PORF
LVRF
CLRF
WDT.2
WDT.1
WDT.0
R/W
R/W
-
R/W
R/W
R/W
R/W
R/W
R/W
Reset Value (POR)
0
-
1
0
0
0
0
0
Reset Value (WDT)
1
-
u
u
u
0
0
0
Reset Value (LVR)
u
-
u
1
u
0
0
0
Reset Value (PIN)
u
-
u
u
1
0
0
0
Bit Number
Bit Mnemonic
Description
7
WDOF
Watch Dog Timer Overflow
or OVL Reset Flag
Set by hardware when WDT overflow or OVL reset happened, cleared by software or
Power On Reset
0: Watch Dog not overflows or no OVL reset generated
1: Watch Dog overflow or OVL reset occurred
5
PORF
Power On Reset Flag
Set only by Power On Reset, cleared only by software
0: No Power On Reset.
1: Power On Reset occurred.
4
LVRF
Low Voltage Reset Flag
Set only by Low Voltage Reset, cleared by software or Power On Reset
0: No Low Voltage Reset occurs
1: Low Voltage Reset occurred
3
CLRF
Pin Reset Flag
Set only by pin reset, cleared by software or Power On Reset
0: No Pin Reset occurs
1: Pin Reset occurred
2-0
WDT[2:0]
WDT Overflow period control bit
000: Overflow period minimal value= 4096 ms
001: Overflow period minimal value= 1024 ms
010: Overflow period minimal value = 256 ms
011: Overflow period minimal value = 128 ms
100: Overflow period minimal value = 64ms
101: Overflow period minimal value = 16ms
110: Overflow period minimal value = 4ms
111: Overflow period minimal value = 1ms
Notes: If WDT_OPT is enabled in application, you must clear WatchDog periodically, and
the interval must be less than the minimum value listed above.