MSP430F5529 (IV) Power Supply &&& (V) Operating Mode

Publisher:xi24Latest update time:2015-08-20 Source: eefocusKeywords:MSP430F5529 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
I think power management and monitoring is a very complex and difficult part to master. It not only involves the selection of source mode, but also involves complex interrupts and how to handle interrupts, etc. Although learning this part well is very helpful to achieve the goal of reducing power consumption, it seems that the term "power consumption" is still a little far away for us at present. In addition, this part of the control is very helpful to prevent and deal with power supply accidents (too high, too low, etc.). However, it seems that if this development board is not used independently for projects but is only connected to the computer USB for power supply, there will generally be no problems. Therefore, I also only plan to learn it briefly. (I will learn it carefully later if I have the opportunity). The

I/O port and all analog units including the crystal oscillator are powered by DVCC. The memory (flash and RAM) and digital units are powered by the core voltage VCORE.
DVCC: wide power supply voltage range 1.8V-3.6V;

VCORE: DVCC generates a secondary core voltage through a low dropout voltage regulator (LDO), which is specifically used to power the CPU digital logic. There are four levels: 1.4V (0-12MHZ), 1.6V (0-16MHZ), 1.8V (0-20MHZ) and 1.9V (0-25MHZ). The minimum allowable voltage of VCORE depends on the selected MCLK size, which means that a higher VCORE is required for high main frequency.
Management will generate a reset (mainly during power-on), and monitoring will generate an interrupt (monitoring whether the voltage is too high or too low).
The most common function we use is to set the core voltage VCORE. Fortunately, there is a special function library HAL_PMM.c/h.
                 In addition to some setting definitions in this function library, the most important thing is to define three functions:
                        SetVCoreDown(uint8_t level): lower the core voltage
                        SetVCoreUp(uint8_t level): increase the core voltage
 
          SetVCore(uint8_t level): directly set the core voltage value (0-3, a total of four levels)
/*This function is the most important, or in other words, with this one, the previous two are not needed*/
 
V. System working mode
    In Chapter 4, we mentioned that we can start from the power layer to achieve the purpose of controlling power consumption from the source. In this chapter, we will talk about the CPU working mode and how to control power consumption from the next level.
    In different working modes, the CPU will disable some modules to achieve the purpose of controlling power consumption.
    (PS: The same sentence, "power consumption is too far", generally will not change the working mode, so it is simple to learn)
A few words of introduction: ① Changing the working mode will take effect immediately;
② When an interrupt occurs, the current mode setting information will be saved for recovery (unless the working mode is changed in the interrupt service program);
③ When in LPM4.5 mode, PMM's power supervision will not take effect, all RAM and registers will be lost, but the I/O port status will be locked;
④ There is a special process for waking up from LPM4.5, go and see if you are interested;
 
the following picture is very interesting, you can clearly see the process and direction of conversion between working modes, as well as how each working mode is set and what parts are controlled.
BOR: Brown-Out Reset Low Voltage Detection Reset (Undervoltage Reset)
POR: Power-On Reset
PUC: Power-Up Clear
The light-colored part indicates an event, and the dark-colored part indicates an operation or setting.


① Setting the working mode mainly involves setting the SCG0, SCG1, OSCOFF, and CPUOFF bits of the register SR.
In the AM (Active Mode) mode, all four bits are set to zero, and the system defaults to the AM mode;
② Except for AM, the rest are low-power modes. After the processor enters the low-power mode, it is generally awakened by an interrupt. It can be an external interrupt or an internal timer interrupt; ③
In the LPM0-LPM4 mode, the peripheral modules will work normally, and the RTC clock will not stop;
④ To enter the LPM4.5 mode (less commonly used), you only need to set one more PMMREGOFF on the basis of LPM4. In this mode, all the system clocks, memories, and supervision and management mechanisms are stopped, and even the real-time clock RTC is prohibited from operating.
⑤LPM0 and LPM1 are a group. In addition to the features shown in the figure above, SMCLK is enabled (SMCLKOFF = 0) in this mode. If the clock source of DCO is ACLK or SMCLK, DCO is also valid.
⑥LPM2 and LPM3 are a group. In addition to the features shown in the figure above, SMCLK is disabled in this mode. If the clock source of DCO is ACLK, DCO is also valid.
⑦The header file of MSP430 has a detailed definition of low power mode. For example, to enter low power mode 0, you can directly write LPM0 in the program; to enter low power mode 4, you can directly write LMP4. Exit low power mode as follows:
LPM0_EXIT; //Exit low power mode 0 //It's so convenient, isn't it?
LPM4_EXIT; //Exit low power mode 4 (except LPM4.5)
Summary of the experiment: A very interesting program
 
/*The embodiment of low power mode, no infinite loop, the program will not terminate*/
/*You will find that the statements after LPM3 will not be executed, the program will only execute the interrupt service program periodically, this is because MCLK, SMCLK and FLL are disabled in LPM3 mode*/
#include  
void main(void)
{
   WDTCTL=WDTPW+WDTCNTCL+WDTTMSEL+WDTIS1+WDTIS0;//WDT is used as a timer
   SFRIE1|=WDTIE; //Open watchdog interrupt
   P1DIR|=BIT1+BIT2; //P1.1 is connected to LED and set to output direction
   P1OUT=BIT1+BIT2;
   __enable_interrupt(); //Open general interrupt
   //_BIS_SR(GIE); This sentence also means opening general interrupt
   /*Here is a usage_BIS_SR(): set the variable in brackets*/
   LPM3; //Enter LPM3 low power mode, SMCLK is disabled in this mode
   P1OUT&=~BIT2;//This sentence cannot be executed, so P1.2 will remain on and will not dim
}
#pragma vector=WDT_VECTOR
__interrupt void WatchTimer(void)
{
   P1OUT^=BIT1; //Timed flip to achieve flashing
}
Keywords:MSP430F5529 Reference address:MSP430F5529 (IV) Power Supply &&& (V) Operating Mode

Previous article:MSP430F5529 (VI) Timer Timer_A-1
Next article:MSP430F5529 (III) Unified Clock System UCS-2

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号