Newsletter

Use an MCU's low-power modes in foreground/background systems

The proper use of an embedded MCU's low-power/sleep modes is critical to a design's success

Page 1 of 9

Courtesy of Embedded Systems Design

The proper use of an embedded MCU's low-power/sleep modes is critical to a design's success.

In today's world of battery-operated devices, the proper use of the low-power/sleep modes provided in most embedded microcontrollers (MCUs) is critical. At the same time, most high-volume MCU applications, such as home appliances, vending machines, motor controllers, and electronic toys, are organized as foreground/background systems (super-loops or main + ISRs).

The foreground/background architecture consists of two main parts--the foreground comprises the interrupt service routines (ISRs) that handle asynchronous external events in a timely fashion, and the background is an infinite loop that uses all remaining CPU cycles to perform the less time-critical processing.

The foreground typically communicates with the background through shared memory. The background loop protects this memory from potential corruption by disabling interrupts when accessing the shared variables.

To employ a low-power MCU mode, the background loop must first determine that all external and internal events have been processed so that the CPU clock can be stopped until the next external event (an interrupt) will wake the CPU up. This situation is called the idle condition and is illustrated in Figure 1.

View the full-size image

Because the determination of the idle condition involves testing the variables shared with the foreground (ISRs), the background loop must disable interrupts before detecting the idle condition. Moreover, the idle condition remains valid only as long as interrupts remain disabled. If the interrupts were enabled after the background loop determines that all its work is done for now, but before actually switching to the low-power mode, an interrupt could preempt the background loop at this point and an ISR could produce new work for the background loop, thus invalidating the idle condition.



Page 2: next page  

Page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9







Related Content

TECH PAPER
1. IBM Rational Dashboard Drive Improved Decision Making

TECH PAPER
2. Upgrading to an Intel Multicore Ecosystem Keeps a Car Simulator Running in the Fast Lane

TECH PAPER
3. New Tools Answer Old Issues in Wiring Harness Design

TECH PAPER
4. AUTOSAR and FlexRay: A Tale of Two Standards

 


 Featured Jobs
Accenture seeking Project Management Team Lead in Charlotte, NC

Accenture seeking Software Engineer in Salt Lake City, UT

Boeing Company seeking Software Engineer in Herndon, VA

Switch and Data seeking Customer Solutions Engineer in Dallas, TX

Chart Industries seeking Sr. Developer in Cleveland, OH

More jobs on EETimesCareers
 Sponsor
 CAREER CENTER
Ready to take that job and shove it?
SEARCH JOBS:

 SPONSOR

 RECENT JOB POSTINGS
For more great jobs, career related news, features and services, please visit EETimes' Career Center.