There is a power management register PCON inside the microcontroller. The lowest two bits of this register, IDL and PD, are used to set whether to enter the idle mode and power-down mode of the microcontroller respectively.
1. Idle mode
When the microcontroller enters idle mode, except for the CPU which is in sleep mode, all other hardware is active. The data in the data memory and special function registers not involved in the program in the chip will maintain their original values during idle mode. But if the timer is running, the value in the counter register will also increase. The microcontroller can be woken up by any interrupt or hardware reset in idle mode. It should be noted that when an interrupt is used to wake up the microcontroller, the program continues to run from where it originally stopped. When a hardware reset is used to wake up the microcontroller, the program will start execution from the beginning.
The purpose of letting the microcontroller enter idle mode is usually to reduce the power consumption of the system. To give a very simple example, everyone has used a digital multimeter. During normal use, the microcontroller inside the meter is in normal working mode. When not in use, it forgets In order to turn off the power of the multimeter, most meters will automatically turn off the LCD display after waiting for a few minutes if there is no human operation to reduce system power consumption. Usually, this function is implemented by using the idle mode of the microcontroller. Or power down mode. Taking the STC89 series of microcontrollers as an example, the power consumption of the microcontroller is usually 4mA to 7mA when it is working normally. When it enters idle mode, its power consumption drops to 2mA. When it enters power-down mode, its power consumption can be reduced to less than 0.1μA.
2. Sleep mode
When the microcontroller enters power-down mode, the external crystal oscillator stops, the CPU, timer, and serial port all stop working, and only the external interrupt continues to work. The instruction that causes the microcontroller to enter sleep mode will be the last instruction executed by the microcontroller before sleeping. After entering sleep mode, the data in the data memory and special function registers not involved in the program in the chip will retain their original values. The microcontroller can be woken up by an external interrupt low level trigger or by a falling edge trigger interrupt or a hardware reset mode. It should be noted that when an interrupt is used to wake up the microcontroller, the program continues to run from where it originally stopped. When a hardware reset is used to wake up the microcontroller, the program will Execute from scratch.
You can adjust the digital multimeter to the current range and then connect it in series to the circuit to observe the changes in the total current flowing through the system in the normal operating mode, sleep mode, and idle mode of the microcontroller. After testing, the results can be found as follows: Normal operating current > idle mode Current > Sleep mode current.
Previous article:The first step of microcontroller - 51 microcontroller
Next article:Quick introduction to 8051 microcontroller - my first lamp
- Popular Resources
- Popular amplifiers
- Learn ARM development(14)
- Learn ARM development(15)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Buck-boost supercapacitor charging solution
- EEWORLD University - In-depth study of light load high efficiency and low noise power supply reference design for wearable devices and the Internet of Things (TIDA-01566)
- Newbie asks for help from experts to recommend high-frequency square wave amplifier circuit
- AHD/TVI/CVI/CVBS to HDMI/VGA/CVBS solution sharing
- Use of transistor
- Answer the questions and win a JD card! Power supply class | Selection of AC-DC power supply design
- Once China overcomes the chip problem, will chips become cheap as cabbage?
- TI Da Vinci series TMS320DM8168 floating point DSP C674x + ARM Cortex-A8
- Started developing ultrasonic gas meters
- Did you have a 4WD car in your childhood? See the "voice-controlled 4WD car" made by a talented person on B station~