Friends who have worked on products all have experienced this: a design may seem simple, and the hardware design and code writing can be completed quickly, but there are more or less unexpected events during the debugging process. These are all manifestations of insufficient anti-interference capabilities.
Let’s discuss how to avoid detours in your design:
Anti-interference is reflected in two aspects: one is hardware design, and the other is software writing.
Here is a key reminder: In MCU design, the main anti-interference design is in hardware, supplemented by software. Because the computing power of MCU is limited, a lot of effort must be put into hardware.
Look at the interference pathways:
1: The main path for interference signals to interfere with MCU is through the I/O port, which affects the data collection of MCU and other internal registers.
Solution: discussed later.
2. Power supply interference: Although the MCU can adapt to a wide voltage range (3-5.5V), it is very sensitive to power supply fluctuations. For example, the MCU can work stably at 3V, but cannot work stably when the voltage fluctuates between 3V and 5.5V.
Solution: Use a power stabilizer block to filter the power supply. Tip: Be sure to use a 0.1UF ceramic capacitor in the power bypass to filter out high-frequency interference, because electrolytic capacitors are ineffective for high-frequency interference exceeding tens of kHz.
3: Power-on and power-off interference: But every MCU system has to go through such a process when powered on, so special attention should be paid.
Although the MCU can work stably at 3V, it does not mean that it cannot work at voltages below 3V. Of course, the MCU is extremely unstable at such a low voltage. When the system is powered on, the system power supply voltage rises from 0V to the rated voltage. For example, when the voltage reaches 2V, the MCU starts to work, but it is extremely unstable at this time and is very easy to run away.
Solution: 1. Allow the MCU to start working after the power supply is stable. The PIC has an integrated POR (internal power-on delay reset) function, which must be enabled in the configuration bit.
External power-on delay reset circuit. There are many forms. The low-cost one is to connect a resistor-capacitor circuit to the reset pin. The high-cost one uses a dedicated chip. There is a lot of information on this, and it can be found everywhere.
The most difficult to eliminate is the first type of interference mentioned above, and interference signals can occur at any time, and the intensity of interference signals is also different.
But they also have similarities: the interference signal also follows Ohm's law, and the coupling path of the interference signal is nothing more than electromagnetic interference, one is electric sparks, and the other is magnetic field.
The most serious interference is spark interference, followed by magnetic field interference. Spark interference mainly occurs when there are high-power switches, relays, contactors, brush motors, etc. nearby. Magnetic field interference mainly occurs when there are high-power AC motors, transformers, etc. nearby.
Solution: The first point, which is also the most classic, is to work hard on the PCB routing and component position arrangement. There is a lot of knowledge involved and it would take a few days to finish talking about it^^.
2: Consider the input impedance of each I/O port, acquisition rate and other factors to design the peripheral circuit of the I/O port.
Generally, there are three situations that determine the input impedance of an I/O port:
A: The I/O port has a pull-up resistor, and the pull-up resistor value is the input impedance of the I/O port.
Generally, people use 4K-20K resistors for pull-up (the internal pull-up resistor of PIC's B port is about 20K).
Since the interference signal also follows Ohm's law, the more interference there is, the smaller the pull-up resistor should be, because the voltage generated by the interference signal on the resistor will be smaller.
Since the smaller the pull-up resistor is, the more power it consumes, in home designs, the pull-up resistor is generally 10-20K, and in strong interference situations the pull-up resistor can even be as low as 1K.
(If you want to abandon the pull-up function of port B in a strong interference situation, you must use an external pull-up.)
B: The I/O port is connected to the output pin of other digital circuits. At this time, the input impedance of the I/O port is the impedance of the output port of the digital circuit, which is generally tens to hundreds of ohms.
It can be seen that using digital circuits as intermediaries can reduce impedance to the most ideal level. In many industrial control boards, a large number of digital circuits can be seen to ensure performance and protect the MCU.
C: A small capacitor is connected in parallel to the I/O port.
Since capacitors pass AC and block DC, and interference signals are generated and extinguished instantly, capacitors can filter out interference signals. However, the downside is that it causes the rate at which the I/O port collects signals to decrease. For example, it is absolutely not advisable to connect capacitors to serial ports, because capacitors will filter out digital signals as interference signals.
For some detection switches, reed switches, Hall elements and the like, capacitors can be connected in parallel, because the changes in these switch quantities cannot have a very high rate, and connecting a small capacitor will not have any effect on signal acquisition.
Previous article:Design and production of single chip microcomputer power supply circuit
Next article:Design considerations for single chip microcomputer control board
Recommended ReadingLatest update time:2024-11-23 19:13
- 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)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- The transformer in the power supply has no output after loading
- Compile imx6-ek200 with buildroot
- Using MSP430 to implement PWM signal
- Get the MPM54304 evaluation board for the first quad-output module with digital power management
- Dead time problem of IGBT drive waveform
- The difference between single-phase carrier and type 2 collector
- CLF5356
- Why does the chip of the board heat up when the msp432 is powered on and compiled and downloaded under KEIL5 conditions? What is turned on?
- How to solve the thermal challenges of Wi-Fi front-end?
- 2 ucos task management