In a battery-powered system, sometimes in order to reduce battery power consumption, it is necessary to use low-power mode when the program is not running. There are two types of low-power modes: standby mode and power-off mode.
The low power mode is controlled by the power control register PCON, which we mentioned in the previous lesson. The power control register is an 8-bit register defined bit by bit. Its format is as follows
PCON is mainly a special register set for power control of CHMOS type microcontroller. The unit address is 87H and its structure format is as follows:
PCON Power Management Register Structure
PCOND7D6D5D4D3D2D1D0 bit sign SMOD
GF1GF0PDIDL
PCON flag bit description:
In CHMOS type microcontrollers, except for the SMOD bit, all other bits are dummy. SMOD is the serial port baud rate multiplication bit. When SMOD = 1, the serial port baud rate is doubled. The system reset defaults to SMOD = 0.
Definition of each bit: SMOD: This bit is related to serial port communication.
SMOD=0; When serial port mode is 1, 2, 3, the baud rate is normal.
SMOD=1; When serial port mode is 1, 2, or 3, the baud rate is doubled.
GF1, GF0: Two general working flags that users can use freely.
PD: Power-down mode setting bit.
PD=0 The microcontroller is in normal working state.
PD=1 The MCU enters the Power Down mode and can be awakened by an external interrupt or hardware reset mode. After entering the Power Down mode, the external crystal oscillator stops oscillating, the CPU , timer , and serial port all stop working, and only the external interrupt works.
IDL: Idle mode setting bit.
IDL=0 The microcontroller is in normal working state.
IDL=1 The MCU enters the idle mode. Except for the CPU, all other parts continue to work. In the idle mode, it can be awakened by any interrupt or hardware reset.
SMOD is the baud rate multiplication bit used in serial communication. GF1 is the general flag bit 1 and GF0 is the general flag bit 0. PD is the power-down mode bit. PD=1 enters the power-down mode. IDL is the standby mode bit. IDL=1 enters the standby mode. In other words, as long as an instruction is executed to make the PD bit or IDL bit 1, then how does the microcontroller enter or exit the power-down working mode and standby working mode? Let's introduce it.
1 Standby mode
Entering standby mode
When the instruction is used to make the IDL of the PCON register = 1, the system enters the standby mode. At this time, the CPU stops working, but the clock signal is still provided to the RAM, timer, interrupt system and serial port. At the same time, the stack pointer SP, program counter PC, program status word PSW, accumulator ACC and all general registers are frozen. The current consumption of the microcontroller is reduced from 24mA to 3.7mA, which can save power consumption.
Exiting standby mode
To exit the standby mode, you can introduce an interrupt and arrange a RETI instruction in the interrupt program. We don't know what an interrupt is yet. Of course, it doesn't matter. In fact, the standby mode is similar to the sleep mode when we use the computer.
2 Power-off mode
Entering standby mode
When the instruction is used to make the PD of the PCON register = 1, the power-down mode is entered. At this time, all operations of the microcontroller stop, and only the data in the internal RAM is retained. In the power-down mode, the power supply can be reduced to 2V and the power consumption is only 50uA. At this time, the display and hard disk are also turned off.
Exiting standby mode
The only way to exit the power-down mode is to reset. However, the reset should be performed after the power supply voltage returns to normal. The reset time should be greater than 1mS. The power supply voltage cannot be reduced before entering the power-down mode. Therefore, a reliable microcontroller circuit is better to have a power detection circuit. Obviously, the power-down mode and the standby mode are two different low-power working modes. The former can reduce power consumption when there is no external event trigger, while the latter is used when the program stops running.
KEIL MCU C language standby mode implementation:
PCON=0X02; //MCU enters standby mode (power-down mode)
Previous article:Analysis of the process of reading and writing data in single chip EEPROM
Next article:Blood Glucose Monitor Solution Based on C8051 MCU
Recommended ReadingLatest update time:2024-11-15 11:49
- 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)
- 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)
- Learn ARM development (4)
- Learn ARM development (6)
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
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- 2021 STMicroelectronics Industry Summit Tour- Shanghai/Beijing
- Summary: RCSN Play Anxinke's new esp32s3 development board
- How should Japan deal with nuclear waste water? Give us some ideas
- RTL diagram timing, can anyone help me explain why the two outputs in this diagram are in the two-choice mode?
- The disappearing boundary between MCU and MPU
- Python Basics: Dictionary Application
- A brief introduction to vehicle-mounted domain controllers
- Design of LED emergency lighting controller based on MSP430
- Pay attention when drawing and punching PCB!!
- Introduction to Multithreaded Programming in Embedded Systems