Tag Archives: sleepwalking

Building a GPS tracker with Atmel’s SAM D20 MCU

A GPS tracking unit uses the Global Positioning System to determine and record the precise location of a vehicle, device or individual. Key design requirements for a GPS tracker include a small form factor, low power consumption and flexible connectivity options.

Atmel’s recently launched SAM D20 ARM Cortex-M0+ based MCU can be used to power such a device, taking all of the above-mentioned design requirements into account.

“The SAM D20 MCU – embedded with serial communication modules (SERCOM) and low power consumption – provides the flexibility, connectivity and low power required for GPS tracker applications,” Atmel engineering manager Bob Martin told Bits & Pieces.

“How low is low in terms of power consumption? Well, we are talking about <150µA/MHz in active (CoreMark) and <2µA with RTC and full RAM retention. Meanwhile, the peripheral event system and intelligent peripherals with Atmel SleepWalking technology further reduce CPU activity and power consumption.”

Martin also noted that the SAM D20 MCU offers design engineers 6 highly flexible serial communication modules (SERCOM), each configurable to operate as USART, I2C and SPI – thereby facilitating easy and flexible connection to external sensors, memories, PCs and wireless modules.

As expected, Atmel supports a wide range of dev tools and software, including Atmel Studio 6 (free IDE with GCC compiler), Atmel Software Framework (free SW libraries of production ready source code), Atmel Gallery (open to extensions) and the SAM D20 Xplained Pro Kit which is packaged with programmer and debugger, as well as connectors for expansion wings.

Building a remote process control node with Atmel’s SAM4L MCU

A remote process control node is an electronic device that monitors and controls manufacturing in factories, refineries and other industrial environments. Such nodes can either be linked to wired or wireless networks to communicate with a system controller.

Remote process control nodes typically require low active and standby power consumption, as many nodes are battery powered or have significant power restrictions. Plus, nodes are often in remote, inaccessible or physically dangerous locations, making changing batteries somewhat of a complex task.

Similarly, safe and predictable operation is a must, as is the need to detect and respond to alarms with the lowest latency possible. The same is true for secured communication and update capabilities, along with preventing commands and data from being overridden or altered by nefarious hackers.


Atmel’s versatile SAM4L (ARM) Cortex-M4 based MCU (microcontroller) lineup, paired with an ATZigBit RF module (or AT86RF231/232/233 RF transceiver), ATZigBit RF module and an AT30 EEPROM/temperature sensor, can be used to build a safe, secure and reliable remote process control node that more than fulfills the above-mentioned requirements.

“Atmel’s SAM4L offers low active and standby power consumption, safe and predictable operation, and secured communication and update to address the needs of a remote process control node,” an Atmel engineer told us.

“The SAM4L is fully functional down to 1.68V. In active mode, the total power consumption is as low as 90uA/MHz. In backup mode with RTC running, the current consumption is as low as 0.7uA. And last, but certainly not least, the DMA controller, event system and intelligent peripherals with SleepWalking dramatically reduce CPU activity and power consumption.”

It should also be noted that Atmel’s event system has a guaranteed response time, allowing the system to safely detect and respond to alarm conditions. An embedded AES/DES encryption engine ensures secure high data rate communications without waking the CPU, while a hardware-based random number generator (TRNG) facilitates truly secure node identification, along with firmware updates to help prevent hacking.

On the software side, engineers will have easy access to the SAM4L-EK full-featured kit and SAM4S software package for fast development and code evaluation. In addition, Atmel’s Studio 6 & Atmel Software Framework (ASF) supports all Atmel 8-bit and 32-bit MCUs. There is also a free IDE (integrated development environment) with compiler, free software libraries of production-ready source code and Common APIs for project portability.

Additional information about Atmel’s SAM4L MCU lineup can be found here.

Atmel’s SAM4L can power this smart glucose meter

Diabetes is characterized by high blood sugar due to insufficient production of insulin by the pancreas – or because cells do not properly respond to the insulin that is produced.

Specifically, Type 1 diabetes is attributed to the body’s failure to produce insulin and requires an individual to either inject insulin or wear a pump which automatically drips an appropriate amount of the peptide hormone into the bloodstream.

For those who choose to inject themselves with insulin, a smart glucose meter is obviously critical. Indeed, this portable medical device is tasked with measuring, displaying and recording the concentration of glucose in the blood. Clearly, the battery-powered monitor demands dependable silicon under the hood to ensure extended battery life along with a high level of accuracy to prevent reading or operator errors.


Atmel’s SAM4L microcontroller (MCU) fits the bill with its ultra low power consumption, versatile integration capabilities and multiple connectivity options. Related components include the AT86RF231/232/233 RF Transceiver, ATZigBit RF Module and ATSHA204 Authentication IC with EEPROM.

“Atmel’s SAM4L offers low power operation to extend battery life, with our PicoPower Technology achieving dynamic mode down to 90uA/MHz and static backup mode with RTC down to 0.7uA with fast wakeup (<1.5ms),” an Atmel engineer explained.

“Meanwhile, the Event System and SleepWalking features frees the CPU up from peripheral operations, resulting in lower system power consumption, as our embedded Segment LCD Controller updates/refreshes displays with minimal CPU and power impact.”

The SAM4L is also integrated with full-speed USB (host & device) and transceiver (removing external crystal and PHY), up to 160 segment LCD controller, high precision analog and an internal temperature sensor. On the software side, Atmel offers free software libraries of production-ready source code for USB, ZigBee and Proprietary Low Footprint 802.15.4 Mesh.

Additional information about Atmel’s versatile SAM4L is available here.

A closer look at Atmel’s picoPower technology

We briefly touched on Atmel’s picoPower technology this morning in the context of Samsung’s Galaxy S4 smartphone, which is equipped with Atmel’s sensor hub management MCU (microcontroller unit). The MCU collects and processes data from all connected sensors in real-time, optimizing multiple user experiences, such as gaming, navigation and virtual reality.

Atmel’s sensor hub MCU also lowers the overall system power consumption via picoPower technology to prevent drain and enable longer battery life. In a broader sense, it is important to note that all Atmel AVR picoPower devices are designed from the ground up for low power consumption utilizing the company’s proprietary low leakage processes and libraries to provide minimal power sipping in all sleep modes.

“An easy way to reduce power consumption in any design is to lower the operating voltage. But this would be mostly useless if analog performance was compromised,” an Atmel engineering rep told us. “Central to the AVR picoPower technology are carefully designed analog functions that continue to operate all the way down to 1.62V.”

To be sure, the various features of a microcontroller traditionally become unstable or even unusable at different voltage levels, as inaccuracies in analog peripherals, limited operation or an inability to write to non-volatile memory prevents designs from running at lower voltages. This leads to shorter battery life, larger and more expensive batteries, or a lot time spent trying to find workarounds for something that should be addressed by the microcontroller to begin with.

As such, Atmel AVR microcontrollers offer true 1.62 V operation, including all analog modules, oscillators, and flash and EEPROM programming. Meaning, various microcontroller features will not shut down one by one as the voltage drops.

“You can run the same application at different voltages without making comprises. All peripherals are available regardless of supply voltage,” the engineering rep continued. “The ADC, for example, can be used to measure the supply voltage as the cutoff voltage is approached, and when detected, it enables the application to store vital information and ensure a safe shutdown, enabling a glitch-free restart after changing batteries.”

Remember, power consumption is proportional to supply voltage, so running at as low a supply voltage as possible saves power. For battery operated devices, the Atmel AVR microcontroller can make use of the remaining power available at lower battery voltage levels as the battery depletes.

In addition to true 1.62 V operation, Atmel’s AVR peripherals with picoPower are capable of determining if incoming data requires use of the CPU or not. This feature is aptly dubbed SleepWalking, as it allows the CPU to sleep peacefully until an important event occurs, eliminating millions of false CPU wakeups. This means the CPU is no longer required to check whether or not a specific condition is present, such as an address match condition on the TWI (I2C) interface, or a sensor connected to an ADC that has exceeded a specific threshold.

Of course, entering sleep mode shuts down parts of the microcontroller to save power. Most oscillators and clocks consume a considerable amount of power when in use, and when waking up from sleep modes, these clocks need to be stable before they can be used. Waiting a long time for the clocks to be available and stable results in wasted power.

However, the Atmel AVR microcontroller is capable of waking up from sleep mode in 8 clock cycles when running from the internal RC oscillator. Moreover, a digital frequency locked loop (DFLL) replaces the traditional phase locked loop (PLL) to provide a programmable internal oscillator that is much faster and accurate.

It can also eliminate external components, which reduces the total system power consumption even more. When in sleep mode with the synchronous clocks turned off, the microcontroller can still wake up from asynchronous events such as a pin change, data received or even an I2C bus address match – enabling multiple wake-up sources from even the deepest sleep modes.

As noted above, the benefits of picoPower are clearly illustrated by Samsung’s decision to equip its flagship Galaxy S4 smartphone with Atmel’s sensor hub MCU which features picoPower tech.

“Atmel allows Galaxy S4 users the ability to enjoy applications requiring real-time motion sensing, without ever compromising battery life,” said Ingar Fredriksen, Senior Director of Flash-based Microcontrollers, Atmel Corporation. “ We look forward to teaming with Samsung on future designs.”

Let your Atmel SAM4L MCU do SleepWalking

Like several other Atmel core microprocessor devices, the new SAM4L ARM Cortex-M4 based MCU supports SleepWalking. This is a state where you can service interrupts and measure or test outside events while keeping the CPU core in a low-power sleep state.

  • Unnecessary wake-ups are one of the main events that cause excessive power consumption. An interrupt wakes the entire system up to check a trivial condition. In most cases the system goes directly back to sleep again. Having the CPU wake to check these repetitive events uses a lot of power. A monitoring example shows how you can use SleepWalking to reduce the power consumption of your system.
The SAM4L series integrates Atmel’s proprietary picoPower® technology

The SAM4L series integrates Atmel’s proprietary picoPower® technology

Say you are monitoring a temperature sensor. If the value exceeds a threshold, your program should take an action such as turning on the air conditioning. Using a traditional approach, an interrupt would wake the system and the core at regular intervals to check the temperature. Very often the temperature is below the threshold and the program takes no action other than servicing the interrupt. The wake-up was unnecessary. In our case, the system would wake up over and over during winter and the threshold will rarely be exceeded. That means a lot of wasted MCU power. With SleepWalking you set the measurement and testing at the peripheral level. Only when the event is qualified will the rest of the system wake-up.

That is what Atmel calls intelligent peripherals. There is a nice video that shows the SleepWalking concept.

Intelligent MCUs for Low Power Designs

By Florence Chao, Senior Field Marketing Manager, MCU Business Development

Industrial and consumer devices using ARM® Cortex®-M4

Industrial and consumer devices using ARM® Cortex®-M4

Blood glucose meters, sport watches, game controllers and accessories, guess what they all have in common. Yes, like a lot of other industrial and consumer devices, they run on batteries and demand long or extended battery life. As an engineer, this translates into a key challenge when designing an embedded computing system. You need a central heart—in this case a microcontroller—that consumes as little power as possible in both active and static modes yet doesn’t sacrifice performance.  The Atmel® SAM4L ARM® Cortex®-M4 based series is designed with this in mind.

The SAM4L microcontroller redefines low power, delivering the lowest power consumption in its class in active mode (90uZ/MHz) as well as in static mode with full RAM retention running. It also delivers the shortest wake-up time (1.5us). At the same time, this is the most efficient microcontroller available today, achieving up to 28 CoreMark/mA.

The SAM4L series integrates Atmel’s proprietary picoPower® technology

The SAM4L series integrates Atmel’s proprietary picoPower® technology

The SAM4L series integrates Atmel’s proprietary picoPower® technology, which ensures the devices are developed from the ground up—from transistor design to clocking options—to consume as little power as possible. In addition, Atmel Sleepwalking technology allows the peripherals to make intelligent decisions and wake up the system upon qualifying events at the peripheral level.

In this video, you will see how the SAM4L microcontroller supports multiple power configurations to allow the engineer to optimize its power consumption in different use cases. You will also see another good feature of the SAM4L series, Power Scaling, which is a technique to adjust the internal regulator output voltage to further reduce power consumption provided by the integrated Backup Power Manager Module. In addition, the SAM4L series comes with two regulator options to supply system power based on the application requirement. While the buck/switching regulator delivers much higher efficiency and is operational from 2 to 3.6V. The linear regulator has higher noise immunity and operates from 1.68 to 3.6V.

The Atmel® SAM4L ARM® Cortex®-M4 based Microcontroller

The Atmel® SAM4L ARM® Cortex®-M4 based Microcontroller

It’s all about system intelligence and conserving energy. Simply put, the SAM4L microcontroller is your choice if you are designing a product that requires long battery life but you don’t want to sacrifice performance.  To get started, learn more about Atmel SAM4L Xplained Pro Evaluation and Starter Kits.

SleepWalking Helps Conserve Energy

Imagine you are the sole care-provider for a household full of babies all under the age of 3.  Each and every single one of them requires you to tend their needs and desires.  From feeding to going to the bathroom, from burping to changing their diapers, from bathing to putting them to nap/sleep to keeping them entertained, you are needed every single step of the way.  Isn’t that just exhausting?  Fast forward by a decade when they are grow to become teenagers – autonomy and self-sufficiency – in which they can all satisfy their own basic needs without your help, unless it’s an urgent matter.  Now you have much more free time to read a book, surf the net, get a job, or take a nap.

In essence, this is what SleepWalking is all about in the realm of an Atmel MCU.  Traditionally a technology found in the AVR architecture only, it is now incorporated into the ARM architecture as well.  It is a feature that extends the concept of autonomous peripherals (babies) that operate independently of the CPU core (a parent or care-provider) during active mode, to actually keeping the peripherals functional when the system clock has been stopped. This is achieved by clocking the peripherals using the real‐time clock (RTC), instead of the system clock.

sleepwalking explained

In the SAM4L, SleepWalking has been integrated into many of the peripherals, including the analog comparator, the ADC, the I2C, UART and the capacitive touch interface. It is then the peripheral that decides whether to wake the system, instead of the CPU waking periodically to carry out an interrupt service routine.  With this feature, the need to wake the CPU reduces significantly thus allowing it to stay inactive for longer and more frequent and thereby conserving more energy.

For more information, check out this video for a more detailed explanation on SleepWalking.  Please note: despite the AVR UC3 being used as an example in the video, the underlying fundamentals of how SleepWalking works and its benefits are the same as in the ARM SAM4L.