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.
Hi,
we are working on an application for the MSPM0L1304 (using an LP-MSPM0L1306 for development) that would ideally use all available wakeup pins. However, I have noticed that when I set up PA0 to wake up when high, the MCU wakes up even when the pin is low.
For verification, I have reproduced the same issue by modifying the sysctl_shutdown
example from the SDK.
I will list the steps I have used to reproduce the issue:
sysctl_shutdown_LP_MSPM0L1306_nortos_gcc
from the SDKUSER_SWITCH_1
USER_SWITCH_1
From what I understand from the datasheet, both PA1 and PA0 should have wakeup support, as they are both 5V tolerant open drain IO pins. I have checked the errata sheet, as revised in April 2023, but I can't find anything relevant.
Interestingly, it does work when the pin is configured to wake on low, it works in our application code as well as the example.
We do have workarounds, but it would increase the BOM cost of the finished product.
Please find attached an archive of the modified example code, as well as the compiled binary.
How can we use the wake on high level function on the PA0 pin?
Thank you for your help!
Balint
HI Balint,
I apologize for the delay in responding. I believe I found the issue.
The original code uses PA18 (SW1) which is pulled low through R11. The wake logic is assigned a 1 on line 97, meaning wake when pin goes high.
If you use PA0 or PA1, you will notice both are pulled high through two external resistors. Unless you change the wakeup to 0 on line 97, the device will continuous wake.
I changed wakeup to 0 and now both PA0 and PA1 work like PA18.
Hi Dennis, thank you for looking into this. Unfortunately, that's not quite what I am looking for. We would prefer both polarities to work, as we would like to implement a "wake on pin change" feature.
To be able to test WAKEUP_ON_1, I jumpered the pins to GND (see steps 5 and 9) and expected the MCU to wake up when the jumper is removed (step 7 and 11). This behaviour worked on PA1, but not on PA0.
Hi, Balint
I didn't see this wake up feature in L1306's datasheet 6.2:
There is only PA17 and PA18 support wake from shutdown mode.
Document: https://www.ti.com/lit/ds/slasex0d REVISED JANUARY 2024
Regards,
Helic
Hi Helic,
Yes, the I/O structure for those pins is listed as 5V tolerant open drain. However, 5V tolerant open drain pins are documented to support wakeup, according to Table 6-2:
I have updated my documents.
Thank you,
Balint
Hi,
any updates on this? I'm still convinced that I was doing my testing correctly and that these pins should support wakeup according to the datasheet. (In fact, PA1 works correctly with either polarity)
Thank you,
Balint
Hi Balint,
Ok, I'm in the lab today working on similar issue so I'll see if I can get it to work.
Hi Balint,
Here is the demo code you can refer to:
https://tidrive.ext.ti.com/u/2JJU4JKSVPjKklT3/f24d2678-51eb-4c25-aa07-2eb710741779?l
password:3BX8{nZQ
Hi Zoey,
Thank you, that helped me figure it out.
Your example has the wakeup enabled in the .syscfg file as well as in the source code. This causes an extra line to be emitted in SYSCFG_DL_GPIO_init:
DL_GPIO_initDigitalInputFeatures(GPIO_SWITCH_USER_SWITCH_1_IOMUX, DL_GPIO_INVERSION_DISABLE, DL_GPIO_RESISTOR_NONE, DL_GPIO_HYSTERESIS_DISABLE, DL_GPIO_WAKEUP_ON_1);
This fixes my issue.
In short the following sequence seems to be needed:
DL_GPIO_initDigitalInputFeatures(GPIO_SWITCH_USER_SWITCH_1_IOMUX, ..., DL_GPIO_WAKEUP_ON_1); // What I was missing DL_SYSCTL_releaseShutdownIO(); DL_GPIO_disableWakeUp(GPIO_SWITCH_USER_SWITCH_1_IOMUX); DL_GPIO_initDigitalInputFeatures(GPIO_SWITCH_USER_SWITCH_1_IOMUX, ..., DL_GPIO_WAKEUP_ON_1);
I will look into integrating this into our firmware as soon as I can.
Thank you,
Balint
Some final notes:
Our firmware was using the following sequence, which worked with PA1, and PA17:
DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ENABLE); DL_SYSCTL_releaseShutdownIO(); DL_GPIO_initDigitalInput(IOMUX_PINCM1); // bulk of the firmware DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1); DL_SYSCTL_setPowerPolicySHUTDOWN(); __WFI();
This didn't work.
The following also didn't work:
DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1); DL_SYSCTL_releaseShutdownIO(); DL_GPIO_initDigitalInput(IOMUX_PINCM1); // bulk of the firmware DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1); DL_SYSCTL_setPowerPolicySHUTDOWN(); __WFI();
However, the following two options did:
DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1); DL_SYSCTL_releaseShutdownIO(); DL_GPIO_disableWakeUp(GPIO_SWITCH_USER_SWITCH_1_IOMUX); // bulk of the firmware DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1); DL_SYSCTL_setPowerPolicySHUTDOWN(); __WFI();
To eliminate a couple of instructions:
DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1); DL_SYSCTL_releaseShutdownIO(); DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1 & ~DL_GPIO_WAKEUP_ENABLE); // bulk of the firmware DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1); DL_SYSCTL_setPowerPolicySHUTDOWN(); __WFI();
This last version seems to work on PA0, PA1 and PA17.
I'm glad that I finally have a working firmware build!
Thank you, Balint