Other Parts Discussed in Thread: MSPM0C1104, SYSCONFIG, MSPM0G3507
Dear Ti Team,
I am using MSPM0C1104 in one of our project and I need to use this is Low power mode. I am sending the MCU to shutdown using DL_SYSCTL_setPowerPolicySHUTDOWN(); and this sends the CPU in shutdown mode. Now I want to wake it up using a GPIO and according to the datasheet Pin PA0 is 5V tolerant and has the capability to wake up.
I configured it as input interrupt but my uC is not waking up.
As per my understanding uC should wake up when the IO interrupt occurs if not please let me know how to wake the uC up. Here is my code to sending this in sleep.
SYSCONFIG_WEAK void SYSCFG_DL_GPIO_init(void) { DL_GPIO_enableGlobalFastWake(GPIOA); DL_GPIO_initDigitalInput(GPIO_Wake_Intr_IOMUX); DL_GPIO_initDigitalOutput(GPIO_LEDS_USER_LED_1_IOMUX); DL_GPIO_initDigitalOutput(GPIO_LEDS_USER_TEST_IOMUX); DL_GPIO_setPins(GPIOA, GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_TEST_PIN); DL_GPIO_enableOutput(GPIOA, GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_TEST_PIN); DL_GPIO_setLowerPinsPolarity(GPIOA, DL_GPIO_PIN_0_EDGE_RISE_FALL); DL_GPIO_clearInterruptStatus(GPIOA, GPIO_Wake_Intr_PIN); DL_GPIO_enableInterrupt(GPIOA, GPIO_Wake_Intr_PIN); } int main(void) { SYSCFG_DL_init(); /* * Turn OFF LED if SW is open, ON if SW is closed. * LED starts OFF by default. */ DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN); NVIC_EnableIRQ(GPIO_Wake_INT_IRQN); while (1) { if(shutdownEn) { shutdownEn = 0; DL_SYSCTL_setPowerPolicySHUTDOWN(); __WFI(); } __WFI(); } } void GPIOA_IRQHandler(void) { /* If SW is high, turn the LED off */ if (DL_GPIO_readPins(GPIO_Wake_PORT, GPIO_Wake_Intr_PIN)) { //Here sys should wake up.. DL_SYSCTL_releaseShutdownIO(); DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN); } /* Otherwise, turn the LED on */ else { DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN); shutdownEn = 1; } }
Please let me know what I can do to resolve this.
Regards,
Aman