Categories
STM8 Examples

STM8: Reset Explained

Reset is the one of the first step whenever any microcontroller power’s up. We need to understand the STM8 reset process so we can utilize the proper initialization process of the STM8 microcontroller. One more thing this will help to understand is when the microcontroller reset due to some fault or some external interference. By understanding the reset process will help you to master this process and to capture any faults you may encounter.

Types of Reset Resources in STM8

According to the STM8 reference manual there are 9 kinds of reset sources in the STM8 microcontrollers. Here is the total list of the sources.

  • External reset through the NRST pin
  • Power-on reset (POR)
  • Brown-out Reset (BOR)
  • Independent watchdog reset (IWDG)
  • Window watchdog reset (WWDG)
  • Software reset
  • SWIM reset
  • Illegal opcode reset
  • EMC reset: generated if critical registers are corrupted or badly loaded

STM8 Internal Reset Circuit

If you look into the STM8 reset circuit from the STM8 reference manual it looks like the diagram below grabbed from the reference manual. The reset pin is called the NRST Pin.

STM8 Reset circuit from STM8 reference manual
STM8 Reset Circuit diagram

External reset through the NRST pin

The NRST pin is a special pin on the microcontroller that can be used to reset the device. The NRST pin has an inbuilt RPU weak pull-up resistor and functions as both an input and an open-drain output. When a low signal is sent to the NRST pin for a certain amount of time, it causes the microcontroller to reset. This reset can happen even if the microcontroller is in a HALT state. The NRST pin can also be used to send signals to other devices to reset them.

Power-on reset (POR) and brown-out reset (BOR)

The POR (Power-On Reset) is responsible to keeps the device in a reset state. This keeps it in reset state until the power supply voltages reach a stable level (VDD and
VDDIO) Once the voltages are stable then the BOR (Brown-Out Reset) takes over and the POR is disabled. The BOR keeps the device reset until the power supply voltage reaches the normal operating range.

If the power supply voltage drops below a certain level, the BOR will trigger a reset, and the POR will be reactivated for the next power-up cycle. To prevent false resets, the BOR uses a hysteresis circuit to ensure that the voltage changes are significant before triggering a reset. Even when the device is in a low-power mode, the BOR remains active to monitor the power supply voltage.

Software Reset

Software reset is a process to reset the microcontroller through internal program. There could be many condition where we need the microcontroller to be start again from the beginning within the internal software process. This could be done by using the Flag bit in the Register WWDG_CR and the flag bit is called the T6 bit of that WWDG_CR Register.

SWIM reset

This is a special pin used to program the microcontroller via STLINK and if the device is connected to this pin it can request the microcontroller to be in reset state through the software reset via this SWIN Reset request.

An external device connected to the SWIM interface can request the SWIM block to
generate an MCU reset.

By Abdul Rehman

My name is Abdul Rehman and I love to do Reasearch in Embedded Systems, Artificial Intelligence, Computer Vision and Engineering related fields. With 10+ years of experience in Research and Development field in Embedded systems I touched lot of technologies including Web development, and Mobile Application development. Now with the help of Social Presence, I like to share my knowledge and to document everything I learned and still learning.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.