Precision PCB Fabrication, High-Frequency PCB, High-Speed PCB, Standard PCB, Multilayer PCB and PCB Assembly.
The most reliable PCB & PCBA custom service factory.
PCB Technical

PCB Technical - Electromagnetic Compatibility (EMC) Design of Single Chip Microcomputer System

PCB Technical

PCB Technical - Electromagnetic Compatibility (EMC) Design of Single Chip Microcomputer System

Electromagnetic Compatibility (EMC) Design of Single Chip Microcomputer System

2021-08-17
View:524
Author:ip'c'b

The electromagnetic compatibility (EMC) design of the single-chip microcomputer system mentioned in this article is mainly designed from the two aspects of hardware and software. Next, the electromagnetic compatibility (EMC) design from the PCB board design of the single-chip microcomputer to the software processing is introduced. handle.


Factors affecting electromagnetic compatibility (EMC)


(1) PCB board design: Proper PCB board wiring is essential to prevent electromagnetic interference (EMI).


(2) Voltage: The higher the power supply voltage, the greater the voltage amplitude, the more emission, and the low power supply voltage affects the sensitivity.


(3) Power decoupling: When the device is switched on and off, transient currents will be generated on the power line, and these transient currents must be attenuated and filtered. Transient currents from high di/dt sources cause ground and trace "emission" voltages. High di/dt generates a wide range of high-frequency currents that excite components and cables to radiate. The current change and inductance flowing through the wire will cause a voltage drop, which can be minimized by reducing the inductance or current change over time.


(4) Grounding: In all electromagnetic compatibility (EMC) problems, the main problem is caused by improper grounding. There are three signal grounding methods: single-point grounding, multi-point grounding, and mixed grounding. When the frequency is lower than 1MHz, the single-point grounding method can be used, but it is not suitable for high-frequency; in high-frequency applications, it is best to use multi-point grounding. Hybrid grounding is a single-point grounding method for low frequency and multi-point grounding for high frequency. The ground wire layout is the key, and the ground circuits of high-frequency digital circuits and low-level analog circuits must not be mixed.


(5) Frequency: High frequency produces more emission, and periodic signal produces more emission. In the high-frequency single-chip microcomputer system, the current spike signal is generated when the device is switched; in the analog system, the current spike signal is generated when the load current changes.


Hardware processing method for interference measures


(1) Design of MCU reset circuit


In the single-chip microcomputer system, the watchdog system plays a particularly important role in the operation of the entire single-chip microcomputer. Since all interference sources cannot be isolated or eliminated, once the CPU interferes with the normal operation of the program, the reset system is combined with software processing The measures have become an effective defense against error correction. There are two commonly used reset systems:


1) External reset system.


The external "watchdog" circuit can be designed by yourself or built with a special "watchdog" chip. However, they have their own advantages and disadvantages. Most of the dedicated "watchdog" chips cannot respond to low-frequency "feeding dog" signals, while high-frequency "feeding dog" signals can respond, so that they can be generated under low-frequency "feeding dog" signals. The reset action does not produce a reset action under the high-frequency "feeding dog" signal. In this way, if the program system is trapped in an infinite loop, and there happens to be a "feeding dog" signal in the loop, then the reset circuit cannot realize it. The function it should have. However, we can design a system with a band-pass "feeding dog" circuit and other reset circuits to form a very effective external monitoring system.


2) On-chip reset system.


Now more and more single-chip microcomputers have their own on-chip reset system, so that users can easily use their internal reset timer. However, there are some models of single-chip microcomputers whose reset instructions are too simple. There is a "feed dog" instruction like the above-mentioned infinite loop, which makes it lose its monitoring function. Some microcontrollers have on-chip reset instructions that do better. Generally, they make the "feeding dog" signal into multiple instructions in a fixed format and execute them in sequence. If there is a certain error, the "feeding dog" operation is invalid. Improved the reliability of the reset circuit.


(2) The electromagnetic compatibility (EMC) design of the input/output in the single-chip microcomputer system


In the single-chip microcomputer system, the input/output is also the conduction line of the interference source, and the pick-up source for receiving the radio frequency interference signal. We must take effective measures when designing the electromagnetic compatibility (EMC):


1) Use necessary common-mode/differential-mode suppression circuits, and also take certain filtering and anti-electromagnetic shielding measures to reduce the entry of interference.


2) When conditions permit, adopt various isolation measures (such as photoelectric isolation or magnetoelectric isolation) as much as possible to block the spread of interference.


(3) Electromagnetic compatibility (EMC) design of PCB board


The PCBboard is the support of the circuit elements and devices in the single-chip microcomputer system, and it provides electrical connections between the circuit elements and the devices. With the rapid development of electronic technology, the density of PCB boards is getting higher and higher. The quality of the PCB board design has a great influence on the electromagnetic compatibility (EMC) of the single-chip microcomputer system. Practice has proved that even if the circuit schematic design is correct and the printed circuit board is designed improperly, it will also adversely affect the reliability of the single-chip microcomputer system. If the two thin parallel lines of the printed circuit board are close together, it will cause a delay in the signal waveform and form reflected noise at the end of the transmission line. Therefore, when designing a printed circuit board, the correct method should be adopted, the general principles of PCB board design should be followed, and the design requirements for anti-interference should be met. To get the best performance of the electronic circuit, the layout of the components and the layout of the wires are very important.


(4) Lightning protection measures


For the single-chip microcomputer system used outdoors or the introduction of indoor power lines and signal lines from the outside, the lightning protection of the system must be considered. Commonly used lightning protection devices are: gas discharge tube, TVS, etc. The gas discharge tube is when the voltage of the power supply is greater than a certain value, usually tens of V or hundreds of V, the gas breakdown discharges, and the strong shock pulse on the power line is led into the earth. TVS can be seen as two Zener diodes connected in parallel and in opposite directions, which are turned on when the voltage at both ends is higher than a certain value. Its characteristic is that it can pass hundreds or thousands of A currents transiently.


(5) Oscillator


Most microcontrollers have an oscillator circuit coupled to an external crystal or ceramic resonator. On the PCB board, it is required that the lead wires of capacitors, crystals or ceramic resonators should be as short as possible. The RC oscillator is latently sensitive to interference signals, and it can generate a very short clock cycle, so it is best to choose a crystal or ceramic resonator. In addition, the shell of the quartz crystal should be grounded.

ATL

Software processing methods for interference measures


The interference signal generated by the electromagnetic interference source cannot be completely eliminated in some specific situations (such as in some severe electromagnetic environment), and will eventually enter the core unit of the CPU processing, so that it will be integrated in some large-scale Circuits are often disturbed, resulting in not working properly or working in an error state. In particular, devices such as RAM that use bistable storage for storage will often flip under strong interference, causing the originally stored "0" to become "1" or "1" to "0"; some serial The transmission sequence and data will change due to interference; more serious ones will destroy some important data parameters, etc.; the resulting consequences are often very serious. In this case, the quality of the software design directly affects the anti-interference ability of the entire system.


(1) Detection of RAM and FLASH (ROM)


When compiling the program, we’d better write some testing programs to test the RAM and FLASH (ROM) data codes to see if there are any errors. Once they occur, they must be corrected immediately. If they cannot be corrected, an error indication must be given in time for the user to deal with. . It is indispensable to add program redundancy when we compile the program. Adding three or more NOP instructions in a certain place has a very effective preventive effect on program reorganization. At the same time, it is necessary to introduce flag data and detection status in the running status of the program, so as to discover and correct errors in time.


(2) Measures to store important parameters


Under normal circumstances, we can use error detection and correction to effectively reduce or avoid this situation. According to the principle of error detection and correction, the main idea is that when data is written, a certain number of check codes are generated according to the written data and stored together with the corresponding data; when read, the check code is also checked at the same time The code is read and the judgment is made. If a one-bit error occurs, it will be automatically corrected, the correct data will be sent out, and the corrected data will be written back to overwrite the original wrong data at the same time; if a two-bit error occurs, an interrupt report will be generated and the CPU will be notified for exception handling. All these actions are automatically completed by software design, with the characteristics of real-time and automatic completion. Through such a design, the anti-interference ability of the system can be greatly improved, thereby improving the reliability of the system.


Principles of error detection and correction:


First, let's take a look at the basic principles of error detection and correction. The basic idea of error control is to add redundant codes in different ways to the information code group according to certain rules, so that when the information is read, redundant monitoring codes or calibration codes can be used to find or automatically correct errors. In view of the characteristics of error occurrence, that is, the randomness and randomness of error occurrence, it almost always randomly affects a bit in a byte. Therefore, if the design can automatically correct a bit error, and Check the encoding method for two errors. Can greatly improve the reliability of the system.


(3) Due to electromagnetic interference procedures, there are roughly the following situations:


1) The program runs away.


This situation is the most common interference result. Generally speaking, a good reset system or software frame test system is enough, and it will not have much impact on the entire running system.


2) Infinite loop or abnormal program code operation.


Of course, this kind of infinite loop and abnormal program code is not intentionally written by the designer. We know that the program instructions are composed of bytes, some are single-byte instructions and some are multi-byte instructions. When interference occurs, the PC pointer occurs. Change, so that the original program code has been reorganized to produce unpredictable executable program code, then, this kind of error is fatal, it may modify important data parameters, may produce unpredictable control A series of error states such as output.


The above is the design and processing of the electromagnetic compatibility (EMC) of the single-chip microcomputer system from the two aspects of hardware and software.