With the development of industrial control, the single-chip microcomputer application system has gradually replaced the analog control system with its high cost performance and has been widely used in various fields. There are various interference sources in the application site, which have a great impact on the work of the single-chip microcomputer application system. The control system designed in the laboratory fully meets the design requirements during installation and debugging, but after being placed in the field, the system often cannot work normally and stably. Although interference cannot directly cause hardware damage, it often prevents the computer from operating normally, resulting in control failure, causing equipment and production accidents. Therefore, in order to ensure that the equipment works reliably in actual applications, the requirements for the system's anti-interference performance must be fully considered from the beginning of system design.
1 Interference sources, interference paths and impacts
1.1 Application system’s own interference sources and interference paths
The interference source of the application system itself is due to the incomplete consideration of certain issues when designing the system, such as unreasonable layout of components, unreliable circuit operation, poor quality of components, etc., which form interference such as resistor thermal noise interference, semiconductor shot noise interference, contact noise interference, process channel interference, interference formed by common resistance, etc. These interference phenomena become more obvious as the current of the flowing components increases. These noise currents affect the system through the system's own circuits and channels, resulting in a decrease in the system's control accuracy.
1.2 Electromagnetic interference sources and interference paths
There are many sources of electromagnetic interference in industrial sites, such as multiple re-ignition during the arc breaking process of power circuit breakers, resonance of electromagnet coil inductance and distributed capacitance, electromagnetic radiation of high current arcs, strong alternating electric and magnetic fields near power frequency transmission lines, and electromagnetic waves from celestial bodies such as the sun, lightning, and changes in the geomagnetic field. All of these can be attributed to electromagnetic interference. Interference signals enter the control system through mutual inductance coupling and capacitance coupling between wires or loops. The consequences of electromagnetic interference can cause errors in the control system at the least, or even cause the system to fail to work properly at the worst.
1.3 Power supply system interference
Due to the large number of high-power equipment running on industrial sites, especially the start and stop of large inductive load equipment, the grid voltage surges and sags significantly, and sometimes there will be long-term overvoltage, undervoltage and short-term spike voltage. They can easily enter the control system through the power line in the form of line transmission. Among them, overvoltage interference is the worst interference in the single-chip control system.
1.4 Consequences of interference
Interference often causes the system program to "run away", resulting in "freeze", increased data collection errors or data changes, control state failure, instability or erroneous operation of the system controlled object, etc.
2 Hardware anti-interference technology of application system
The general principle of hardware anti-interference is to eliminate interference sources, cut off interference intrusion paths and design low-noise circuits.
2.1 Measures to suppress electromagnetic interference
Industrial microcomputer systems are more affected by various electromagnetic interferences than general computers. Electromagnetic interference may come from outside the system or from inside the system. The main means of suppressing electromagnetic interference is shielding. There are two ways: one is to shield the easily interfered circuits or equipment to prevent receiving radiation interference; the other is to shield the radiation source to prevent the radiation from affecting other circuits. In addition, the system can be floated (such as the signal ground is not connected to the housing or the ground) to block the path of the interference current, and the circuits with radiation capabilities inside the equipment should be independently remote to reduce the impact on other circuits.
2.2 Suppression of process channel interference
(1) Photoelectric coupling isolation. Photoelectric coupling can cut off the connection between the host and the forward and backward channel circuits and other host circuits, which can effectively prevent interference from entering the host from the process channel. It is also beneficial to combat common ground interference.
(2) Twisted pair transmission: Twisted pair can offset the electromagnetic induction interference of each small loop, and has a certain inhibitory effect on electromagnetic field interference and common mode noise.
(3) Impedance matching for long-distance transmission requires that the output impedance of the signal source, the characteristic impedance of the transmission line, and the input impedance of the receiving end be equal. Otherwise, the signal will be reflected on the transmission line, causing distortion.
2.3 Anti-interference design of printed circuit boards
The circuit board is a high-density collection of components, signal lines, and power lines in the microcomputer system, which has a great impact on the anti-interference performance. Improper circuit board design, wiring, and grounding may cause the entire system to fail to operate normally.
(1) Printed circuit board: The size should be moderate. If it is too large, the printed lines will be long, the impedance will increase, the anti-noise ability will decrease, and the cost will be high; if it is too small, the heat dissipation will be poor and it will be susceptible to interference. Try to use multi-layer printed circuit boards to ensure a good grounding network and reduce the ground potential difference.
(2) Component layout: Place related components close to each other. Circuits that are prone to noise should be kept as far away from the host circuit as possible. Devices that generate a lot of heat should consider heat dissipation. I/O driver components should be placed as close to the edge of the printed circuit board as possible. Closed IC pins should not be left floating, and component pins should not be parallel to each other to reduce parasitic coupling. If possible, use surface mount components.
(3) Wiring: The connection between circuits should be as short as possible. Signal lines that are susceptible to interference should be protected and should not be parallel to lines that can generate or transmit interference for a long distance. AC and DC circuits should be separated. For printed circuit boards with double-sided wiring, the lines on both sides should cross vertically to reduce the magnetic field coupling effect.
(4) Grounding: The AC ground and signal ground cannot be shared to reduce the interference of the power supply on the signal; the digital ground and analog ground should be designed separately and connected at the power supply end; for multi-stage circuits, the dynamic current of each stage should be considered during design, and the influence of mutual coupling of ground impedance should be noted. When the operating frequency is lower than 1 MHz, single-point grounding is adopted, and when the operating frequency is higher, multi-point grounding is adopted. The grounding wire should be as thick as possible.
(5) Decoupling capacitor: Adding decoupling capacitors is a common practice in printed circuit board design. Connect a 10-100 μF electrolytic capacitor or tantalum capacitor across the power input terminal, and install a 0.01 μF ceramic capacitor on each integrated circuit chip.
2.4 Anti-interference measures for power supply system
(1) Using an AC voltage stabilizer can prevent overvoltage and undervoltage interference in the power grid and ensure the stability of power supply.
(2) The primary and secondary of the transformer are isolated by a shielding layer to reduce the distributed capacitance between them and improve the common-mode anti-interference capability.
(3) Low-pass filters can filter out high-order harmonics caused by interference.
(4) The entire system uses a discrete power supply method to supply power to each part separately.
(5) Use a switching power supply and provide sufficient power margin.
3 Software Anti-interference Technology of Application System
If the system has an error or freezes, you can solve it by manual reset, timed reset, etc., or you can use the following method to achieve anti-interference.
3.1 Inserting no-operation instructions into the program (instruction redundancy)
During the execution of the program, the CPU may treat some operands as instruction codes after being disturbed, causing program confusion. We should get the program back on track as soon as possible. The instructions of the MCS51 series microcontrollers do not exceed 3 B. When the program jumps to a single-byte instruction, it can be automatically put on track. When it jumps to a double-byte or three-byte instruction, it may fall on the operand and continue to make mistakes. When designing software, single-byte instructions should be used more, and NOP instructions should be inserted in some key places. For example, insert two NOP instructions after double-byte and three-byte instructions. In addition, insert two NOP instructions before some instructions that play a decisive role in the flow of the program (such as RET, RETI, ACALL, LCALL, SJMP, AJMP, LJMP, JZ, JNZ, JC, JNC, JB, JNB, JBC, CJNE, DJNZ) to ensure that the jumping program is quickly put on track.
3.2 Using software traps
When the CPU is disturbed and the program is bounced to the non-program area, the software redundancy is powerless. You can set up interception measures in the non-program area to trap the program, force the program to enter a specified address, and execute a program that is specifically designed to handle program errors. The software trap consists of three instructions, where ERR is the specified address:
NOP
NOP
LJMP ERR
Software traps are often placed in the following four places:
(1) Unused interrupt areas. When interference opens unused interrupts and activates them, it will cause program confusion. If software traps are set in these places, error interrupts can be caught in time. If three interrupts are used in the MCS51 system: INT0, INT1, T1, and their interrupt subroutines are located in PINT0, PINT1, PT1, T0, and the serial port does not use interrupts, the interrupt vector area can be set as follows:
(2) Large unused ROM space. For unused ROM cells, they are normally OFFH. After the program is bounced to this area, if there is no new interference, it will be executed sequentially without jumping. As long as a software trap is set every other area and other cells remain unchanged at 0FFH, the program that is bounced here can be captured.
(3) Program area. The program area consists of a series of execution instructions. When the program executes unconditional transfer instructions such as LJMP, SJMP, AJMP, and RET, the value of PC should jump normally. At this time, the program cannot continue to execute in sequence. If a software trap is set after these instructions, the program that jumps here can be intercepted without affecting the normal execution process.
(4) Data table area. In order not to destroy the continuity of the table, a software trap can be set at the end of the data table area. The software trap is placed in a place where the normal program cannot be executed, which does not affect the efficiency of program execution. Under the condition that the E2PROM capacity allows, setting more software traps is beneficial and harmless.
.3 Sleep anti-interference
Some single-chip microcomputers have a sleep state, in which only the timing/counting system and the interrupt system are in working state. At this time, the CPU will not respond to the interference on the three bus of the system, thereby greatly reducing the sensitivity of the system to interference. In the application system, the CPU is often executing some waiting instructions and loop checking programs. Since the CPU has no important work at this time, it is awake and easily disturbed. The CPU can be put into sleep during abnormal operation, and the interrupt system can wake it up when necessary, and then enter the sleep state after the work is completed. With this arrangement, the CPU can be in sleep state for more than 60% of the time, thereby greatly reducing the threat of random interference to the CPU, and also reducing the power consumption of the CPU.
4. "Watchdog" Technology
When the program flies into a temporary dead loop or the PC pointer falls outside the address of the program memory chip, redundant instructions and software traps are powerless to prevent it, and the system will be completely paralyzed. In this case, there is only a reset. There is a WDT monitoring timer inside the MCS96 and 8XC552 series of microcontrollers. It is a 16-bit counter. The input is the system clock. After the WDT is started, it starts to count the clock. When it overflows, an appropriate reset signal can appear at the RESET end to reset the system. Under normal circumstances, in order to prevent the WDT from overflowing and resetting the entire system, the WDT can be cleared periodically with instructions in the program. When the program is disturbed and the WDT is not cleared regularly, the overflow of the WDT will reset the system and resume operation.
In Figure 1, RST is the external reset pin and the WDT start pin. When it is "0", the "watchdog" starts to work and counts the divided pulses. When the count overflows, the microcontroller and peripheral circuits are reset. When programming, in order to prevent the monitoring timer T3 from overflowing, T3 needs to be written continuously. There is no WDT inside the MCS51 microcontroller, which can be realized by an external circuit. Figure 2 is a watchdog circuit composed of CD4060.
The counting frequency of 4060 is determined by RT and CT, and can also be connected to an external quartz crystal. Assume that the actual working cycle of the user program is T0; the full counting time of the frequency divider is T. When T>T0 and the system works normally, the program clears 4060 every T0, and CD4060 has no full counting output signal. If the system does not work properly, the program will not clear 4060. The frequency divider outputs a pulse signal when it is full counting to reset the CPU.
5 Conclusion
Anti-interference design is an important and indispensable part of the design of single-chip microcomputer application system. Hardware anti-interference is active, while software anti-interference is passive. Due to the variety of interference environments, the specific situation should be analyzed during design and targeted anti-interference measures should be selected. In engineering practice, several anti-interference methods are usually used together to complement each other to ensure the normal operation of the application system.
Previous article:Design of encryption fuse based on MSP430
Next article:Design considerations when upgrading MCU application systems from 16-bit to 32-bit
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- I recently used a chip that is compatible with both RS232 and RS485, but I don't know which pins are A and B for RS485.
- [ATmega4809 Curiosity Nano Review] Configuring GPIO using MCC
- Today at 10:30 AM Microchip Live | Manufacturing Logistics Challenges of Key Security Provisioning: Advantages of Discrete Secure Components
- Multisim circuit simulation does not oscillate?
- In order to solve network congestion, what black technologies does Wi-Fi 6 use?
- [Atria AT32WB415 Review] 1. Unboxing, installation and use of AT32 IDE development environment (especially error resolution)
- Please ask the experts about STM32, FSMC control LCD problem?
- Made a JLINK OB and shared the production process and experience
- Creating an embedded project using Rust
- I bought another development board with the highest integration, no doubt about it.