# LOW POWER MODE | INTERUPT MSP432

**URL:** <https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928>\
**Category:** Kernel\
**Created:** [June 23, 2019, 8:11am UTC](https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928 "2019-06-23T08:11:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 23, 2019, 8:11am UTC](https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928/1 "2019-06-23T08:11:13Z")

</div>

**[guilionzo](https://sourceforge.net/u/guilionzo/)** wrote on [Sunday, June 23, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/61f60c2cbb/#a531):

Hello Everybody,

I try to put the MSP432 in PCM\_LPM0\_LDO\_VCORE0 mode , using PCM\_setPowerState, but the code just keeping running the code. I don’t know what I’m doing wrong.

Has anyone passed through this before?  
Thank you!

**PS:**  
I’m using the FreeRTOS DEMO code.  
code: [https://github.com/guilionzzo/firmware\_onBoardComputer/blob/master/src/taskManager.c](https://github.com/guilionzzo/firmware_onBoardComputer/blob/master/src/taskManager.c)

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [June 23, 2019, 1:39pm UTC](https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928/2 "2019-06-23T13:39:49Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, June 23, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/61f60c2cbb/#a531/2164):

I don’t know anything about the code you are linking to so my answer is  
generic.

How the system will behave will depend on what the low power mode is  
doing and the clock used to generate the tick interrupt. If you just  
leave the clock that generates the tick interrupt running, and the low  
power mode also keeps the clock running, then you will most likely leave  
low power mode whenever the next tick interrupt occurs. I’m afraid I  
don’t know which clock you are using to generate the tick or what  
PCM\_LPM0\_LDO\_VCORE0 does so suggest having a look at the following for  
more info: [https://www.freertos.org/low-power-tickless-rtos.html](https://www.freertos.org/low-power-tickless-rtos.html)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 23, 2019, 2:34pm UTC](https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928/3 "2019-06-23T14:34:07Z")

</div>

**[guilionzo](https://sourceforge.net/u/guilionzo/)** wrote on [Sunday, June 23, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/61f60c2cbb/#0a1e):

Hi Richard,

I set the interrupt on INT\_PORT1, as shown in the code below. Even I specified what source will generate the interrupt, Do I have to disable the Systick Clock?

If it was a dumb question, my apologies. I don’t have much experience with this kind of application.

Thank you for the quick reply.

hibernate code:

```auto
    MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P1, GPIO_PIN1);
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1);
    
    MAP_Interrupt_disableSleepOnIsrExit();
    MAP_SysCtl_enableSRAMBankRetention(SYSCTL_SRAM_BANK1);
    MAP_Interrupt_enableInterrupt(INT_PORT1);
    MAP_Interrupt_enableMaster();
    
    PCM_setPowerState(PCM_LPM0_LDO_VCORE0);

```

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [June 23, 2019, 3:01pm UTC](https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928/4 "2019-06-23T15:01:58Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, June 23, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/61f60c2cbb/#0a1e/d20a):

Where are you putting the MCU into low power mode? Are you using the FreeRTOS tickless idle mode as described on the link in my previous post? If so, are you using the default tickless mode on an msp432 specific one. Apologies but replying on my cell/mobile/handy phone so can’t see all links.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 23, 2019, 11:01pm UTC](https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928/5 "2019-06-23T23:01:07Z")

</div>

**[guilionzo](https://sourceforge.net/u/guilionzo/)** wrote on [Sunday, June 23, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/61f60c2cbb/#c1b3):

Don’t worry my friend, you are really helping me in the issue, even if I do not see the links.

I was putting the MCU in low power mode using the **PCM\_setPowerState()**. Now I understand the situation better :D. The **xMaximumPossibleSuppressedTicks** is very low, 349 ticks. Instead of put MCU in low power mode I used **vPortSuppressTicksAndSleep()** in a wrapper function [CODE1]. It is working, but I’d like to put the microcontroller in a non-working state.

I saw the link that you sent and the [Low Power RTOS For ARM Cortex-M MCUs](https://www.freertos.org/low-power-ARM-cortex-rtos.html) material, but I’m bit confused whether I can configure two SysTick sources. Is it possible to use two SysTick sources? One used when the MCU needs more power and another when the hibernate mode is required.

I appreciate your help.

CODE1:

```auto
void hibernate(uint8_t time_ms)
{

    int clockFrequency = 48000000; //48MHz
    int tickRateHZ = 1000; //1KHz

    int timerCountsForOneTick = (clockFrequency / tickRateHZ); // 48000 - timer for one tick 20,8ms
    int maximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER
            / timerCountsForOneTick 349 ticks;
    int iterations = time_ms / maximumPossibleSuppressedTicks;
    int i = 0;

    for (i = 0; i < iterations; i++)
    {
        vPortSuppressTicksAndSleep(maximumPossibleSuppressedTicks); // loop to complete the time
    }

```

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [June 23, 2019, 11:27pm UTC](https://forums.freertos.org/t/low-power-mode-interupt-msp432/7928/6 "2019-06-23T23:27:32Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, June 23, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/61f60c2cbb/#c1b3/3ae8):

The default tickless idle operation does not use tick sources, but if  
you provide your own ‘suspend and sleep’ function as per the link I  
posted then you can just stop SysTick all together and configure  
whichever clock you want to bring the MCU out of low power mode at the  
appropriate time.

I’m still not clear _where_ you are placing the MCU into low power mode  
as if you are using the ‘suspend and sleep’ function it should be called  
by the kernel, not you, and it won’t call PCM\_setPowerState() unless you  
have already customised the sleep functions for your particular MCU.
