STM8 reset

Publisher:EtherealHeartLatest update time:2016-08-08 Source: eefocusKeywords:STM8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
STM8S has 9 reset sources:

External reset generated by NRST pin 
Power-on reset (POR) 
Power-down reset (BOR)
Independent watchdog reset
Window watchdog reset
Software reset
SWIM reset
Illegal opcode reset
EMS reset: reset generated when some key registers are corrupted or loaded incorrectly

All reset sources ultimately act on the NRST pin and remain low during the reset process. The reset entry vector is located at a fixed address 6000h in the memory map.

STM8 reset - Wornyong - Smart IoT, embedded in you and me!

 

Reset Circuit


The reset pin NRST has an internal weak pull-up resistor RPU, which can be used as an input or an open-drain output.
A low-level pulse with a minimum width of 500ns on the reset pin can generate an external reset. The reset detection is asynchronous, so it is possible to enter the reset state even if the MCU is in Halt mode. The
reset pin can also be used as an open-drain output to reset external devices.
Regardless of the internal reset source, once reset, the internal reset circuit will generate a reset pulse with a pulse width of at least 20us.
When no external reset occurs, the internal weak pull-up resistor ensures that the reset pin is at a high level.
Please refer to Figure 11 and the electrical characteristics parameter section in the data sheet for more details.

Internal reset source


 

In addition to the power-on reset (POR) and power-down reset (BOR), each internal reset source has a flag bit corresponding to it in the reset status register. At reset, these flag bits are set separately according to the reset source that caused the reset. Therefore, these flag bits can be used to indicate the reset source that caused the last reset. The flag bit can be cleared by software writing '1'.


Power-on reset (POR) and power-down reset (BOR)
During power-on of the STM8, the POR keeps the device in reset until the supply voltage (VDD and VDDIO) reaches the start voltage of the BOR. At this point, the BOR reset replaces the POR and the POR is automatically turned off.
The BOR reset continues until the supply voltage reaches the operating voltage. For details, please refer to the electrical characteristics section of the data sheet.
When the operating voltage drops below the threshold VIT-, the BOR will also generate a reset, after which the POR module will be ready to respond to the next power-on reset.
Voltage hysteresis is used to ensure clear detection of voltage rise and fall.
Even if the MCU is in low power mode, the BOR always remains active.

STM8 reset - Wornyong - Smart IoT, embedded in you and me!

  

Watchdog reset
For details, see 14 Independent Watchdog (IWDG) and 15 Window Watchdog (WWDG). 
Software reset
The application can trigger a reset by clearing the T6 bit in the register WWDG_CR, see 15 Window Watchdog (WWDG).
SWIM reset
An external device connected to the SWIM interface can generate an MCU reset through the SWIM module.
Illegal opcode reset
In order to improve the reliability of STM8 devices and prevent unexpected behavior, an illegal opcode detection system is used. If the executed code does not match any opcode or preset byte, a reset is generated. This function, in conjunction with the watchdog, allows the device to recover from an unexpected error or interference.
Note: An illegal combination of a valid preset byte and a valid opcode will not generate a reset.
EMS reset
In order to avoid accidental write operations or system hangs caused by electromagnetic interference to the application, most key registers have a complementary register corresponding to them. The system will automatically detect whether these key registers match their complementary registers. If they do not match, an EMS reset is generated to restore the application to normal operation.

Keywords:STM8 Reference address:STM8 reset

Previous article:STM8 clock
Next article:STM8 power supply

Recommended ReadingLatest update time:2024-11-23 10:36

Some operations of stm8 and DS1302
I recently wanted to see the state of the DS1302's internal RAM after power failure. Will it be all 0x00 by default? First, I checked the information on the Internet and the chip manual, but there was no introduction to it. DS1302 is a very common clock chip. I have used other microcontrollers before, but I never p
[Microcontroller]
STVD prompts "can not openfile crtsi0.sm8" when compiling
The following errors occurred when compiling the project with STVD+COSMIC: #error clnk Debugdemo.lkf:47 can't openfile crtsi0.sm8 #error clnk Debugdemo.lkf:60 can't openfile libis0.sm8 #error clnk Debugdemo.lkf:61 can't openfile libm0.sm8 Solution: Open the STVD software, select Tools- Options - Directories - Show Di
[Microcontroller]
STVD prompts
Why can IAR for STM8 not configure the clock?
When I first started learning STM8, I followed the online tutorial to create an IAR project, then downloaded an official firmware library and made a case template. The function was super simple, just a flashing LED light, and the main function had just this content: void main(void) { /* Initialize I/Os in Output Mode
[Microcontroller]
3-in-1 kit stm8 study notes css
ST 3-in-1 development board stm8 learning CSS 1. Introduction of the program:   This project mainly involves gpio, rcc and tim. The function implemented by the project is to switch the internal and external system clocks to verify the security of the system clock. When the external clock fails, it will automatically s
[Microcontroller]
Taking the STM8 microcontroller as an example, how to implement the Bootloader?
This business trip was to upgrade the program to solve the bug. The user has packaged the product and cannot open the cover. The only way to update the program is to use the CAN bus and use the Bootloader. In fact, the .bin/hex file is sent to the microcontroller by the host computer through CAN communication and stor
[Microcontroller]
Taking the STM8 microcontroller as an example, how to implement the Bootloader?
STM8 16-bit advanced control timer (TIM1)
Introduction to 16-bit Advanced Control Timer (TIM1) The TIM1 of STM8S consists of a 16-bit auto-reload counter, which is driven by a programmable prescaler. In this chapter, i is used to represent 1, 2, 3, and 4, corresponding to four different capture/compare channels. Advanced Control Timers are suitable for many
[Microcontroller]
STM8 16-bit advanced control timer (TIM1)
【STM8】External memory W25Q16
The page programming mentioned in the article is writing data, because this is the result of a direct translation from English (PageProgram)   In order to test this external Flash memory, I bought a small board on Taobao for less than 3 yuan. In fact, you can also buy the chip and connect it yourself, anyway, there ar
[Microcontroller]
【STM8】External memory W25Q16
STM8 GPIO driver
The peripherals of the chip generally follow these processes: GPIO, external interrupt, timer, serial port, ADC, IIC, SPI. Below I will write according to each mode.    First of all, GPIO. STM8's GPIO has a multiplexing function. This sentence tells us that we must configure the IO multiplexing function before we can
[Microcontroller]
STM8 GPIO driver
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号