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.

MSP432P401V: PWM output to pin while in LPM3

Part Number: MSP432P401V

Good evening,

I have a weird issue when routing a PWM signal from the timer module to the respective output pin. I am using the MSP432p401v in RCG package, which means that TA2.3 can be configured at pin 6.6 (see datasheet SLASEA0B, page 178).

If I do so, the current draw is unusually high (around 15 mA) and the PWM amplitude measured at P6.6 is only 1.8V p-p (Vcc is 3.3V). I suspected a short to GND at first, but >1M is measured here. Changing the code to TA2.1 on P5.6 yields the expected results, 3.3V p-p PWM signal on pin 5.6 and low microamps current draw.

Any ideas?

#include "msp.h"
#include "driverlib.h"

/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>

/* Timer_A PWM Configuration Parameter */
Timer_A_PWMConfig pwmConfig =
{
        TIMER_A_CLOCKSOURCE_ACLK,
        TIMER_A_CLOCKSOURCE_DIVIDER_1,
        33,
        TIMER_A_CAPTURECOMPARE_REGISTER_3,
        TIMER_A_OUTPUTMODE_RESET_SET,
        16
};

int main(void)
{
    /* Halting the watchdog */
    MAP_WDT_A_holdTimer();
    MAP_PSS_disableHighSide();

    MAP_PCM_enableRudeMode();

    MAP_GPIO_setAsOutputPin(GPIO_PORT_PA, PIN_ALL16);
    MAP_GPIO_setAsOutputPin(GPIO_PORT_PB, PIN_ALL16);
    MAP_GPIO_setAsOutputPin(GPIO_PORT_PC, PIN_ALL16);
    MAP_GPIO_setAsOutputPin(GPIO_PORT_PD, PIN_ALL16);
    MAP_GPIO_setAsOutputPin(GPIO_PORT_PE, PIN_ALL16);
    MAP_GPIO_setAsOutputPin(GPIO_PORT_PJ, PIN_ALL16);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_PA, PIN_ALL16);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_PB, PIN_ALL16);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_PC, PIN_ALL16);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_PD, PIN_ALL16);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_PE, PIN_ALL16);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_PJ, PIN_ALL16);

    /* Starting LFXT and sourcing ACLK and BCLK from it */
    MAP_CS_setExternalClockSourceFrequency(32000,32000);
    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_PJ, GPIO_PIN0 | GPIO_PIN1, GPIO_PRIMARY_MODULE_FUNCTION);
    MAP_CS_startLFXT(CS_LFXT_DRIVE3);
    MAP_CS_initClockSignal(CS_ACLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);

    /* Configure P6.6 to TA2.3 */
    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P6, GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);

    MAP_Timer_A_generatePWM(TIMER_A2_BASE, &pwmConfig);

    while (1)
    {
        MAP_PCM_gotoLPM3();
    }
}

  • Hi,

    Is this something you see on the launchpads too?

    Regards,

  • Unfortunately with the MSP-EXP432P401R I have available here this cannot be tested, since the -401R silicon does not support active timers in deep sleep modes.

    Edit: It seems I mistakenly attributed the behaviour to the low power mode, which after trying again seems not the case. Also I tested the same code on the MSP-EXP432P401R without problems.

  • Hello,

    Has the issue been resolved? From the last comment it's not clear what the issue is? If the issue is not resolved can you summarize what the issue is?

    Thanks,

    Sai

  • Just today I found some time to look into this again, and was able to solve the issue.

    Basically the GPIO initialization was fishy, and it didnt have anything to do with PWM at all.

    This code results in what appears to be a low impedance path to GND:

        MAP_GPIO_setAsOutputPin(GPIO_PORT_PC, PIN_ALL16);

    While this code works well:

    MAP_GPIO_setAsOutputPin(GPIO_PORT_P6, GPIO_PIN6);

    Maybe I misinterpreted how the GPIO ports are grouped together as "Port A / B / C..." etc.

**Attention** This is a public forum