The Unexpected reset of a microcontroller is the microcontroller reset problem which we are going to discuss in this blog post. Whenever you are dealing with some external peripheral interfacing this could be a big issue if not managed properly and could cost you a loosing your project.
There are many possible reasons including hardware and software problems such as reset pin issues, ESD coupling, bad solder joint, power rail glitch, watchdog timer, divide-by-zero, stack overflow, etc. So, let’s break down them and see how to debug such problem? Also, at end of this post I had provided some external links which could help you to learn more on this topic.
Table of Contents
Normal Reset Behaviour
Before discussing the improper reset behavior of a microcontroller let’s discuss what is a normal reset behavior? The normal behavior is when we power up the microcontroller and it starts from first instruction in the Program counter. This could also happen when user force microcontroller to go on reset state by pressing the external reset switch or applying the signal on the reset pin of a microcontroller.
This kind of normal reset could happen usually due to power on reset signal. But could be caused by other factors, like hardware faults managed by software and software force the microcontroller to reset. This could be considered normal because it is handled in your firmware design. Other reasons are watchdog timers, brownouts, or initiated by user.
There is a document from NXP which talks about improper reset handling which could cause problems which says.
A simple function such as resetting an MCU during the application orAN1744.pdf (nxp.com)
removal of power can cause many problems if not handled properly.
Symptoms of an improperly handled reset during power transitions can
range from a slight delay in MCU response after power-up to very erratic,
inconsistent behavior to total system failure
Microcontroller Reset Problem Reasons
As we discussed above, if the microcontroller does not reset as expected this is a big issue which could cause the system failure. We should take detail care of this to ensure a proper system behavior. Here is a tabular representation of the reasons of microcontroller reset problem which could be caused by software or hardware.
|Software Issues||Hardware Issues|
|Incorrect Firmware Logic||Insufficient Current Capacity|
|Infinite Loops||Decoupling Capacitors Placement/Value|
|Stack Overflows||Voltage Transients|
|Incorrect Initialization||Electromagnetic Interference (EMI)|
|Race Conditions||Grounding Issues|
|Bugs in Interrupt Service Routines||Power Supply Stability|
|Improper Peripheral Configuration||Heat-Related Issues|
|Resource Conflicts||Firmware Bugs|
EMI (Electro Magnetic Inference)
Sometimes it happens that some external noise is affecting our microcontroller circuit. This source could be due to EMI or Electromagnetic Inference. The electromagnetic inference is the electrical signal which can disturb the other electric circuit via electromagnetic induction, electrostatic coupling or conduction.
Electromagnetic interference (EMI) is a disturbance generated by an external source that affects an electrical circuit by electromagnetic induction, electrostatic coupling, or conduction 1. EMI can cause a range of problems, from an increase in error rate to a total loss of data 1. The noise can be generated by both human-made and natural sources such as ignition systems, cellular networks of mobile phones, lightning, solar flares, and auroras 1. EMI can affect AM radios, mobile phones, FM radios, televisions, and observations for radio astronomy and atmospheric science 1.Wikipedia (summarized by bing chat)
To reduce EMI noise, it is important to identify the source of the noise and take appropriate measures. Some common methods include:
- Shielding: This involves enclosing the affected circuit in a conductive material to block the electromagnetic waves that cause EMI 2.
- Grounding: This involves connecting the affected circuit to a ground plane to reduce the voltage difference between the circuit and its surroundings 2.
- Filtering: This involves using filters such as capacitors and inductors to remove unwanted frequencies from the signal 3.
It is important to note that EMI can be intentional as well. For example, it can be used for radio jamming in electronic warfare 1.
- Microcontroller reset reason | Forum for Electronics (edaboard.com)
- Load on Power Relay Causing Microcontroller Reset | Electronics Forums (maker.pro)
- Microcontroller reset problem | Power Integrations, Inc.
- microcontroller – What could cause unexplained brownout resets? – Electrical Engineering Stack Exchange
- microprocessor – What could cause a microcontroller to unexpectedly reset? – Electrical Engineering Stack Exchange
- RESET (microchip.com)