Professional PCB manufacturing and assembly
Building 6, Zone 3, Yuekang Road,Bao'an District, Shenzhen, China
+86-13923401642Mon.-Sat.08:00-20:00
PCB Design
PCB Design
How to Deal with Electromagnetic Compatibility in the Design of Single Chip Microcomputer
04Dec
Andy 0 Comments

How to Deal with Electromagnetic Compatibility in the Design of Single Chip Microcomputer

How to Deal with Electromagnetic Compatibility in the Design of Single Chip Microcomputer

For novices, they may not pay much attention to the influence of electromagnetic interference on the input and output of the design itself in the circuit design of the single-chip microcomputer, but for an electronic engineer, it is self-evident that it is not only related to the ability and accuracy of the single-chip microcomputer in controlling, but also related to the competition of enterprises in the industry. For the design of electromagnetic interference, we mainly deal with it from the hardware and software aspects. The following is the introduction to the treatment of electromagnetic compatibility from the PCB design of MCU to the software processing.

Factors affecting EMC

1. Voltage

The higher the power supply voltage is, the greater the voltage amplitude is, and more emissions will occur. The lower the power supply voltage affects the sensitivity.

2. Frequency

High frequency generates more emission, and periodic signal generates more emission. In the high frequency single chip microcomputer system, the current spike signal is generated when the device is switched; In an analog system, current spikes are generated when the load current changes.

3. Grounding

Among all EMC problems, the main problem is caused by improper grounding.

There are three signal grounding methods:

1. Single point, multi-point and mixed. When the frequency is lower than 1MHz, the single point grounding method can be used, but it is not suitable for high frequency;

2. In high-frequency applications, multi-point grounding is recommended;

3. The hybrid grounding is the method of single point grounding for low frequency and multi-point grounding for high frequency. Ground wire layout is the key. The ground circuit of high frequency digital circuit and low level analog circuit should not be mixed.

4. PCB design

Proper PCB wiring is essential to prevent EMI.

5. Power supply coupling

When the device is switched, transient currents will be generated on the power line, and these transient currents must be attenuated and filtered.

The transient current from the high di/dt source leads to the "emission" voltage of the ground and the trace, and the high di/dt generates a large range of high-frequency current to stimulate the radiation of components and cables.

The current change and inductance flowing through the wire will lead to voltage drop, and the voltage drop can be reduced by reducing the inductance or the change of current with time.

Hardware processing method for interference measures

1. Electromagnetic compatibility design of printed circuit board (PCB)

PCB is the supporting part of circuit components and devices in the microcontroller system, which provides the electrical connection between circuit components and devices. With the rapid development of electronic technology, the density of PCB is getting higher and higher.

The quality of PCB design has a great impact on the electromagnetic compatibility of the single-chip microcomputer system. Practice has proved that even if the circuit schematic is correctly designed and the printed circuit board is improperly designed, the reliability of the single-chip microcomputer system will be adversely affected.

For example, if two thin parallel lines of the printed circuit board are close together, the delay of the signal waveform will be formed and the reflected noise will be formed at the end of the transmission line.

Therefore, when designing printed circuit boards, attention should be paid to adopting correct methods, following the general principles of PCB design, and meeting the anti-interference design requirements. In order to obtain good performance of electronic circuits, the layout of components and wires is very important.

2. EMC design of input/output

In the SCM system, the input/output is also the transmission wire of the interference source, and the pickup source for receiving RF interference signals. In general, we should take effective measures when designing:

① Necessary common mode/differential mode suppression circuits shall be adopted, and certain filtering and anti electromagnetic shielding measures shall be taken to reduce the advance of interference.

② If conditions permit, various isolation measures (such as photoelectric isolation or magnetoelectric isolation) shall be taken as far as possible to block the propagation of interference.


printed circuit board


3. Design of reset circuit of single chip microcomputer

In the microcontroller system of, the watchdog system plays a particularly important role in the operation of the entire microcontroller. Because all interference sources cannot be isolated or removed, once the CPU interferes with the normal operation of the program, the reset system combined with software processing measures will become an effective error correction defense barrier.

There are two common reset systems:

① External reset system. The external "watchdog" circuit can be designed or built with a special "watchdog" chip.

However, they have their own advantages and disadvantages. Most of the special "watchdog" chips cannot respond to low-frequency "dog feeding" signals, while high-frequency "dog feeding" signals can respond, so that they can generate reset action under low-frequency "dog feeding" signals and not reset action under high-frequency "dog feeding" signals. In this way, if the program system is trapped in an endless cycle, and there happens to be a "dog feeding" signal in the cycle, Then the reset circuit cannot realize its due function.

However, we can design a system consisting of band-pass "dog feeding" circuit and other reset circuits, which is a very effective external monitoring system.

② Now more and more single-chip microcomputers have their own on-chip reset systems, so that users can easily use their internal reset timers. However, there are some models of single-chip microcomputers whose reset instructions are too simple, so there will also be "dog feeding" instructions like the above endless loop, which makes them lose their monitoring role.

Some SCM chip reset instructions do a better job. Generally, they make the "dog feeding" signal into a fixed format of multiple instructions to execute in order. If there is a certain error, the "dog feeding" operation is invalid, which greatly improves the reliability of the reset circuit.

4. Oscillator

Most single chip microcomputers 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 connected externally should be as short as possible.

RC oscillators are potentially sensitive to interference signals, which can produce very short clock cycles. Therefore, crystal or ceramic resonators are recommended. In addition, the shell of quartz crystal shall be grounded.

5. Lightning protection measures

The lightning protection of the system shall be considered for the single chip microcomputer system used outdoors or the power line and signal line introduced from outdoors. Common lightning protection devices include: gas discharge tube, TVS (Transient Voltage Suppression), etc.

When the voltage of the power supply is greater than a certain value, it is usually tens or hundreds of volts. The gas breaks down and discharges, leading the strong impact pulse on the power line to the ground.

TVS can be seen as two Zener diodes in parallel and in opposite directions. When the voltage at both ends is higher than a certain value, the TVS will conduct. Its characteristic is that it can transiently pass hundreds or even thousands of amperes.

Software processing method for interference measures

The interference signal generated by the electromagnetic interference source cannot be completely eliminated under some specific circumstances (such as under some harsh electromagnetic environment), and will enter the core unit processed by the CPU. In this way, some large-scale integrated circuits are often interfered, resulting in failure to work normally or in an error state.

In particular, devices such as RAM that use bistability for storage tend to flip under strong interference, making the original "0" become "1", or "1" become "0"; The time sequence and data of some serial transmission will change due to interference; More seriously, some important data parameters will be damaged; The consequences are often very serious.

In this case, the quality of software design directly affects the anti-interference ability of the whole system.

1. The program will roughly meet the following conditions due to electromagnetic interference:

① The program runs.

This is a very common interference result. Generally speaking, a good reset system or software frame measurement system is enough, and it will not have too much impact on the entire operating system.

② Loop or abnormal program code operation.

Of course, this kind of endless loop and abnormal program code is not intentionally written by designers. We know that program instructions are composed of bytes, some are single byte instructions and some are multi byte instructions. When interference occurs, the PC pointer changes, so that the original program code is reorganized to produce unpredictable executable program code.

Then, this error is fatal. It may modify important data parameters, and may generate a series of error states such as unpredictable control output.

2. Measures for storage of important parameters

Generally, 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 the data is written in, a check code with a certain number of digits is generated according to the written data and saved together with the corresponding data; When reading, the check code is also read out to make a decision.

If an error occurs, it will be corrected automatically, the correct data will be sent, and the corrected data will be written back to overwrite the original error data at the same time; If a two bit error occurs, an interrupt report is generated to notify the CPU to handle the exception.

All these actions are automatically completed by software design, with the characteristics of real-time and automatic completion. Through such design, the anti-interference ability of the system can be greatly improved, thus improving the reliability of the system.

Error detection and correction principle:

·First, let's look at the basic principles of error detection and correction. The basic idea of error control is to add redundant codes in different ways in the information code group with certain rules, so that errors can be found or automatically corrected by relying on redundant monitoring codes or correction codes when information is read out.

·According to the characteristics of error code occurrence, that is, the randomness and small arbitrariness of error occurrence, it almost always randomly affects a bit in a byte. Therefore, if we can design an automatic correction of a bit error, we can check the coding mode of two bit errors. Can greatly improve the reliability of the system.

3. Detection of RAM and FLASH (ROM)

When compiling the program, we suggest to write some detection programs to test the data code of RAM and FLASH (ROM) to see if there is any error. Once it occurs, it should be corrected immediately. If it cannot be corrected, it should give error instructions in time for the user to handle.

In addition, it is indispensable to add program redundancy when programming. Adding three or more NOP instructions in a certain place can effectively prevent program reorganization.

At the same time, sign data and detection status should be introduced into the running state of the program, so that errors can be found and corrected in time. PCB design, PCB processing manufacturers introduce the PCB design of single-chip microcomputer to software processing to introduce the EMC processing.

Just upload Gerber files, BOM files and design files, and the KINGFORD team will provide a complete quotation within 24h.