Experience summary of single chip microcomputer hardware design (anti-interference)

Publisher:电子艺术大师Latest update time:2016-08-02 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
(1) In terms of component layout, related components should be placed as close as possible. For example, clock generators, crystal oscillators, and CPU clock input terminals are prone to noise, so they should be placed closer together. For those devices that are prone to noise, small current circuits, large current circuits, switching circuits, etc., they should be kept as far away from the logic control circuits and storage circuits (ROM, RAM) of the microcontroller as possible. If possible, these circuits can be made into circuit boards separately, which is conducive to anti-interference and improves the reliability of circuit operation.  

(2) Try to install decoupling capacitors next to key components such as ROM, RAM and other chips. In fact, printed circuit board traces, pin connections and wiring may contain large inductance effects. Large inductance may cause severe switching noise spikes on the Vcc trace. The only way to prevent switching noise spikes on the Vcc trace is to place a 0.1uF electronic decoupling capacitor between VCC and the power ground. If surface mount components are used on the circuit board, chip capacitors can be directly placed close to the components and fixed on the Vcc pin. It is best to use ceramic capacitors because this type of capacitor has lower electrostatic loss (ESL) and high-frequency impedance. In addition, the dielectric stability of this capacitor over temperature and time is also very good. Try not to use tantalum capacitors because their impedance is higher at high frequencies.  

    The following points should be noted when placing decoupling capacitors:  
  • Connect an electrolytic capacitor of about 100uF across the power input terminal of the printed circuit board. If the volume allows, a larger capacitance will be better.  
  • In principle, a 0.01uF ceramic capacitor needs to be placed next to each integrated circuit chip. If the gap in the circuit board is too small to accommodate it, a 1~10uF tantalum capacitor can be placed for every 10 chips.  
  • For components with weak anti-interference ability, large current changes when turned off, and storage components such as RAM and ROM, a decoupling capacitor should be connected between the power line (Vcc) and the ground line.  
  • The leads of the capacitor should not be too long, especially high-frequency bypass capacitors should not have leads.  
 
(3) In the single-chip microcomputer control system, there are many types of ground wires, including system ground, shield ground, logic ground, analog ground, etc. Whether the ground wire layout is reasonable will determine the anti-interference ability of the circuit board. When designing the ground wire and grounding point, the following issues should be considered:  
  • The logic ground and analog ground should be wired separately and cannot be used together. Their respective ground wires should be connected to the corresponding power ground wire. When designing, the analog ground wire should be as thick as possible, and the grounding area of ​​the lead-out end should be as large as possible. Generally speaking, for the input and output analog signals, it is best to isolate them from the microcontroller circuit through an optical coupler.  
  • When designing a printed circuit board for a logic circuit, its ground wire should form a closed loop to improve the circuit's anti-interference ability.  
  • The ground wire should be as thick as possible. If the ground wire is very thin, the ground wire resistance will be large, causing the ground potential to change with the current, resulting in unstable signal level and reduced anti-interference ability of the circuit. If the wiring space allows, ensure that the width of the main ground wire is at least 2 to 3 mm, and the ground wire on the component pin should be around 1.5 mm.  
  • Pay attention to the selection of grounding points. When the signal frequency on the circuit board is lower than 1MHz, the electromagnetic induction effect between the wiring and the components is small, while the loop current formed by the grounding circuit has a greater impact on interference, so one-point grounding should be used to prevent it from forming a loop. When the signal frequency on the circuit board is higher than 10MHz, the inductance effect of the wiring is obvious, and the ground impedance becomes very large. At this time, the loop current formed by the grounding circuit is no longer a major problem. Therefore, multi-point grounding should be used to minimize the ground impedance.  
  • In addition to increasing the width of the power line as much as possible according to the current size, the routing direction of the power line and the ground line should be consistent with the routing direction of the data line. At the end of the wiring work, the ground line is used to fill the bottom layer of the circuit board where there is no routing. These methods are helpful to enhance the circuit's anti-interference ability.  
  • The width of the data line should be as wide as possible to reduce impedance. The width of the data line should be at least 0.3mm (12mil), and it is more ideal if it is 0.46-0.5mm (18mil-20mil).  
  • Since a via in a circuit board will bring about a 10pF capacitance effect, which will introduce too much interference to high-frequency circuits, the number of vias should be reduced as much as possible during wiring. In addition, too many vias will also reduce the mechanical strength of the circuit board.  
The hardware circuit design of a single-chip microcomputer application system includes two parts: one is system expansion, that is, when the functional units inside the single-chip microcomputer, such as ROM, RAM, I/O, timer/counter, interrupt system, etc., cannot meet the requirements of the application system, they must be expanded outside the chip, and appropriate chips must be selected and corresponding circuits designed. The second is system configuration, that is, peripheral devices such as keyboards, monitors, printers, A/D, D/A converters, etc. must be configured according to the system functional requirements, and appropriate interface circuits must be designed.  

    The expansion and configuration of the system should follow the following principles:  
  1. Try to choose typical circuits that conform to the conventional usage of single-chip microcomputers, laying a good foundation for the standardization and modularization of hardware systems.  
  2. The configuration level of system expansion and peripheral equipment should fully meet the functional requirements of the application system and leave appropriate room for secondary development.  
  3. The hardware structure should be considered together with the application software solution. The hardware structure and software solution will have mutual influence. The principle of consideration is: functions that can be realized by software should be realized by software as much as possible to simplify the hardware structure. However, it must be noted that the hardware functions realized by software generally have a longer response time than hardware implementation and occupy CPU time.  
  4. The performance of related devices in the system should be matched as much as possible. For example, when a CMOS chip is used to form a low-power system, all chips in the system should be low-power products as much as possible.  
  5. Reliability and anti-interference design are an essential part of hardware design, which includes chip, device selection, decoupling filtering, printed circuit board wiring, channel isolation, etc.  
  6. When there are many peripheral circuits in a single-chip microcomputer, its driving capability must be considered. When the driving capability is insufficient, the system will not work reliably. The bus load can be reduced by adding line drivers to enhance the driving capability or reducing the chip power consumption.  
  7. Try to design the hardware system in the direction of "single chip". The more components in the system, the stronger the mutual interference between components, the greater the power consumption, and the inevitable reduction of system stability. As the functions integrated in the microcontroller become more and more powerful, the real system-on-chip SoC has become possible. For example, the μPSD32×× series products recently launched by ST integrate the 80C32 core, large-capacity FLASH memory, SRAM, A/D, I/O, two serial ports, watchdog, power-on reset circuit, etc. on a single chip.  

Practice of Common Methods for Hardware Anti-interference in Single-Chip Microcomputer Systems  

The main factors that affect the reliable and safe operation of the MCU system mainly come from various electrical interferences inside and outside the system, and are affected by the system structure design, component selection, installation, and manufacturing process. These constitute the interference factors of the MCU system, which often cause the MCU system to malfunction, affecting product quality and output at the least, and causing accidents and major economic losses at the worst.
   
There are three basic elements that cause interference:  

  1. Interference source. Refers to the components, equipment or signals that generate interference. It is described in mathematical language as follows: du/dt. The place where di/dt is large is the interference source. For example, lightning, relays, thyristors, motors, high-frequency clocks, etc. may become interference sources.  
  2. Propagation path. Refers to the path or medium through which interference propagates from the interference source to the sensitive device. Typical interference propagation paths are conduction through wires and radiation through space.
  3. Sensitive devices. Refers to objects that are easily interfered with, such as A/D, D/A converters, single-chip microcomputers, digital ICs, weak signal amplifiers, etc.
 
Classification of interference   

1. Classification of interference There are many types of interference, which can usually be classified according to the cause of the noise, the conduction method, the waveform characteristics, etc.  
According to the cause of the noise, it can be divided into discharge noise, high-frequency oscillation noise, and surge noise. According to the conduction method, it can be divided into common mode noise and series mode noise. According to the waveform, it can be divided into continuous sine wave, pulse voltage, pulse sequence, etc.   

2. Interference coupling mode The interference signal generated by the interference source has an effect on the measurement and control system through a certain coupling channel. Therefore, it is necessary to look at the transmission mode between the interference source and the interfered object. The interference coupling mode is nothing more than through wires, space, common lines, etc., which can be broken down into the following types:  
  1. Direct coupling: This is the most direct way and the most common way in the system. For example, interference signals invade the system through power lines.   
  2. Common impedance coupling: This is also a common coupling method, which often occurs when the currents of two circuits have a common path. In order to prevent this coupling, it is usually necessary to consider it in circuit design. There should be no common impedance between the interference source and the interfered object.  
  3. Capacitive coupling: also known as electric field coupling or electrostatic coupling. It is the coupling caused by the existence of distributed capacitance.  
  4. Electromagnetic induction coupling: also known as magnetic field coupling. It is the coupling caused by distributed electromagnetic induction.  
  5. Leakage coupling: This coupling is purely resistive and occurs when the insulation is poor.   

Commonly used hardware anti-interference technology targets the three factors that cause interference, and the main anti-interference measures taken are the following.   

1. Suppressing interference sources Suppressing interference sources means reducing du/dt and di/dt of interference sources as much as possible. This is the most important and most important principle in anti-interference design, and it often achieves twice the result with half the effort. Reducing du/dt of interference sources is mainly achieved by connecting capacitors in parallel at both ends of the interference source. Reducing di/dt of interference sources is achieved by connecting inductors or resistors in series with the interference source loop and adding freewheeling diodes.
 
Common measures to suppress interference sources are as follows:  
  1. A freewheeling diode is added to the relay coil to eliminate the back electromotive force interference generated when the coil is disconnected. Adding only a freewheeling diode will delay the disconnection time of the relay. After adding a voltage regulator diode, the relay can operate more times per unit time.  
  2. Connect a spark suppression circuit (usually an RC series circuit, with a resistor ranging from a few K to tens of K and a capacitor of 0.01uF) in parallel at both ends of the relay contacts to reduce the impact of electric sparks.  
  3. Add a filter circuit to the motor, and make sure the capacitor and inductor leads are as short as possible.  
  4. Each IC on the circuit board should be connected in parallel with a 0.01μF~0.1μF high-frequency capacitor to reduce the impact of the IC on the power supply. Pay attention to the wiring of the high-frequency capacitor. The connection should be close to the power supply end and as thick and short as possible, otherwise, it will increase the equivalent series resistance of the capacitor, which will affect the filtering effect.  
  5. Avoid 90-degree bends when wiring to reduce high-frequency noise emissions.  
  6. An RC suppression circuit is connected in parallel at both ends of the thyristor to reduce the noise generated by the thyristor (this noise may cause the thyristor to break down if it is severe).
   
2. Cut off the interference propagation path. According to the propagation path of interference, it can be divided into two categories: conducted interference and radiated interference. The so-called conducted interference refers to the interference transmitted to sensitive devices through wires. The frequency bands of high-frequency interference noise and useful signals are different. The propagation of high-frequency interference noise can be cut off by adding filters to the wires, and sometimes it can be solved by adding isolation optocouplers. Power supply noise is the most harmful and special attention should be paid to its treatment. The so-called radiated interference refers to the interference transmitted to sensitive devices through space radiation. The general solution is to increase the distance between the interference source and the sensitive device, isolate them with ground wires, and add shielding covers to the sensitive devices.
 
Common measures to cut off interference propagation paths are as follows:  
  1. Fully consider the impact of power supply on the MCU. If the power supply is well made, the anti-interference of the entire circuit is mostly solved. Many MCUs are very sensitive to power supply noise. It is necessary to add a filter circuit or voltage stabilizer to the MCU power supply to reduce the interference of power supply noise on the MCU. For example, a π-shaped filter circuit can be formed by using magnetic beads and capacitors. Of course, when the conditions are not high, a 100Ω resistor can be used instead of a magnetic bead.  
  2. If the I/O port of the microcontroller is used to control noisy devices such as motors, isolation should be added between the I/O port and the noise source (add a π-shaped filter circuit).  
  3. Pay attention to the crystal oscillator wiring. Keep the crystal oscillator and the microcontroller pins as close as possible, isolate the clock area with a ground wire, and ground and fix the crystal oscillator shell.  
  4. Reasonable partitioning of circuit boards, such as strong and weak signals, digital and analog signals. Keep interference sources (such as motors and relays) and sensitive components (such as microcontrollers) as far away as possible.  
  5. Use ground wire to isolate the digital area from the analog area. The digital ground and analog ground should be separated and finally connected to the power ground at one point. The same principle applies to the wiring of A/D and D/A chips.  
  6. The ground wires of the microcontroller and high-power devices should be grounded separately to reduce mutual interference. High-power devices should be placed at the edge of the circuit board as much as possible.  
  7. 在单片机I/O口、电源线、电路板连接线等关键地方使用抗干扰元件如磁珠、磁环、电源滤波器、屏蔽罩,可显著提高电路的抗干扰性能。   

3. Improving the anti-interference performance of sensitive devices Improving the anti-interference performance of sensitive devices means minimizing the pickup of interference noise from the perspective of sensitive devices, and recovering from abnormal conditions as quickly as possible.
 
Common measures to improve the anti-interference performance of sensitive devices are as follows:  
  1. When wiring, try to minimize the area of ​​the loop to reduce inductive noise.  
  2. When wiring, the power line and ground line should be as thick as possible. In addition to reducing the voltage drop, it is more important to reduce the coupling noise.  
  3. For the idle I/O ports of the microcontroller, do not leave them floating, but connect them to ground or power. The idle terminals of other ICs should be connected to ground or power without changing the system logic.  
  4. Using power monitoring and watchdog circuits on microcontrollers, such as IMP809, IMP706, IMP813, X5043, X5045, etc., can greatly improve the anti-interference performance of the entire circuit.  
  5. On the premise that the speed can meet the requirements, try to reduce the crystal oscillator of the microcontroller and use low-speed digital circuits.  
  6. Try to solder IC devices directly on the circuit board and use IC sockets less often.   

4. Other common anti-interference measures
  1. Use inductor and capacitor filtering at the AC end to remove high-frequency and low-frequency interference pulses.
  2. Transformer double isolation measures: A capacitor is connected in series to the primary input end of the transformer, the shielding layer between the primary and secondary coils and the center point of the primary capacitor are connected to the ground, and the secondary outer shielding layer is connected to the printed circuit board ground. This is a key means of hardware anti-interference.
  3. Add low-pass filter on the secondary side: absorb the surge voltage generated by the transformer.
  4. Adopt integrated DC regulated power supply: because it has over-current, over-voltage, over-heating and other protections.
  5. The I/O ports are isolated by photoelectric, magnetic and relay, and the common ground is removed.
  6. Use twisted pair cables for communication lines: eliminate parallel mutual inductance.
  7. Optical fiber isolation is the most effective way to protect against lightning.
  8. Use isolation amplifiers or on-site conversion for A/D conversion: reduce errors.
  9. The outer shell is connected to the ground to ensure personal safety and prevent external electromagnetic field interference.
  10. Add a reset voltage detection circuit to prevent the CPU from working due to insufficient reset, especially for devices with EEPROM, as insufficient reset will change the contents of the EEPROM.
 
Printed circuit board process anti-interference:  
  1. The power cord is thickened, routed and grounded properly, and the three buses are separated to reduce mutual inductance oscillation.  
  2. For main chips such as CPU, RAM, ROM, etc., electrolytic capacitors and ceramic capacitors are connected between VCC and GND to remove high and low frequency interference signals.  
  3. Independent system structure reduces connectors and wiring, improves reliability and reduces failure rate.  
  4. The integrated block should be in reliable contact with the socket, and a double-spring socket should be used. It is best to solder the integrated block directly to the printed circuit board to prevent poor contact failure of the device.  
  5. If conditions permit, use a printed circuit board with more than four layers, with the middle two layers being the power supply and ground. 

Keywords:MCU Reference address:Experience summary of single chip microcomputer hardware design (anti-interference)

Previous article:How to add STC device list in KEIL and make it coexist with the built-in device list
Next article:MCU power management register PCON

Latest Microcontroller 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号