Figure 1: An 8-bit microcontroller’s core-independent peripherals
are being used to extend the idle period to 205 days, without any
additional components or power penalty
performance. This is where an 8-bit
microcontroller can outshine a 32-bit
device in many cases. Some 8-bit
MCUs consume as little as 20 nA in
the lowest power setting, while 32-
bit bottoms out around 10 to 20 times
higher, at best.
There are a number of ways to wake
up the microcontroller from sleep
mode. Using the microcontroller’s
internal timers to wake up the system
periodically is a common practice. The
timer can be configured to trigger
an interrupt after it overflows. A 16-
bit timer with 1:8 pre-scaler, running
off the internal, low-power 31 kHz
oscillator (or with an external crystal)
can keep the device in sleep for about
17 seconds. Another option is to use
the MCU’s Watchdog Timer (WDT),
ideally with a maximum idle time of
256 seconds while consuming around
440 nA. (Once again, a typical 32-bit
MCU with WDT enabled consumes at
least 3 times the current of an 8-bit
MCU.)
Take an application that doesn’t need
to wake up frequently, such as an
environmental monitor that wakes up
roughly every four hours to read the
humidity sensor before going back to
sleep again. Does this mean that we
must wake up more frequently, due
to the internal timer limitations? Not
necessarily. One option is to use a
Real Time Clock (RTC) and crystal that
can provide accurate time keeping
in terms of hours, days, months and
even years, if needed. Since not all
microcontrollers offer an integrated
RTC and crystal, often for cost
reasons, a stand-alone RTC can also
be considered.
Core-Independent
Peripherals
Another option is to extend the
idle period without any additional
components or power penalty is to use
the unique peripherals found in some
next-generation 8-bit microcontrollers
(such as Microchip Technology’s
PIC® MCUs). For example, designers
can connect one of these MCU’s
Configurable Logic Cells (CLCs) and
its Numerically Controlled Oscillator
(NCO) to the 16-bit timer, in order to
extend the period from 17 seconds to
205 days, before triggering an interrupt
to wake up the MCU (See Figure 1).
Of course, it is rare for an application
to have a need to remain idle for
such long period, but the capability is
present if necessary.
When using an internal low power
(31kHz) oscillator to feed the resulting
(long) timer, the lowest cost solution
can be achieved. But the power
consumption of this implementation
can be reduced further by 50% to
around 2.3 µA, by using an external
32kHz crystal connected to the
secondary oscillator (SOSC) at a
slightly higher cost..
External interrupt sources can also be
used to wake up the microcontroller,
such as a switch or sensor. Some of
the larger MCU/MPUs have multiple
interrupts with priority levels, but
these features are often not present in
most of the low pin count MCUs on the
market. Remember the Configurable
Logic Cell module that we used to
extend the timer period in the previous
example? Not only can it be used to
create extra interrupt sources when
the MCU has only one system INT,
the CLC also allows designers to add
conditional or sequential logic to the
wake-up routine; making it smarter
with no additional current draw. If the
system requires a number of signals to
represent a specific state, in order to
wake up the CPU to check the condition,
very often it was awakened due to one
signal change, only to find the other
signals had not yet occurred. It is now
possible to configure and combine
the available logic functions and state
machines in the CLC, or even multiple
CLC modules, to create specific wake-
up conditions that avoid frequent false
triggers and unnecessary power drain.
The device wake up time can be a large
component of the “running” time in the
periodic profile of an application. While
for an 8-bit microcontroller internal
oscillator this is typically limited to a
handful of clock cycles (3-5 cycles
20 l New-Tech Magazine Europe