Rev. 1.10
46
November 26, 2019
Rev. 1.10
47
November 26, 2019
HT68FB240
USB Low Speed Flash MCU
Programming Considerations
The high speed and low speed oscillators both use the same SST counter. For example, if the system
is woken up from the SLEEP0 Mode and the HIRC oscillator needs to start-up from an off state. The
LIRC
oscillator uses the SST counter after HIRC oscillator has finished its SST period.
•
If the device is woken up from the SLEEP0 Mode to the NORMAL Mode, the high speed system
oscillator needs an SST period. The device will execute first instruction after HTO is "1".
•
There are peripheral functions, such as WDT, TMs and
SIM
, for which the f
SYS
is used. If the sys-
tem clock source is switched from f
H
to f
L
, the clock source to the peripheral functions mentioned
above will change accordingly.
•
The on/off condition of f
L
depends upon whether the WDT is enabled or disabled as the WDT
clock source is generated
from f
L
.
Watchdog Timer
The Watchdog Timer is provided to prevent program malfunctions or sequences from jumping to
unknown locations, due to certain uncontrollable external events such as electrical noise.
Watchdog Timer Clock Source
The Watchdog Timer clock source is provided by the internal clock, f
SUB
, which is sourced from the
LIRC oscillator. The Watchdog Timer source clock is then subdivided by a ratio of 2
8
to 2
18
to give
longer timeouts, the actual value being chosen using the WS2~WS0 bits in the WDTC register. The
LIRC internal oscillator has an approximate period of 32kHz at a supply voltage of 5V.
However, it should be noted that this specified internal clock period can vary with V
DD
, temperature and
process variations. The WDT function is allowed to enable or disable by setting the WDTC register data.
Watchdog Timer Control Register
A single register, WDTC, controls the required timeout period as well as the enable/disable
operation. The WRF software reset flag will be indicated in the CTRL register.
WDTC Register
Bit
7
6
5
4
3
2
1
0
Name
WE4
WE3
WE2
WE1
WE0
WS2
WS1
WS0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
0
1
0
1
0
0
1
1
Bit 7~3
WE4~WE0:
WDT function software control
10101: disable
01010: enable
Other: reset MCU
When these bits are changed to any other values due to environmental noise the
microcontroller will be reset; this reset operation will be activated after 2~3 LIRC clock
cycles and the WRF bit in the CTRL register will be set to 1 to indicate the reset source.
Bit 2~0
WS2~WS0:
WDT time-out period selection
000: 2
8
/f
SUB
001: 2
10
/f
SUB
010: 2
12
/f
SUB
011: 2
14
/f
SUB
100: 2
15
/f
SUB
101: 2
16
/f
SUB
110: 2
17
/f
SUB
111: 2
18
/f
SUB
These three bits determine the division ratio of the Watchdog Timer source clock,
which in turn determines the time-out period.