Current Location:Home > News > Industry Dynamics
10 details to improve MCU anti-interference ability
Release Time:2021-8-11 18:41:51

one

With the development of microcontrollers, their applications in fields such as household appliances, industrial automation, production process control, and intelligent instruments are also constantly developing.

On the other hand, various electrical devices in the same power system are closely related to each other through electrical or magnetic connections and affect each other. Many electrical devices are affected by electromagnetic oscillations caused by changes in operating modes, faults, switch activities, etc.

This puts the reliability and safety of our microcontroller system at risk. The microcontroller measurement and control system must operate stably and reliably for a long time; Otherwise, the control error will increase, and in severe cases, the system may malfunction, causing significant losses.


Therefore, the anti-interference problem of microcontrollers has become an issue that cannot be ignored.


The Influence of Two Disturbances on Microcontroller Application Systems


2.1 Increase in measurement data error

Interference permeates into the input channel of the analog signal in the measurement unit of the microcontroller system and is superimposed on the measurement signal, increasing data acquisition error. It is particularly important to detect weak signals, interference signals, and even overwhelming measurement signals.


2.2 Control system malfunction

The control signal of a microcontroller is usually determined by the state input signals under certain conditions and the logical processing results of these signals. If these input status signals are interrupted and incorrect status information is introduced, output control errors or control faults will increase.


2.3 Affects MCU RAM memory and E2PROM, etc.

In order to avoid interference and data degradation in microcontroller systems, programs, tables, and data are stored in program memory EPROM or FLASH. On the other hand, the data in on-chip RAM, external RAM, and E2PROM may be affected by external interference and changes.


2.4 Abnormal program operation

External interference can force the system to repeatedly reset, thereby interrupting the normal operation of the program. If external interference causes a change in the PC value of the microcontroller program counter, it will disrupt the normal operation of the program.


Due to the arbitrary nature of the incorrect PC value, the program will run a series of useless instructions before entering an "endless loop", resulting in the main output being chaotic or crashing.

How to improve the anti-interference ability of equipment?


3.1 Solving interference from the power supply side

Each unit in a microcontroller system requires a DC power supply, which is usually generated by converting, rectifying, filtering, and stabilizing AC power from the power grid. Therefore, many power disturbances will be introduced into the system.


In addition, as the AC power supply is shared, electronic devices will interfere with each other through the power supply. Therefore, it is necessary to suppress power interference. The following are the most common types of power interference:


1. High frequency interference (conducted interference) in power lines

The power cord serves as a receiving antenna, coupling lightning, arc, and high-frequency interference signals emitted by radio stations to the secondary of the power transformer, causing interference to the microcontroller system.

This interference is usually resolved by adding filters or using isolated power modules on the interface, which is usually achieved through interface protection.


2. Transient noise generated by induced load (EFT)

When a large capacity inductive load is cut off, it will generate large current and voltage change rates, leading to transient noise interference. This is the most common type of electromagnetic interference to address. Shielded wire and Double-sided tape wire are commonly used, as well as filtering processing in power supply and signal interface.


Both methods must be used in conjunction with a well grounded system and well grounded filter and interface filter circuits to effectively eliminate interference,


Four analog signal sampling anti-interference technology

One or more analog signals are sampled and converted into digital signals for processing through A/D in microcontroller application systems.

Improve the accuracy and consistency of measurements;

Ensure that the conversion accuracy of the sensor is maintained;

The stability of the sensor power supply;

Check the stability of the amplifier.

The reference voltage used for A/D conversion is stable;

Prevent external electromagnetic induced noise interference;

If not handled properly, weak useful signals may be completely submerged by useless noise signals.


In practical applications, differential input measurement amplifiers can be used, shielded double glued cables can be used to transmit measurement signals, or voltage signals can be converted into current signals, and resistance capacitance filtering technology can be used.


Anti-interference technology for five digital signal transmission channels

Digital output signals can be used as drive signals for system control devices (such as relays), while digital input signals can be used as return responses and command signals for devices (such as travel switches, start buttons, etc.).


One of the main ways for external interference to enter the SCM system is through digital signal interfaces.


Transmission line shielding technology, such as shielded wire, Double-sided tape wire and other anti-interference methods used in digital signal input/output process, includes: signal isolation measures; Reasonable grounding. Due to the common impedance interference generated by digital signals during level conversion, selecting a suitable grounding point can effectively reduce grounding noise.


Six hardware monitoring circuits

In order to ensure the reliable and stable operation of the system and improve its anti-interference ability, it is necessary to configure hardware monitoring circuits in the microcontroller system. The functions of the hardware monitoring circuit include the following:

Power on reset: Ensure that the system can start correctly when turned on.

When the power supply fails or the voltage drops below the specified voltage value, a reset signal is created to reset the system.

If the power supply voltage is abnormal, an alarm indication signal or interrupt request signal will be sent.

When the CPU encounters interference or software runs unstable and generates a "deadlock", please use the hardware watchdog to reset the system.


Reasonable wiring of seven PCB circuits

The anti-interference ability is largely influenced by the quality of PCB board design. Therefore, when designing a PCB, it is necessary to adhere to the general principles of PCB design and anti-interference design standards. The following sections focus on two points:


1. Placement of key components

In terms of device layout, like other logic circuits, devices that are related to each other should be as close as possible to achieve better noise resistance.


Clock generators, crystal oscillators, and CPU clock inputs are all susceptible to noise, so they should be tightly placed together; The CPU reset circuit and hardware watchdog circuit should be as close as possible to the corresponding pins of the CPU; And devices and high current circuits that are susceptible to noise should be kept as far away from logic circuits as possible.


2. The grounding wires of the D/A and A/D conversion circuits are connected correctly

Digital grounding and analog grounding are provided through D/A, A/D, and sampling chips, all of which have equivalent pins.


In circuit design, the digital and analog grounding of all devices must be independently connected, although the digital and analog grounding are only connected at one point. Shielding protection is also an option that can be used to isolate space radiation.


High noise components, such as variable frequency power supplies and switching power supplies, can be packaged in metal boxes to prevent noise sources from interfering with the microcontroller. Shields can be added and grounded in areas that are prone to interference, thereby causing interference signals to short-circuit to ground.


Eight Software anti-interference principles and methods

Although hardware anti-interference methods have been included, the causes of interference signals are complex and unpredictable, making it impossible to ensure that the system is completely free from interference,


Therefore, software anti-interference technology is often used to enhance hardware anti-interference measures as an auxiliary method for hardware measures. Software anti-interference technology is widely used in systems due to its simple, universal, convenient, and low-cost characteristics.


1. Digital filtering method

On the basis of multiple sampling of analog signals, digital filtering is the process of using software algorithms to obtain data that is closest to the true value. The permission parameters of digital filtering algorithms can be selected, but hardware filtering circuits often fail to achieve their effectiveness.


2. Duplicate detection method for input signals

Pounds per square inch

The interference of the input signal is a series of discrete peaks superimposed on the effective level signal, and its action time is very short.

When there is input interference in the control system and the hardware cannot successfully suppress it, software can be used to repeat the detection process until two or more consecutive collection results are completely consistent.


If the signal constantly changes, an alarm signal can be triggered when the maximum number of times is reached. This input method can be used to receive signals from various switch type sensors, such as limit switches, travel switches, operation buttons, etc.

Wider interference can be addressed by inserting delays between consecutive data collections.


3. Refresh method for output port data

The anti-interference design of switch output software mainly adopts the method of repeated output, which is an effective measure to improve the anti-interference performance of the output interface. The control signal generated by the latch requires these protective measures.


The data is repeatedly output in the shortest possible time, and the correct information is received before the interfered device has time to respond, thereby avoiding misoperation in real-time. The data buffer used for outputting data can be established in the program's structure, and the data can be output in the program's periodic loop.


For incremental control devices, it is not possible to repeatedly transmit data in this way. Only through the detection channel can the correctness of data transmission be determined from the feedback information of the device. The working mode control word and output status word are regularly set together to ensure consistent operation of the output module when executing the repetitive output function of the programmable interface chip.


4. Software interception technology

If the interference entering the microcontroller system affects the CPU, the impact will be even more catastrophic,


The most common problem is breaking the state of the program counter PC, which can cause the program to jump from one area to another, or "fly arbitrarily" in the address space, or fall into a "confirmation loop"


Software interception technology can intercept "random flight" programs, or delete the "confirmation loop" of the program to return it to the right track and guide it to the specified program entry.


5. "Software Watchdog" Technology

The PC is unstable and uncontrollable, causing the program to "fly out of sequence" or fall into a "deterministic loop". When software interception technology cannot free runaway programs from the problem of "endless loops," program monitoring technology WDT TIMER (WDT), also known as watchdog technology, is usually used to free programs.


WDT is a combination of software and hardware that prevents programs from losing control. The hardware body of this device is a counter that generates timing T or a monostable counter. This counter is sometimes referred to as a monostable counter and is essentially independent, with its timed output connected to the reset line of the CPU. The CPU is responsible for clearing its timing.


Under normal circumstances, the CPU will regularly clear WDT after program startup to prevent WDT timing overflow and not produce a sleep like effect. When WDT time overflows, its output will reset the system to avoid CPU paralysis due to temporary interference conditions. When the WDT timing overflows, its output will reset the system to prevent the CPU from being paralyzed due to temporary interference.


4 pounds per square inch

Nine Summary

With the widespread application of microcontroller systems and technological progress, electromagnetic interference issues have become increasingly important. The focus of microcontroller application technology includes promoting existing and mature anti-interference technologies, as well as researching new anti-interference technologies and new directions. If the Electromagnetic compatibility of the equipment is fully considered in the design and application process, and the interference is minimized through various technical means, the stability and reliability of the single-chip microcomputer application system can be greatly improved.


Recommend News

Copyright © UDU Semiconductor