The application of single-chip microcomputer system in military, industrial and civilian products is becoming more and more widespread. It uses software to complete many functions that were previously implemented by hardware. It is small in size, rich in functions, and intelligent in program. However, it also faces many new problems in terms of reliability. Using the field electromagnetic compatibility (EMC) theory to analyze some traditional concepts in the design of single-chip microcomputer systems, many misunderstandings will be found, and some misunderstandings are still widely present in the engineering community.
1 Myth 1: A watchdog will prevent computer crashes
A freeze means that the CPU program pointer enters an infinite loop and cannot execute the normal program flow. Its external manifestations are often: loss of normal functions, no response to buttons, and frozen display. After the microcontroller freezes, only recovery can get out of the infinite loop and execute the normal program flow. As we all know, the most effective way to overcome freezes is to add a watchdog.
The most widely used watchdog is actually a special timer DogTimer. DogTimer counts at a fixed rate and sends an overflow pulse to reset the microcontroller when the preset time is reached. If DogTimer is forced to reset to zero before DogTimer overflows, no overflow pulse will be sent. The reset pulse is sent by the CPU. In the microcontroller program, a clear DogTimer statement, FeedDog statement, is placed every other statement to ensure that DogTimer will not overflow when the program is running normally. Once the program enters an infinite loop without FeedDog statement, DogTimer will overflow, causing the microcontroller to reset and jump out of the infinite loop. This article calls this watchdog a typical watchdog. Typical watchdogs have been integrated, such as MAX706, MAX791, etc. [1]; there are also many microcontrollers that integrate this watchdog, such as PIC16C57, MC68HC705, etc. For specific circuits, please refer to the technical data of these chips [2].
The dual-time limit watchdog has two timers; one is a short timer and the other is a long timer. The short timer is set to T1 and the long timer is set to T2, 0
Thus, when the program enters a dead loop, if the dead loop contains a short timer FeedDog statement but not a long timer FeedDog statement, the long timer will eventually overflow, causing the microcontroller to reset. By cleverly arranging the position of the long timer FeedDog statement, the probability of a crash can be minimized. This has been demonstrated by a comparative application in a microcomputer control device for a hydropower generator set [3].
At present, almost all watchdogs are dependent on the CPU (dependent on CPU FeedDog). This can be compared to: whether a safety device can play a safety role depends on the behavior of the object it protects. Obviously, a watchdog that relies on the CPU cannot guarantee that the microcontroller will not crash 100%.
In a device that absolutely cannot allow a crash, the author has designed a watchdog that is completely independent of the CPU - a timer reset watchdog. The main body of the timer reset watchdog is also a timer, which sends an overflow pulse at a predetermined time. This overflow pulse forces the microcontroller to reset. The timer reset watchdog does not require a CPU FeedDog.
In short, the timed reset watchdog is to force the MCU to reset at regular intervals. In this way, even if the device crashes, its maximum crash time will not be greater than the timer timing time. Obviously, as long as the hardware is intact, this watchdog can 100% guarantee that the MCU will not crash for a long time. In smart meters (including IC card energy meters, multi-rate energy meters, and multi-function energy meters [4]), a timed reset watchdog is used to force the CPU to reset every 1 second. So far, hundreds of thousands of meters have been running for nearly five years without a single crash report.
It must be pointed out that when using this watchdog, the CPU programming must adapt to the environment of timed reset to ensure that the timed reset does not interrupt programs that cannot be interrupted and does not cause any malfunctions.
2 Myth 2: Adding a power filter can improve EMC performance
In the single-chip microcomputer system, in order to suppress electromagnetic interference (EMI), an electromagnetic filter is often added between the AC power supply line and the power transformer. The commonly used power filter is shown in Figure 1.
Figure 1 is a dual type II LC filter, where C0 is used to bypass differential mode interference. The difference between the two is that in Figure 1 (b), the two capacitors are connected to the ground. Assuming the resistance of the inductor is R, their frequency isolation characteristics are:
When R is very small, the resonant frequencies of the above two filters are:
It can be seen that their amplitude-frequency characteristics are similar, but their resonant frequencies are different. From the perspective of filtering effect, the two are similar in reducing differential mode interference from AC power, but the latter is better in reducing common mode interference. However, for devices using floating ground, since the capacitor cannot be directly connected to the ground, only the latter can be used.
When designing a filter, it is important to make sure that the resonant frequency is much smaller than the interference frequency. If it is not handled properly, it will not only fail to attenuate the interference, but will amplify it. Taking the dual II filter in Figure 1 (a) as an example, if L=1mh, R=1Ω, C=0.47μF (this is the parameter recommended by many materials), f0=5.2kHz can be calculated. The frequency of the fast pulse group in the EMC test is 5.0kHz (2kV) or 2.5kHz (4kV); 5.0kHz just resonates, and 2.5kHz will not be attenuated, as shown by the dotted line in Figure 2. It can be seen that not all power supply filters can improve EMC performance. In engineering, many devices are still difficult to process EMC tests despite the use of expensive filters, and most of the reasons are here.
In fact, if L=30mh, R=5Ω, C=0.47μF, we can calculate f0=0.95kHz, the 5.0kHz pulse group amplitude is reduced to 3.73%, and the 2.5kHz pulse group amplitude is attenuated to 16.78%. At this time, the power supply filter does improve the EMC performance of the system. The solid line in Figure 2 is the amplitude-frequency characteristic of Xiangqing.
3. Myth 3: Optical coupler devices isolate interference thoroughly
Optical couplers are the most commonly used interference isolation devices. For example, after the switch quantity on site is led to the measurement and control device, optical isolation must be added to cut off the conducted interference from the site; the RS485 communication port is connected to the external communication line through an optical isolation to prevent conducted interference from the external communication line.
Many people think that optocoupler devices can completely isolate interference, and that interference will not be eliminated if optocouplers are used. In fact, optoelectronic isolation is not a perfect solution.
First of all, the optocoupler device itself can only isolate the conducted interference, it isolates the continuous radiation and induction interference. Radiation comes from space, and induction comes from adjacent conductors. The most common failure is: when designing the PCB, the input and output circuits of the optocoupler device are laid out together. At this time, the interference cannot pass through the optocoupler device, but it is easy for the input circuit to sense the output circuit.
Secondly, the ability of optical couplers to isolate conducted interference is only about 1kV, and interference or surges above 1kV are generally beyond their ability. For example, in the EMC fast pulse group test, the interference signal amplitude applied is 2kV, 4kV, and 8kV, and optical couplers cannot isolate it. [page]
When it comes to PCB wiring, many engineers and technicians know a traditional experience: horizontal routing on the front and vertical routing on the back, which is both beautiful and short; another traditional experience is: as long as space allows, the thicker the routing, the better. It can be clearly said that these experiences are outdated today when we pay attention to EMC.
In order to ensure that the MCU system has good EMC performance, PCB design is critical. A PCB with good EMC performance must be designed according to high-frequency circuits - this is unconventional. The reason why the MCU system PCB is designed according to high-frequency circuits is that although the operating frequency of most circuits in the MCU system is not high, the frequency of EMI is high, and the simulated interference frequency of the EMC test is also high [5]. In order to effectively suppress EMI and successfully pass the EMC test, the design of the PCB must take into account the characteristics of the high-frequency circuit. The key points of PCB design according to high-frequency circuits are:
(1) There must be a good ground layer. A good ground layer has equal potential everywhere, will not produce common mode resistance coupling, and will not form a loop through the ground to produce an antenna effect; a good ground layer can make EMI enter the ground through the shortest path and disappear. The best way to establish a good ground layer is to use a multi-layer board, with one layer dedicated to the ground layer; if only a double-sided board can be used, the wiring should be routed from the front as much as possible, and the back should be used as the ground layer, and the wiring should only be passed from the back as a last resort.
(2) Maintain sufficient distance. Maintain sufficient distance between two wires or two groups that may cause harmful coupling or radiation, such as the input and output of a filter, the input and output of an optical coupler, and the AC power line and weak signal line.
(3) Long lines with low-pass filters. The lines should be as short as possible. If long lines have to be run, C, RC or LC low-pass filters should be inserted at reasonable locations.
(4) Except for the ground wire, do not use thick wires when thin wires can be used. Because each trace on the PCB is both a carrier of useful signals and a trunk line for receiving radiation interference. The longer and thicker the trace, the stronger the antenna effect.
5 Myth 5: IC chip packaging does not affect performance
As we all know, IC chip packaging is divided into SMD and DIP. It is generally believed that the difference between SMD and DIP is mainly the size and welding method, which has little effect on system performance. In fact, it is not.
As mentioned earlier, every trace on the PCB has an antenna effect. Now let's say that every component on the PCB also has an antenna effect. The larger the conductive part of the component, the stronger the antenna effect. Therefore, for the same model chip, the antenna effect of a smaller package size is weaker than that of a larger package size. This explains a phenomenon that many engineers have noticed: the same device is easier to pass EMC testing with SMD components than with DIP components.
In addition, the antenna effect is also related to the working current loop of each chip. To weaken the antenna effect, in addition to reducing the package size, the working current loop size, operating frequency and di/dt should be reduced as much as possible. If you pay attention to the pin layout of the latest IC chips (especially single chips), you will find that most of them have abandoned the traditional way - GND in the lower left corner and VCC in the upper right corner, and arranged VCC and GND in adjacent positions in order to reduce the size of the working current loop.
In fact, not only IC chips, but also resistor and capacitor packaging are related to EMC. 0805 packaging has better EMC performance than 1206 packaging, and 0603 packaging has better EMC performance than 0805 packaging. Currently, 0603 packaging is popular internationally.
4 Myth 4: PCB wiring should be horizontal and vertical
Previous article:Low power consumption technology and application of single chip microcomputer
Next article:Experimental study on the irradiation effect of transient electromagnetic pulse on single chip microcomputer and its reinforcement method
Recommended ReadingLatest update time:2024-11-16 15:48
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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
- Circuit
- TMS320F28035 call jump instruction problem
- Sliding resistor for LM358 comparator
- TE pressure sensor: underwater robots from 0 to 1000, how to avoid mass production pitfalls
- OHM Graphical Introduction to Electronics
- Detailed explanation of the design of RFID-based smart hotel system
- 【Qinheng Trial】Streamlined mobile phone system design #1
- A newbie asks a question about the STC15 interrupt function
- MSP432P401R LaunchPad download program prompts not supported
- Help 40E Gold