AN2017
APPLICATION NOTE
DIFFERENT WAYS TO RESET ST7 MICROCONTROLLER
INTRODUCTION
The ST7 Microcontroller can be reset in several ways. This application note explains the dif-
ferent ways in which you can reset the ST7 MCU to make best use of them while designing
your application.
The various reset sources are:
– External Reset
– Internal Low Voltage Detect (LVD) Reset
– Internal Watchdog Reset
These sources act on the RESET pin and it is always kept low during delay phase. The Reset
service routine vector is fixed at address FFFEh-FFFFh in the ST7 memory map.
Rev. 1.0
AN2017/0305
1/10
1
DIFFERENT WAYS TO RESET ST7 MICROCONTROLLER
1 INTERNAL LOW VOLTAGE DETECTOR (LVD) RESET
The LVD function continuously monitors the supply voltage and generates a reset when the
V
DD
is below:
– V
IT+(LVD)
, Reset Release voltage when V
DD
is rising
– V
IT-(LVD)
, Reset Generation voltage when V
DD
is falling
This means it secures power-up as well as power-down keeping ST7 in reset. The LVD func-
tion is illustrated in
Figure 1.
The difference between V
IT+(LVD)
and V
IT-(LVD)
is called LVD hysteresis. The V
IT-(LVD)
refer-
ence value for a voltage drop is lower than the V
IT+(LVD)
reference value for power-on in order
to avoid parasitic reset when the MCU starts running and sinks current on supply.
Figure 1. LVD Vs Reset
V
DD
V
IT+(LVD
V
IT-(LVD)
V
Hysteresis
RESET
The voltage threshold can be configured by option byte to be low, medium or high. The LVD
is an optional function which can be selected through option byte and it allows the device to be
used without any External Reset circuitry. During a LVD reset, the RESET pin is held low, thus
permitting the MCU to reset other devices.
After the device is powered on the supply voltage starts increasing. when the supply voltage
reaches around 1.1V, the internal pull-up on the RESET pin is enabled and the core is initial-
ized. After the V
DD
reaches 1.8V, the option bytes are enabled, LVD is enabled by the option
bytes (if selected) and the device is in Run mode. The reset will be released at the reset re-
lease threshold: high, medium or low depending upon the selection through option bytes.
2/10
2
DIFFERENT WAYS TO RESET ST7 MICROCONTROLLER
2 INTERNAL WATCHDOG RESET
The Watchdog timer is used to detect the occurrence of a software fault, usually generated by
external interference or by unforeseen logical conditions, which cause the application program
to abandon its normal sequence. The watchdog circuit generates an MCU reset on expiry of a
programmed time period, unless the counter contents are refreshed.
The hardware WDG selectable through option byte is on immediately after reset. The software
WDG will have to be switched on through software. Both, once set on, can no longer be disa-
bled.
2.1 WATCHDOG TIMER
This is present in all ST7 devices except ST7FLite0. It is a programmable free-running down
counter. The length of the timeout period can be programmed by the user in 64 increments by
varying the counter stored in CR register.
If the watchdog is activated (the WDGA bit is set) and when the 7-bit timer rolls over from 40h
to 3Fh, it initiates a reset cycle pulling low reset pin for typically 30µs.
The application program must regularly refresh the watchdog before its timeout period expires
in order to prevent MCU reset. The WDGCR register must be written at regular intervals and
the value stored in the register must be between FFh and C0h.
2.2 WATCHDOG (LITE TIMER)
This Watchdog is present in ST7FLite0 for instance. The watchdog runs with the Lite Timer.
The normal watchdog timeout period is 2msec (@8MHz F
CPU
) after which it generates a
reset. A watchdog reset can be forced at any time provided that the watchdog is already ac-
tive.
To prevent a watchdog reset, software must set the WDGD bit before the timeout period has
elapsed.
3/10
DIFFERENT WAYS TO RESET ST7 MICROCONTROLLER
3 EXTERNAL RESET
A reset signal originating from an external source is one of the ways in which you can reset the
microcontroller. This signal must have a duration of at least the External reset pulse hold time,
t
h(RSTL)1)
in order to be recognized. This detection is asynchronous and therefore the MCU
can enter reset state even in Halt mode.
There are several reset implementation schemes to choose from based on your application-
specific parameters, such as power supply behaviour. Whatever the solution chosen, the idea
is to keep the RESET pin at a low logic level until the supply has reached a safe operating
voltage. Therefore you should design your external circuit in such a manner that there is
enough delay to keep the RESET pin below the V
IL
value.
3.1 RCD Circuit
This concept is the simplest, most cost-effective external reset solution where the supply
waveform is monotonous and the maximum rise time is known. The principle is to let the
RESET pin rises with the MCU supply voltage after a delay. The circuit is shown in
Figure 2.
The basic solution is to use an RC delay determined by the rise rate of the supply itself. The
component values must be chosen to create enough delay to keep the RESET pin below the
V
IL2)
specification until V
DD
reaches a safe operating voltage. Normally, a delay (Time Con-
stant) corresponding to at least 30% of the total rise time is generally advised.
Figure 2. RCD Circuit
D
V
DD
R
RESET
C
This scheme requires a certain delay between a power-down and next power-up, because the
delay generator has to be re initialized. In practice, a pull-down capacitor between RESET and
Gnd needs to be discharged. The diode between RESET and V
DD
is helpful, it quickly dis-
charges the capacitor when V
DD
falls. This helps ensure a proper RESET pin input on the sub-
sequent power-up, should it occur soon after the power down (the delay required is reduced).
The difference in the discharge time of the Capacitor with and without the diode is significant
from
Figure 3.
1 For specific
t
h(RSTL)
values refer to the datasheet of the particular microcontroller
2 For specific
V
IL
values refer the to datasheet of the particular microcontroller
4/10
DIFFERENT WAYS TO RESET ST7 MICROCONTROLLER
Figure 3. Waveform of Power-on-Reset with RCD Circuit (Without MCU)
V
DD
RESET
Without Diode - Capacitor discharges
very slowly
With Diode - Capacitor discharges
quickly
On ST7 there are internal protection diodes on the pads, which would solve the purpose of this
external diode, thereby you could do away with this diode in your actual implementation with
the MCU. The waveform of Power-on Reset with the External RC Circuit connected to ST7
without the diode is shown in
Figure 4.
Figure 4. Waveform of Power-on-Reset with RC Circuit (With MCU)
R=47K, C=10uF
VDD risetime = 1250msec/5V
V
DD
RESET
,
One consideration when choosing the values of the resistor and capacitor is to ensure that re-
sistor’s value does not get too high and interfere with the ability to drive RESET pin high given
the worst case leakage current of the pin. Higher resistor values in the order of Mega Ohms
could possibly create an input level on the RESET pin that would be below the V
IH
specifica-
tion. The capacitor should not be too large when using MCU’s that have an active internal
reset because this could mask the Internal reset. So, a proper combination of component
values is required. Because of this limitation of selecting higher component values, this solu-
5/10