Improve MCU anti-interference: How to Reduce detours in your design

Source: Internet
Author: User
Tags switches

All the friends who have made products have realized that a design seems simple, and the hardware design and code compilation will be done quickly, but it is more or less unexpected during the debugging process, these are manifestations of insufficient anti-interference capabilities.

The following describes how to avoid detours in your design:

Anti-interference is embodied in two aspects: hardware design and software writing.

Here's a key note: the main anti-interference Design in MCU design is on the hardware, supplemented by software. Because MCU has limited computing power, it takes a lot of effort on hardware.

Look at the interference path:

1. The main path of the interference signal interference MCU is through the I/O port. One is to affect the MCU data collection, and the other is to affect the internal registers.

Solution: we will discuss it later.

2: power supply interference: although the MCU adapts to a wide voltage (3-5.5 V), it is very sensitive to power supply fluctuations. For example, the MCU can work stably at 3 V voltage, however, the voltage is not 3v-5. Stable Operation with 5 V fluctuation.

Solution: Use a power supply to stabilize the pressure block and filter the power supply. Note: The power must be bypassed and 0 should be performed. The capacitance of the 1uf porcelain slice is used to filter out high-frequency interference, because the electrolytic capacitor does not work for high-frequency interference that exceeds dozens of kHz.

3: power-on and power-off interference: Each MCU system must go through such a process during power-on, so pay special attention to it.

Although the MCU can work stably at a 3 V voltage, it does not mean that it cannot work at a voltage below 3 V. Of course, the MCU is extremely unstable at such a low voltage. When the system is powered on, the power supply voltage of the system is increased from 0 V to the rated voltage. For example, when the voltage reaches 2 V, the MCU starts to work, but this is a very unstable operation, it is easy to run and fly.

Solution: 1. Let the MCU work after the power supply is stable. PIC integrates POR (internal power-on delay reset) in the chip, which must be enabled in the configuration bit.

External power-on delay reset circuit. There are multiple forms. at a low cost, a resistance circuit is connected to the reset foot. Dedicated chips are used for high costs. There are a lot of materials in this area, which can be found everywhere.

The most difficult to eliminate is the first type of interference above, and the interference signal can occur at any time, and the intensity of the interference signal is also different.

But they also share the same point: Interference Signals also follow Ohm's law. interference signal coupling paths are nothing more than electromagnetic interference, one is electric spark, and the other is magnetic field.

The most serious interference is the electric spark interference, followed by the magnetic field interference. Electric Spark interference is manifested in the vicinity of high-power switches, relays, contactor, brush motor and so on. Magnetic field interference mainly occurs in the vicinity of high-power AC motor, transformer and so on.

Solution: the first point is also the most classic, that is, to schedule work on the PCB step and component position. There is a lot of knowledge in the middle, and I can't finish it for a few days ^.

Ii. design the peripheral circuit of the I/O port based on factors such as input impedance and collection rate of each I/O port.

Generally, the input impedance of an I/O port is determined in three cases:

A: The I/O port has an upstream resistance. The upstream resistance is the input impedance of the I/O port.

Generally, we use a 4-20 k Resistor for pull-up (the internal pull-up resistance of the PIC port B is about 20 K ).

Because the interference signal follows Ohm's law, the smaller the upper-tension resistance, the smaller the voltage produced by the interference signal.

The smaller the pull-up resistance, the more power consumption, so in the home design, the pull-up resistance is generally 10-20 K, and in the case of strong interference, the pull-up resistance can even be as low as 1 K.

(If you need to discard the port B pull function in cases of strong interference, you must use the external pull function .)

B: The I/O port is connected to the output foot 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, usually dozens to hundreds of euros.

It can be seen that using digital circuits as an intermediary can reduce the impedance to the most ideal. On many industrial control panels, we can see that a large number of digital circuits are designed to ensure performance and protect MCU.

C: I/O ports are connected with small capacitors in parallel.

Because the capacitor is blocked by AC and the interference signal is generated instantly and extinguished instantly, the capacitor can filter out the interference signal. However, the bad thing is that the speed of the I/O port signal collection is reduced. For example, when the serial port is connected with a capacitor, the capacitor will filter out the digital signal as an interference signal.

For some detection switches, cines, Hall Elements, and so on, it is possible to combine capacitance, because the changes in the switch Quantity cannot have a high rate, and a small capacitor has no effect on signal acquisition.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.