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.

MSP432P4111: Part does not go into LPM3 if UART baud rates are assigned to SMCLK

Part Number: MSP432P4111

We are using the MSP432P4111 and are making use of all 4 UARTS for communication using drivers (RS232, 485 and USB.)

Using rude mode we found that the power will go as low as expected with the UARTs baud rate generator assigned to the SMCLK but the part will not communicate.  Without rude mode, the part will only go to LPM0 which draws far too much current but communication works.  We then used the ACLK to set the baud rates for the UARTs and it worked as required without rude mode.  Using the ACLK limits the baud rate to 9600 and we really need 115200, especially with the USB.

Just changing what the clock source for the baud rates causes the part to not go into LPM3 even if no communication is attempted (we are a slave device).  We can work around this with the USB since the chip we are using provides a USB detect output and we can configure the clock source on the fly. With USB, our product is supplied from the USB port so higher power consumption is not an issue in that case.

Can you suggest a method to do this?

Thank you.

Paul

  • Hi

    Please see the datasheet the peripheral clock can only up to 128kHz,under LPM3 mode. That is the reason, you can‘t use SMCLK to drive UART.

    Eason

  • Hi Eason,

    Our intention is not to communicate while in LPM3 but to come out of LPM3 reply to the message and return to LPM3.  We are using SPI and I2C this way successfully.  Is there no character interrupt on the UARTs?  Should we connect the RX line to an interruptible GPIO to wake up the MSP432?

    Thank you.

    Regards,

    Paul  

  • You can use software configuration to leave LPM3 in UART interrupt.

    Eason

  • I'm working with Paul, and what we're trying to do is re-configure the system on the fly to support a higher baud rate (with a higher frequency clock source) if possible.

    We do not have a problem leaving LPM3.  Our problem is trying to get back into LPM3 after reconfiguring the UART to use a low frequency clock after it's been assigned a high frequency clock at runtime.

    With the lower frequency ACLK as the source we can only support lower baud rates, which is fine for normal operation, but we want to have the option to switch to the SMCLK for higher baud rate generation, which will only allow us to go down to LPM0.  Then we want to be able to switch back to the lower frequency clock source and return to the power profile we had at startup when the system would go into LPM3.

    So far we have no problem running in LPM3 with the ACLK as the source.  Then when we switch to SMCLK the power goes up.  When I reassign the UART source as the lower frequency ACLK I expect it to go back to LPM3 and the power level to drop, but it doesn't.  Instead the power level stays at the level it was at with the higher frequency clock source, as if it's only making it to LPM0, not LPM3.  I've tried re-configuring the clocks, but it doesn't help.  At the moment the only way to bring the power level back down is to cycle power, which is not an acceptable solution.

    Is there anything I can do to reconfigure the UART clock source on the fly to put it back to LPM3 mode?  Is there anything I can look for, like a register setting, to know when LPM3 is available, so I can debug it using the emulator?

  • The difference between different LPM mode, lie on how many kinds of clock still open.

    You need to clock SMCLK instead of just change the clock source.

    Please refer to this code:

    5852.pcm_go_to_lpm3.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /* --COPYRIGHT--,BSD
    * Copyright (c) 2017, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * --/COPYRIGHT--*/
    /*******************************************************************************
    * MSP432 PCM - Going to LPM3
    *
    * Description: In this very simple example, the use of the PCM API to go to
    * LPM3 is demonstrated. The device is configured for GPIO interrupt
    * (to wake the device up when the user presses the button on P1.1) and then
    * the device is put into LPM3 using the PCM_gotoLPM3 function. Furthermore,
    * the device is configured in a manner to minimize power consumption and
    * achieve datasheet specifications with regard to power consumption.
    *
    * MSP432P401
    * ------------------
    * /|\| |
    * | | |
    * --|RST P1.0 |---> P1.0 LED
    * | |
    * | P1.1 |<--Toggle Switch
    * | |
    * | |
    *
    ******************************************************************************/
    /* DriverLib Includes */
    #include <ti/devices/msp432p4xx/driverlib/driverlib.h>
    /* Standard Includes */
    #include <stdint.h>
    #include <stdbool.h>
    int main(void)
    {
    /* Halting the Watchdog */
    MAP_WDT_A_holdTimer();
    /* Terminating all remaining pins to minimize power consumption. This is
    done by register accesses for simplicity and to minimize branching API
    calls */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    You need to call PCM_gotoLPM3()

    Eason

  • Thanks for the code example, but we have reviewed several examples, none of which provide the insight we need into our problem.  We are calling PCM_gotoLPM3() in our idle task, and I can tell we're getting there when we set the UART source to the low frequency ACLK because the power draw is only 680uA.  If we set the UART source to SMCLK, the power draw goes up to 1.4mA, which is what we get when we call PCM_gotoLPM0().

    The problem occurs when calling UART_initModule(), where the selectClockSource parameter is set to EUSCI_A_UART_CLOCKSOURCE_SMCLK instead of EUSCI_A_UART_CLOCKSOURCE_ACLK.  We are constrained in our source of clocks because we are sourcing our clock from an external crystal at 32768Hz, setting CS_startLFXT(CS_LFXT_BYPASS), so it's not as if we can increase the frequency to 128KHz to take advantage of a LF active mode.

    We are also using three SPI ports and an I2C port, all of which are running at high frequencies, yet they don't seem to suffer the issue with the clock, since they don't prevent the system from going into LPM3.

    The application is a port from the MSP430, which didn't have this problem.  On the MSP430 the UART clock source was set to SMCLK, and the application had no problem getting into LPM3.  If setting the UART clock source to SMCLK works on the MSP430 why doesn't it work on the MSP432?

  • Please clarify the following statement:

    "You need to clock SMCLK instead of just change the clock source."

    Do you mean that the frequency of SMCLK needs to be changed?

    The frustrating thing is that while setting the UART clock source to ACLK brings the power down, if the clock source is set to SMCLK to accommodate a higher baud rate, setting the UART clock source back to ACLK does not bring the power back down.  The only way to restore the power to its initial level is to cycle power.

  • Another thing we tried was to remap the UART pins as input pins when the UART is not being used.

    Whether the UART is mapped to ACLK or the pins are mapped as inputs, the system goes into LPM3 and consumes about 680uA.

    If the UART is mapped to SMCLK to run a higher baud rate, then the UART pins are mapped as inputs once the UART is no longer needed, the system power will still not come back down to where it should be.

  • Thank you for your patient. Your problem is how to make Device enter LPM3, and make UART work in active mode with clock assigned to SMCLK? Is it right? I will look into this case and give you a code example as a solution.

    Eason

  • You are correct.  Specifically, the following line of code determines whether the system can go into LPM3 or not:

    eUSCI_UART_ConfigV1 UART_Params.selectClockSource= EUSCI_A_UART_CLOCKSOURCE_SMCLK;  //does not go into LPM3

    versus:

    eUSCI_UART_ConfigV1 UART_Params.selectClockSource= EUSCI_A_UART_CLOCKSOURCE_ACLK;  //goes into LPM3

    We are able to use SMCLK to source the SPI ports no problem:

    eUSCI_SPI_MasterConfig SPI_Params.selectClockSource= EUSCI_B_SPI_CLOCKSOURCE_SMCLK;  //goes into LPM3

    I can see how there would be a problem going into LPM3 with the UART configured to SMCLK when the UART is communicating, but I don't understand why it doesn't go to LPM3 when the UART is idle.

    Thanks.

  • Hi

    I am back.

    From my test of current consumption based on pcm_go_to_lpm3_uart_wakeup_MSP_EXP432P4111_nortos_ccs, it is 11uA.

    From my test of current consumption based on uart_loopback_24mhz_brclk_MSP_EXP432P4111_nortos_ccs, only add:

    MAP_PCM_enableRudeMode();
    a = MAP_PCM_gotoLPM3InterruptSafe();

    it is 1.4mA.

    You must know that if the return value of PCM_gotoLPM3InterruptSafe() is 1. It means it enter LPM3 successfully. From my test, in the second test, it enter LPM3. So your question is that how to decrease the current consumption in LPM3. 

    My advice is that:

    1. Change the core voltage:PCM_setCoreVoltageLevel(PCM_VCORE0);

    2. Change every pin as output pin and output low voltage.

    Here is the code I combine the two test code together:

    pcm_go_to_lpm3_uart_wakeup.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /* --COPYRIGHT--,BSD
    * Copyright (c) 2017, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * --/COPYRIGHT--*/
    /*******************************************************************************
    * MSP432 PCM - Going to LPM3 wake-up from EUSCIA0 UART.
    *
    * Description: In this very simple example, the use of the PCM API to go to
    * LPM3 is demonstrated. The device is configured for EUSCI A0 UART interrupt
    * (to wake the device up when UART characters are received). P1.0 LED is toggled
    * when the character 'U' is received. The device is put into LPM3 using the
    * PCM_gotoLPM3 function. Furthermore, the device is configured in a manner to
    * minimize power consumption and achieve datasheet specifications with
    * regard to power consumption.
    *
    *
    * MSP432P4111
    * -----------------
    * | |
    * | |
    * | |
    * RST -| P1.3/UCA0TXD|----> PC (echo)
    * | |
    * | |
    * | P1.2/UCA0RXD|<---- PC
    * | P1.0|---> LED
    * | |
    *
    ******************************************************************************/
    /* DriverLib Includes */
    #include <ti/devices/msp432p4xx/driverlib/driverlib.h>
    /* Standard Includes */
    #include <stdint.h>
    #include <stdbool.h>
    //![Simple UART Config]
    /* UART Configuration Parameter. These are the configuration parameters to
    * make the eUSCI A UART module to operate with a 9600 baud rate. These
    * values were calculated using the online calculator that TI provides
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    My test result is that the current consumption is less than 100uA.

    Eason

**Attention** This is a public forum