MSP430 low power event driven working mode
Each module of the MSP430 series microcontroller can run independently, such as timer, input/output port, A/D conversion, watchdog, LCD display, etc. can work independently when the CPU is in sleep state. If the main CPU needs to work, any module can wake up the CPU through an interrupt, so that the system can run with the lowest power consumption.
Allowing the CPU to work in a burst state can fully utilize the low power consumption of the CPU. Usually, the CPU is set to a low power mode using software, and an interrupt is used to wake up the CPU from the sleep state when needed. After completing the work, it can enter the corresponding sleep state again. For example, let the CPU work in the LPM3 state, and switch to the AM active mode through an interrupt event. According to the operation needs, it can enter the corresponding low power mode from the AM state: LPM0/LPM3 or LPM4.
These low power consumption characteristics of the system are achieved by the system's response to interrupts. The process of the system responding to interrupts: (1) Hardware automatic interrupt service. Including PC stacking, SR stacking; interrupt vector assigned to PC; GIE, CPUOFF, OSCOFF and SCG1 cleared; and IFG flag cleared (single source interrupt flag). (2) Execute the interrupt handling subroutine. (3) Execute the RETI instruction (interrupt return), including SR stacking and PC stacking.
For example: after the system is initialized, it works in low power mode 0, an interrupt event triggers the active mode, and after the interrupt processing is completed, it enters low power mode 3.
;Main program
......; Initialization operation starts
……;
......; Initialization completed
BIS #GIE+CPUOFF, SR ; Set low power mode 0, LPM0 in the main program
;……;The program stops here
;Interrupt subroutine
…
……; Interrupt processing ends
BIS #GIE+CPUOFF+SCG1+SCG0, 0(SP) ; Set SR to low power mode 3, LPM3
RETI; interrupt return
;The system enters low power mode 3
…
If the main program expects to continue to perform certain operations after the interrupt returns, the SR value can be changed to AM mode in the interrupt handling subroutine. After the system interrupt exits, certain set operations can be performed according to the restored SR and PC values.
;Main program
......; Initialization operation starts
……;
......; Initialization completed
BIS #GIE+CPUOFF, SR ; Set low power mode 0, LPM0 in the main program
L1 Operation 1
L2 Operation 2
……;
;Interrupt subroutine
...; Interrupt processing starts
…
……; Interrupt processing ends
BIS #GIE+CPUOFF, 0(SP) ; Set SR to active mode, AM
RETI; interrupt return, the system enters active mode
…
The main program stops executing at LPM0, and L1, L2 and other statements are not executed. After that, the interrupt event saves PC (L1 instruction address) and SR (low power mode 0), the interrupt wakes up the CPU, and executes the interrupt handler; because SR is set to active mode in the interrupt handler, the CPU is in active state after the interrupt returns, and continues to execute from the L1 instruction pointed to by PC...
Previous article:MSP430 Timer Detailed Explanation
Next article:MSP430 MCU Timer A Structure and Application Examples
Recommended ReadingLatest update time:2024-11-16 14:52
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 5 points to note when using PCB reverse technology
- Differences between SMBus and I2C
- Help car navigation Wince 6.0 system no boot prompt sound
- MSP430F5438 study notes FLAHS operation
- Wiring diagram of Hall current sensor
- Application of switch Hall sensor DRV5032 in TWS headset design
- Some learning experiences of NBIoT
- EEWORLD University Hall ---- Digital Signal Processing Beihang Wang Jun
- Application analysis of CC1310 low power consumption advantage
- I am currently using powerSTEP01 to drive a 86mm stepper motor. Does anyone have a driver for this chip?