ECE + BAS February 2014 - page 18

state must be pushed to the stack again when
the next interrupt wakes the device. When an
ARM Cortex-M based microcontroller Sleep-
on-Exit is enabled, the device will enter sleep
directly after the ISR finishes without returning
to the thread (figure 4). This preserves the
processor in the interrupt state, saving the pre-
cious machine cycles normally required to
push the normal state onto the stack during
wake-up. Eliminating the stack push and pop
cycles saves both the time and energy otherwise
consumed by unneeded instruction cycles, as
well as any code a conventional MCU would
need to manage the stack between its sleep and
wake states. And, should the processor be awak-
ened by a halt debug request, the unstacking
process will be carried out automatically.
Like many MCUs, Cortex-M3/4 processors
can often achieve energy savings in interrupt-
driven applications by running at a relatively
high clock rate. This counter-intuitive but
commonly used energy-saving tactic works
well if the processor spends much of its time
in a sleep mode where the savings from its re-
duced active time far outweighs its slightly
higher operating current. Put simply, expending
10 percent more power for 20 percent less
time represents an overall energy savings.
This technique can be applied to any Cortex-
M series processor, and applications that involve
compute-intensive tasks also can often benefit
from the added capabilities of the Cortex-M4
processor. Its single-cycle DSP instructions
and optional floating point accelerator can
greatly reduce the number of execution cycles
required for functions such as digital signal
conditioning, filtering, analysis or waveform
synthesis. Some applications simply need the
processing horsepower of a DSP. For example,
some security systems employ a device that
senses glass breakages using acoustic analysis.
Breaking glass is accompanied by a distinctive
series of sounds and vibrations that culminate
in a resonance at the characteristic natural fre-
quency of the glass, in this case around 13kHz.
Most systems employ a sensor interface that
only wakes up the processor when tell-tale fre-
quencies are detected, but designs using a Cor-
tex-M4 DSP-enabled CPU achieve additional
energy savings by performing the actual glass
break analysis more quickly than software-
based solutions.
Even greater energy savings can be realized in
these applications using M4-based MCUs that
include advanced sleep modes and autonomous
peripherals that perform many routine tasks
while the CPU remains asleep. For instance,
the Cortex-M4 equipped Wonder Gecko
MCU7 has five distinct low-energy modes in-
cluding a 20nA shut-off state and 950nA deep
sleep mode (running real-time clock, with full
RAM and register contents retained and brown-
out detector enabled).
The same features that enable energy savings
can also yield other advantages. For example,
applications such as ultrasonic/acoustic water
meters, which must operate for years on a
small battery, require the MCU to remain in
sleep mode as long as possible. In addition to
helping to reduce the MCU wake time, the
Cortex-4 DSP and floating-point math in-
structions also eliminate the need for expensive
ultrasonic flow transducers by using sophisti-
cated filtering functions to extract the necessary
information from the output of inexpensive
acoustic sensors. In this application example,
the Wonder Gecko MCU peripherals provide
additional energy savings by acting as an
analog state machine that wakes the Cortex-
M4 processor only when needed.
While by no means complete, this modest col-
lection of tips and tricks should give you a good
idea of how you can exploit some of the Cortex-
M series lesser-known features to your advantage
in your next design. The References section at
the end of this article provides the details you’ll
need to put these and other important features
of the ARM Cortex-M family to work.
In addition, the EFM32 Gecko and Wonder
Gecko MCU families from Silicon Labs provide
examples of how the choice of an ARM-based
MCU with the right combination of I/O, ac-
celerators and other advanced peripherals can
improve the performance, energy consumption
and solution cost of a design. For more details
about these energy-friendly MCUs, see the
Additional Reading list8, which provides addi-
tional information on the unique autonomous
peripheral system and other advanced capa-
bilities of EFM32 MCUs.
February 2014
16
M
ICROCONTROLLERS
Figure 4.The ARM Cortex-M Sleep-on-Exit
capability reduces power consumption by
avoiding unnecessary program execution and
by reducing unnecessary stack push and pop
operations. [Courtesy of “The Definitive
Guide to the ARM Cortex-M31”.]
Figure 3. Software and hardware tools that pinpoint which functions are using the most current
eliminate the need for oscilloscopes and multimeters and enable fast debugging.
1...,8,9,10,11,12,13,14,15,16,17 19,20,21,22,23,24,25,26,27,28,...50
Powered by FlippingBook