This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/MSP432P401R: Power control mode selection using driverlib

Part Number: MSP432P401R

Tool/software: TI-RTOS

hi ti, i am working with MSP432 Launchpad for my project, i am using msp driver library for configuring my boards

one of that is power control modes, I hv called a function for setting up core voltage   MAP_PCM_SetCoreVoltageLevel( PCM_VCORE1);

what setting this function do, which power mode it operates on ?

MAP_PCM_SetCoreVoltageLevel( PCM_VCORE1); is defined in "cpu.c"

I have mapped function calls in a attached document one after one please refer and let me help to find out what it sets to PCM

p { margin-bottom: 0.25cm; line-height: 120%; }

/******************************************************************************/

bool PCM_setCoreVoltageLevel(uint_fast8_t voltageLevel)

{

return __PCM_setCoreVoltageLevelAdvanced(voltageLevel, 0, true);

}

/******************************************************************************/

static bool __PCM_setCoreVoltageLevelAdvanced(uint_fast8_t voltageLevel,

uint32_t timeOut, bool blocking)

{

uint8_t powerMode, bCurrentVoltageLevel;

uint32_t regValue;

bool boolTimeout;

ASSERT(voltageLevel == PCM_VCORE0 || voltageLevel == PCM_VCORE1);

/* Getting current power mode and level */

powerMode = PCM_getPowerMode();

bCurrentVoltageLevel = PCM_getCoreVoltageLevel();

boolTimeout = timeOut > 0 ? true : false;

/* If we are already at the power mode they requested, return */

if (bCurrentVoltageLevel == voltageLevel)

return true;

while (bCurrentVoltageLevel != voltageLevel)

{

regValue = PCM->CTL0;

switch (PCM_getPowerState())

{

case PCM_AM_LF_VCORE1:

case PCM_AM_DCDC_VCORE1:

case PCM_AM_LDO_VCORE0:

PCM->CTL0 = (PCM_KEY | (PCM_AM_LDO_VCORE1)

| (regValue & ~(PCM_CTL0_KEY_MASK | PCM_CTL0_AMR_MASK)));

break;

case PCM_AM_LF_VCORE0:

case PCM_AM_DCDC_VCORE0:

case PCM_AM_LDO_VCORE1:

PCM->CTL0 = (PCM_KEY | (PCM_AM_LDO_VCORE0)

| (regValue & ~(PCM_CTL0_KEY_MASK | PCM_CTL0_AMR_MASK)));

break;

default:

ASSERT(false);

}

if(blocking)

{

while (BITBAND_PERI(PCM->CTL1, PCM_CTL1_PMR_BUSY_OFS))

{

if (boolTimeout && !(--timeOut))

return false;

}

}

else

{

return true;

}

bCurrentVoltageLevel = PCM_getCoreVoltageLevel();

}

/* Changing the power mode if we are stuck in LDO mode */

if (powerMode != PCM_getPowerMode())

{

if (powerMode == PCM_DCDC_MODE)

return PCM_setPowerMode(PCM_DCDC_MODE);

else

return PCM_setPowerMode(PCM_LF_MODE);

}

return true;

}

/******************************************************************************/

uint8_t PCM_getPowerMode(void)

{

uint8_t currentPowerState;

currentPowerState = PCM_getPowerState();

switch (currentPowerState)

{

case PCM_AM_LDO_VCORE0:

case PCM_AM_LDO_VCORE1:

case PCM_LPM0_LDO_VCORE0:

case PCM_LPM0_LDO_VCORE1:

return PCM_LDO_MODE;

case PCM_AM_DCDC_VCORE0:

case PCM_AM_DCDC_VCORE1:

case PCM_LPM0_DCDC_VCORE0:

case PCM_LPM0_DCDC_VCORE1:

return PCM_DCDC_MODE;

case PCM_LPM0_LF_VCORE0:

case PCM_LPM0_LF_VCORE1:

case PCM_AM_LF_VCORE1:

case PCM_AM_LF_VCORE0:

return PCM_LF_MODE;

default:

ASSERT(false);

return false;

}

}

/******************************************************************************/

uint8_t PCM_getCoreVoltageLevel(void)

{

uint8_t currentPowerState = PCM_getPowerState();

switch (currentPowerState)

{

case PCM_AM_LDO_VCORE0:

case PCM_AM_DCDC_VCORE0:

case PCM_AM_LF_VCORE0:

case PCM_LPM0_LDO_VCORE0:

case PCM_LPM0_DCDC_VCORE0:

case PCM_LPM0_LF_VCORE0:

return PCM_VCORE0;

case PCM_AM_LDO_VCORE1:

case PCM_AM_DCDC_VCORE1:

case PCM_AM_LF_VCORE1:

case PCM_LPM0_LDO_VCORE1:

case PCM_LPM0_DCDC_VCORE1:

case PCM_LPM0_LF_VCORE1:

return PCM_VCORE1;

case PCM_LPM3:

return PCM_VCORELPM3;

default:

ASSERT(false);

return false;

}

}

/******************************************************************************/

uint8_t PCM_getPowerState(void)

{

return (PCM->CTL0 | PCM_CTL0_CPM_MASK);

}

/******************************************************************************/

  • Vinod,

    I'm not extraordinarily clear on what your question is but I would like to help. I'm going to do my best to answer what I think you are asking though so please feel free to let me know if I'm not answering your question.

    You should refer to the API Guide for all DriverLib API inquiries first. This is linked below and is what I am referring to in my response.
    dev.ti.com/.../
    Go to modules and then PCM to see what I'm referring to.

    When you call PCM_setCoreVoltageLevel, you get the choice to set PCM_VCORE to 0 or 1. This matters when you are trying to run the device at any frequency above 24MHz. If you want to run above 24MHz, you need to use PCM_VCORE1. Refer to section 5.6 "Operating Mode CPU Frequency Ranges" in the data sheet linked below.

    In order to decide whether you want to use the LDO, the DCDC or use the device in LF mode, you use PCM_setPowerMode. Section 5.5 "Operating Mode Vcc Ranges" gives more information about the voltage levels in each of those scenarios.

    www.ti.com/.../msp432p401r
  • i got it , a small information how this works PCM->CTL0 | PCM_CTL0_CPM_MASK in function "getPowerState()"

**Attention** This is a public forum