• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microcontroller Tips

Microcontroller engineering resources, new microcontroller products and electronics engineering news

  • Products
    • 8-bit
    • 16-bit
    • 32-bit
    • 64-bit
  • Applications
    • 5G
    • Automotive
    • Connectivity
    • Consumer Electronics
    • EV Engineering
    • Industrial
    • IoT
    • Medical
    • Security
    • Telecommunications
    • Wearables
    • Wireless
  • Learn
    • eBooks / Tech Tips
    • EE Training Days
    • FAQs
    • Learning Center
    • Tech Toolboxes
    • Webinars/Digital Events
  • Resources
    • Design Guide Library
    • DesignFast
    • LEAP Awards
    • Podcasts
    • White Papers
  • Videos
    • EE Videos & Interviews
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Engineering Training Days
  • Advertise
  • Subscribe

Optimizing power efficiency in microcontrollers

October 28, 2016 By Scott Thornton 2 Comments

button-1365348__180Power efficiency is more important now than in the past, as portable, battery-powered devices compete for market share on features and battery life. Battery technology has not improved radically in the recent past, and attempts at innovation can wreak havoc with overheated batteries that sometimes burst into flames. Therefore, using less energy to do more tasks is a safe but tedious route to better power efficiency.

Use Efficient Code

There are several ways to reduce power consumption. One is to write very efficient code. One can do more with fewer instructions, careful planning, and by optimizing the compiler.  A compiler optimized for maximum speed produces different results than the same compiler set for minimum code size for lower power consumption. Where possible, remove unnecessary instructions and code for fewer clock cycles to achieve the same objective. One unnecessary step that executes several times a minute adds up. There are code analysis tools built specifically for low power development, such as the ultra low power ULP Advisor, a free tool for MSP43x MCUs from Texas Instruments. The ULP Advisor compares code against a ULP checklist and comes as part of Code Composer Studio (v 5.0 and higher). The ULP Advisor is also integrated into the IAR Embedded Workbench. Those not using MSP430s can take advantage of the ULP Advisor Rule Table, which lists common sense rules such as terminating unused GPIOs, using local instead of global variables when possible, and avoiding processor-intensive operations such as divide or floating point operations.

Use Low Power Modes

Assuming that you are using an ultra-low-power MCU, another way to lower total power consumption is to take full advantage of the flexibility offered by the many sleep states that ultra-low power MCUs now offer. Some MCUs have 6 or more different states of operation, which helps if the time it takes for your MCU to wake up matters, even if it’s only microseconds.

ulp-rule-tableMicrochip PIC controllers have a “doze” mode where the core and FLASH operate at a slower clock rate than normal and peripherals, the voltage regulator, and RAM are all kept in an active state. In idle mode, the core and FLASH are turned off. Sleep mode goes a bit further, and core, FLASH, and any peripherals that depend on the system clock are turned off at the cost of tens of microseconds to wake-up. A longer term type of sleep mode is for when longer latencies are acceptable, and is called “low voltage sleep” by Microchip Technology. Low voltage sleep takes it a step further by reducing the current output of the regulator. By maintaining a low-current, low-voltage sleep mode, it maintains RAM readiness and an optional real-time clock, watchdog, or another timer. Deep Sleep mode does not preserve RAM readiness, where the device takes time (and consumes power) to wake by going through a restart sequence upon wake-up. Deep sleep mode has most of the MCU turned off except for interrupt handling, an RTC, or a timer. A free Battery Life Estimator Tool is available from Microchip Technology that helps with designing an application with a limited power budget, be it peak power or total battery life limitations.

Common sense prevails. Don’t poll for event flags if your MCU has an integrated peripheral that can be used to wake up the CPU instead. Take advantage of Idle mode when waiting for an interrupt. Check to see if on-chip peripherals have power-saving features.  The more you know about your power budget and the details of how your design or application operates, the more you will be able to take advantage of all that modern chips and tools have to offer.

 

Filed Under: FAQ, Featured Tagged With: basics, FAQ

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured Contributions

Five challenges for developing next-generation ADAS and autonomous vehicles

Securing IoT devices against quantum computing risks

RISC-V implementation strategies for certification of safety-critical systems

What’s new with Matter: how Matter 1.4 is reshaping interoperability and energy management

Edge AI: Revolutionizing real-time data processing and automation

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center

EE ENGINEERING TRAINING DAYS

engineering
“bills
“microcontroller
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

RSS Current EDABoard.com discussions

  • How to get started with RTL design?
  • RFsoc4x2 fpga diagram request
  • What is the purpose of the diode from gate to GND in normal Colpitts oscillator Circuits?
  • How can I get the frequency please help!
  • 12VAC to 12VDC 5A on 250ft 12AWG

RSS Current Electro-Tech-Online.com Discussions

  • 100uF bypass Caps?
  • Fuel Auto Shutoff
  • Actin group needed for effective PCB software tutorials
  • how to work on pcbs that are thick
  • compatible eth ports for laptop

DesignFast

Design Fast Logo
Component Selection Made Simple.

Try it Today
design fast globle

Footer

Microcontroller Tips

EE World Online Network

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

Microcontroller Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy