element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog GPIO wakeup example for the EasyL1105 MSPM0 board
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 22 Sep 2025 7:16 PM Date Created
  • Views 634 views
  • Likes 3 likes
  • Comments 1 comment
  • MSPM0L1105
  • ccs
  • MSPM0
  • easyL1105
  • code_composer_studio
Related
Recommended

GPIO wakeup example for the EasyL1105 MSPM0 board

Jan Cumps
Jan Cumps
22 Sep 2025
GPIO wakeup example for the EasyL1105 MSPM0 board

TI's SDK for the MSPM0 family has a set of examples. They are all targeting one of their LaunchPad dev kits. In this post, I'm porting another one to the EasyL1105.

The example, sysctl_shutdown, starts the MSPM0 in a selectable low power mode. You can then repeatedly wake it up by driving a GPIO input high. It's originally written for the LP-MSPM0L1117 LaunchPad. I'm porting it (just like I did in Port an SDK example to the EasyL1105 MSPM0 board ).

image

What does this project do?

It lingers in a selectable low power mode. You select the low power mode by wiring 2 GPIO inputs, named CONFIG_0 and CONFIG_1.

image
image source: the TI example referred to at the start of this blog

If you select SHUTDOWN mode, the MSPM0 wakes up when receiving a high signal on a GPIO pin. It 'll flash a led several times. Once for each time you've woken it up. Then back to SHUTDOWN.

The "flash a number of times" is interesting. This part of the example shows that we can preserve some active state (the variable counter) in SHUTDOWN mode

  1. Checks if it's woken up from SHUTDOWN
  2. If yes, increases counter, and flashes the green LED counter times.
  3. if not (usually, a power on or reset), it briefly flashes the blue LED.
  4. derives the desired low power level from the configuration pins
  5. sets the power policy
  6. saves state
  7. applies the set power policy
  8. low power
  9. if SHUTDOWN, wake up when GPIO pin driven high, then back to1.

Hardware resources

switch PA17 J3.2 (labeled UART TX). Connect a switch or a patch wire that allows you to either select GND or 3V3
LED1 PA14 Blue LED (on early rev 1, this is on PA26)
LED2 PA27 Green LED
CONFIG_0 PA5 J1.3 (labeled MOSI). Connect a switch or a patch wire that allows you to either select GND or 3V3
CONFIG_1 PA6 J1.2 (labeled SCK). Connect a switch or a patch wire that allows you to either select GND or 3V3

Testing

The low power modes are impossible hard to test with the debugger attached. Use a multimeter, oscilloscope or power meter to assess power use in low power and active mode.

  • First set the two config pins to the combination High High (SHUTDOWN).
  • Verify the current
  • apply 3V3 to the switch pin. Each time you do that, the device will wake up and flash the green LED, for the amount of times you woke it up.

Code highlights

In SysConfig, the switch setup is interesting:

image

In the code, a few topics stand out:

Startup: check if we (re)start because GPIO wakeup:

    rstCause = DL_SYSCTL_getResetCause();

    if (DL_SYSCTL_RESET_CAUSE_BOR_WAKE_FROM_SHUTDOWN == rstCause)
    /* Device was woken up from a SHUTDOWN state from this GPIO pin */
    {
        /* Release IO after Shutdown before initializing any peripherals */
        SYSCFG_DL_GPIO_init();
        DL_SYSCTL_releaseShutdownIO();
        DL_GPIO_disableWakeUp(GPIO_SWITCH_USER_SWITCH_1_IOMUX);

        /* Load save state after wake from SHUTDNSTORE */
        counter = 1 + DL_SYSCTL_getShutdownStorageByte(
                          DL_SYSCTL_SHUTDOWN_STORAGE_BYTE_0);

        /* Blink LED a number of times equal to counter */
        for (blink = 0; blink < (2 * counter); blink++) {
            DL_GPIO_togglePins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_2_PIN);
            delay_cycles(16000000);
        }
    }

Retrieve desired power policy, based on the state of the 2 config pins:

    /**
     * Resolve which Power policy to enable based on GPIO_INPUT_CONFIG_0_PIN and
     * GPIO_INPUT_CONFIG_1_PIN state.
     */
    switch (DL_GPIO_readPins(GPIO_INPUT_PORT,
        (GPIO_INPUT_CONFIG_0_PIN | GPIO_INPUT_CONFIG_1_PIN))) {
        /**
         * GPIO_INPUT_CONFIG_0_PIN and GPIO_INPUT_CONFIG_1_PIN are not connected
         * (since inputs are internally pulled high the pins will be at Vcc).
         */
        case (GPIO_INPUT_CONFIG_0_PIN | GPIO_INPUT_CONFIG_1_PIN):
            /**
             * Configure Shutdown wake-up pin to wake-up when pin is set
             * to high before changing power policy to SHUTDOWN
             */
            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);
            DL_SYSCTL_setPowerPolicySHUTDOWN();
            break;
        /**
         *  GPIO_INPUT_CONFIG_0_PIN  is not connected and
         *  GPIO_INPUT_CONFIG_1_PIN is connected to ground.
         */
        case (GPIO_INPUT_CONFIG_0_PIN):
            DL_SYSCTL_setPowerPolicySTOP0();
            break;
        /**
         *  GPIO_INPUT_CONFIG_0_PIN is connected to ground and
         *  GPIO_INPUT_CONFIG_1_PIN is not connected.
         */
        case (GPIO_INPUT_CONFIG_1_PIN):
            DL_SYSCTL_setPowerPolicySTANDBY0();
            break;
        /**
         * GPIO_INPUT_CONFIG_0_PIN and GPIO_INPUT_CONFIG_1_PIN are connected to
         * ground
         */
        default:
            DL_SYSCTL_setPowerPolicyRUN0SLEEP0();
            break;
    }

Check the shutdown clause. That's where the GPIO wakeup is configured.

Save state so that it survives the low power mode, and activate to desired power mode:

    /* Save application state before shutdown using SHUTDNSTORE */
    DL_SYSCTL_setShutdownStorageByte(
        DL_SYSCTL_SHUTDOWN_STORAGE_BYTE_0, counter);

    while (1) {
        __WFI(); /* Enter selected power policy */
    }

When you're finished

Low power designs can put your controller in a state, that makes it hard to reprogram it later. 
After I'm done testing a low power design, I prefer to re-program it with non-low-power firmware (E.g.: a blinky).

For this design, after you are done,

  • Open a non-low power design in CCS
  • connect it to a debugger
  • keep BOOT button pressed.
  • Start a debug session. Only release BOOT when your debugger is at main()

This will save you headaches later.

Have fun!

ccs project adapted to EasyL1105: sysctl_shutdown_20250922.zip

Related posts

  • Sign in to reply
Parents
  • DAB
    DAB 22 days ago

    Nice post Jan.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB 22 days ago

    Nice post Jan.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube