Anti-interference measures in single chip microcomputer system application

Publisher:angelbabyLatest update time:2011-11-28 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Anti-interference measures in single chip microcomputer system application

Aiming at the interference problem in the application of single-chip microcomputer system, several anti-interference measures are introduced, which effectively improve the operating reliability of single-chip microcomputer system.
Keywords: single-chip microcomputer; anti-interference; program; software; hardware

Power Grid, Jiang men 529100, China)
The usual protective measures are as follows:
(1) Power supply system
In microcomputer systems, the most serious source of interference is power supply pollution. In order to prevent interference introduced from the power supply system, the power supply of the microcomputer should be separated from the power supply of high-power electrical equipment, preferably separately; second, a low-pass filter should be connected in series to the primary of the power transformer of the single-chip microcomputer system (as shown in Figure 1) to effectively prevent high-order harmonics from entering the system, improve the power supply waveform, and enhance the anti-interference ability of the single-chip microcomputer system.
(2) Input and
output channels The input and output channels are the paths for information transmission between the single-chip microcomputer and the sensor, the single-chip microcomputer and the host computer, and the single-chip microcomputer and the actuator. In microcomputer systems, the information on the transmission line is mostly pulse waves and weaker measurement signal voltages, which will cause attenuation, delay, and distortion during long-distance transmission. Signal isolation is a necessary and effective measure to resist external interference. It isolates the common mode voltage of the outside world and the electromagnetic interference of the outside world, thereby ensuring the working environment of the single-chip microcomputer and enabling the normal operation of the entire system.
?
2.1 Program running monitoring system
The program running monitoring system, also known as the "watchdog", is an effective circuit to prevent the computer system from freezing. Some single-chip microcomputers (80C552, etc.) include a "watchdog" circuit on the chip; the program running monitoring system can also be implemented with a dedicated hardware circuit. Once the "watchdog" circuit is started, if the reset pulse sent by the CPU is not received within the specified time, the "watchdog" circuit will send a "reset" pulse to the CPU.
2.2 Hardware Flag
In many industrial control systems, the system startup is carried out in a certain order, and the equipment is not allowed to restart in this order midway. Once the single-chip microcomputer system is reset, it must be accurately determined whether it is a power-on reset. Because out-of-control programs often have illegal write operations, the reliability of software flags is low. In situations where reliability is required to be high, a hardware power-on flag is usually set (as shown in Figure 2).
?
(2) System reset due to "watchdog". The initialization program checks that the hardware flag is valid (the Q end of the D flip-flop in Figure 2 remains "0"), and the system is abnormally reset. The initialization program will turn to the exception handling program.
It can be seen that the microcomputer system can accurately determine the cause of the reset, and thus take corresponding handling procedures, effectively improving the reliability of the system.
?
There are some double-byte and three-byte instructions in the MCS-51 instruction system. When the program bounces to the operands of these instructions, the operands will be regarded as instructions, resulting in erroneous results. Therefore, inserting two empty operation instructions in important places in the program (such as jumps, subroutines, etc.) can intercept the bounced program and turn it into normal.
3.2 Establishing software traps
The so-called "software trap" is a set of program segments added to the program to intercept the bounced program. It forces the program to turn to a specific address, where the error handling program is placed. If the entry label of the error handling program is named "ERR", the software trap usually consists of the following three sentences:

Once the bounced program is intercepted, immediately turn to the error handling program.
3.3 Error handling program
The common point of the error handling program is to turn off the interrupt first to prevent the situation from escalating. For systems with a "watchdog" circuit, just wait for reset. However, software reset is different from hardware "watchdog" reset. At this time, the status of the registers and I/O ports in the CPU chip is uncertain. Therefore, before the error handling program turns to the program starting point, it must reset the registers in the CPU chip, the activated interrupt flags, and the I/O port "software", enter the initial state, and then turn to the program starting point.
3.4 Other measures
In the control system composed of single-chip microcomputers, the output of the adjustment quantity is constantly changing. After the single-chip microcomputer system is disturbed and abnormally reset, the status of the flag unit, output buffer unit, and I/O port in the RAM area may change, and the data cannot be restored as the state after the system is reset. At this time, the manual given quantity can be used as the current controller output quantity. These measures can effectively reduce the disturbance caused to the entire system after the single-chip microcomputer is abnormally reset.
Reference address:Anti-interference measures in single chip microcomputer system application

Previous article:New M-Series Products Set Higher Standards for Data Collection
Next article:The current status and existing problems of FCS technology application in China

Latest Analog Electronics 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号