For novel ideas about building embedded systems (both hardware and firmware), join the 30,000+ engineers who subscribe to The Embedded Muse, a free biweekly newsletter. The Muse has no hype and no vendor PR. Click here to subscribe.

Jason Long is donating three copies of his brand new book Embedded in Embedded for this month's giveaway. Here's a short review. Enter the contest here.

A Sneak Preview

Summary: The sleep current war between MCU vendors is bogus.

Regular readers of embedded.com are aware of the sleep current war raging between MCU vendors. Marketing glitz and web pages are the guns; white papers are the ammo, which is being broadsided with increasing frequency. Everything claimed is probably true, but much of it is misleading and/or irrelevant.

It's truly remarkable just how little current is needed to keep a processor alive today. In the deepest sleep modes even some ARM parts claim just 20 nA (nanoamp) of consumption. That's a mere 0.02 microamp, a number that boggles the mind. In the desktop world CPUs suck over 100 amps while active, so I salute the MCU community for achieving such astonishingly-low figures.

First, some context. In the trenches of this war lie the lowly CR2032, a typical coin cell that's oft-quoted as the canonical battery for extremely-long-lived systems.

A CR2032 primary cell

A CR2032 has about 220 mAh of capacity (quoted capacities vary a little depending on the vendor), which means it can source one mA for 220 hours. (Note there is some dependency on capacity vs. how fast one discharges the battery). Its nominal voltage is 3.0, perfect for these 1.8 to 2V min MCUs, and the discharge curve has a sharp knee. They are considered "dead" at 2.0 V, which is confirmed by my experiments. Here's data for a number of batteries, all from one batch from the same vendor, discharged at a 0.5 mA rate:

Batteries discharging at a 0.5 mA rate.

Some of the vendors claim their MCUs can run for 20-30 years from a single CR2032. That's may be true in theory, but not in practice. I contacted a number of battery vendors and none guarantee shelf lives over ten years. One vendor said: "Not recommended for use after shelf life expires as the chemicals in the battery break down and it looses power a lot quicker, and there can be corrosion or leakage."

It's poor engineering practice to use a component beyond its rated specifications.

Though the war is all about battery lifetime of a mostly-sleeping system, that's irrelevant for design engineers. The right question - which no one seems to be asking - is: how much useful work can the system do while awake?

"Useful work" translates into a lot of things (clock rate, instruction set efficiency, etc), but is ultimately bounded by how much current the system (MCU and other components) can consume while awake. It's is the budget a design engineer has to work with, and cannot be exceeded (on average).

Doing the math, I came up with the following curve, which assumes a ten year battery life. It shows the number of mA available while awake, as a function of time spent sleeping and amount of current consumed while sleeping.

mA available as a function of sleep time and sleep current.

Here's the key takeaway: Sleep currents are almost irrelevant. Take two MCUs, one that needs 20 nA while sleeping and another that consumes 200 nA. The available awake current is just about the same in both cases. Even one that sucks a microamp while sleeping gives results not much different from an MCU needing an order of magnitude less.

Every MCU has vastly different mixes of features. Some wake up quickly. Others execute at great speed so wake times are minimized. Some preserve registers and memory while asleep; others don't. Brown-out and watchdog circuits may or may not be viable options while sleeping if maximum battery life is desired. So making comparisons is difficult. Even the sleep current numbers are frustratingly difficult to parse as not all vendors give worst-case values.

This article is titled "A Sneak Preview" because it's just the tip of the iceberg. I've been running experiments for 6 months to gain a deeper understanding about building ultra-long-lived battery-powered systems, and will be reporting more results soon.

Vendors have been very generous in offering their tools and support; for instance, I've evaluated several tools for measuring current:

Microchip just sent me their latest current-measuring tool, which I hope to dig into between trips to the Middle East and ESC-India this month. Agilent is sending their very interesting new N2820A current probe, which has a claimed 3 MHz bandwidth and 86 dB dynamic range. I'll review them both, and other similar tools as they become available.

Some of my experiments are quantifying the behavior of the components we use. For instance, there's very little known about how a CR2032 discharges in these ultra-low-sleep current applications, and I've amassed a vast amount of data using some custom tools, like that in the following picture. The results are surprising, and lead me to doubt that even a ten year life is attainable in a real system.
Stay tuned!

Nine-cell battery profiler using an mbed ARM controller board. Transistors switch different loads on each battery to run various current and time profiles. Loads are low tempco, 1% resistors. An A/D reads battery voltages and Vce of the transistors. A precision reference and software calibrates the entire analog path.

Published June 27, 2013

Do you need to eliminate bugs in your firmware? Shorten schedules? My one-day Better Firmware Faster seminar will teach your team how to operate at a world-class level, producing code with far fewer bugs in less time. It's fast-paced, fun, and covers the unique issues faced by embedded developers. Here's information about how this class, taught at your facility, will measurably improve your team's effectiveness.