Low power consumption is a very important indicator of MCU. For example, some wearable devices have limited power. If the entire circuit consumes a lot of power, it will often run out of power and affect the user experience. Usually, when we are doing products, the basic functions are very simple to implement, but as long as the problem of low power consumption is more difficult, such as some MCUs that can be as low as micro-amps, and the low-power design of their own design is measured. It is milliamperal, the current can be hundreds of times higher than the standard. Don't be afraid to encounter this situation. If you are serious, you will win. Let's take a closer look at the reasons below. The first one: break the peripheral life pulse - turn off the peripheral clock First of all, the most intuitive aspect, which engineers pay more attention to, is to turn off the peripheral clock of the MCU. For most MCUs that appear on the market, the peripheral modules correspond to a clock switch. You only need to open the clock of this peripheral, you can use this peripheral normally. Of course, this peripheral will also generate corresponding power consumption; otherwise, if you want this peripheral to not generate power, just turn it off. The clock is fine. Article 2: Let the work pace slow down - the clock should not be multiplied In addition to the peripheral module power consumption, there is also a big power consumer to pay attention to, this is the PLL and FLL module. The PLL and FLL are mainly used to multiply the original clock signal to increase the overall clock of the system, and accordingly, the power consumption is also raised. Therefore, before entering low power consumption, it is necessary to switch to the mode, bypass the PLL and the FLL module, thereby reducing the power consumption of the MCU as much as possible, and then switching the clock back after the MCU wakes up. Article 3: Containing trickle flow - pay attention to the level status of the I/O port If you think that you can ensure that the peripherals no longer consume power as long as you turn off the peripheral clock, then you are too naive. If the IO port is not handled properly, it will steal power in the dark, but you don't know. The specific reason is this, the general IO inside or outside will have pull-up resistors, for example, as shown below, if an IO port has a 10KΩ pull-up resistor, pull the pin to 3.3V, however When the MCU enters the low power mode, the IO port is set to output low level. According to Ohm's law, this pin will consume 3.3V/10K=0.33mA, if there are four or five such IOs. Mouth, then a few mA will be posted, it is a pity. So before entering low power consumption, please check the status of the IO port one by one: If this IO port is pulled up, set it to high level output or high impedance input; If this IO port is pulled down, set it to low level output or high impedance input; In a word, don't waste the good current on the function of generating heat. You can't rely on this temperature to warm your hands. Article 4: Good-neighborly and friendly cooperation - pay attention to the coordination of I/O and peripheral IC The factor of the upper and lower pull-down resistors of the IO port is relatively obvious. The lower side is an insignificant factor: the current consumption when the IO port is connected to the external IC. If an IO port comes with a pull-up, and the IC pin connected to the IO is pulled down by itself, no matter what level output the pin is in, it will inevitably generate a certain current consumption. So when you encounter this kind of situation, you first need to read the manual of the peripheral IC to determine the state of this pin, so that you know what it is. Then, before controlling the MCU to sleep, set the up and down mode of the MCU's IO port and Input and output state, to ensure that a trace of current is not consumed by it. Article 5: Disconnect the debugger and don't be confused by the illusion There is also a class of strange, the current consumption is very large, but the actual result is that you are worried, what is the reason? Because the MCU is also connected to the debugger when testing power consumption! At this time, most of the current will be taken away by the debugger, and the engineer will have an extremely depressed mood. Therefore, when measuring low power consumption, you must not connect the debugger, and you can't measure the current while debugging. to sum up MCU's low-power design is a meticulous work, to develop a good habit, to re-verify whether the low power consumption meets the requirements for each function added, so that the power consumption factor can be eliminated anytime and anywhere. If you design all the functions to consider the low-power problem, you may have to change the architecture of the program if you are not careful. Even so, you may not be able to completely reduce the power consumption. Black Power Strip,2-Usb 2-Layers Power Strip,Universal White Power Strip,Universal Power Strip Yuyao Huijun Electrical Appliance Co., Ltd. , https://www.yyhjdq.com