Improve Cortex M4 MCU interrupt responses with an intelligent Peripheral Event System

Andreas Eieland and Espen Krangnes, Atmel Corp.

October 28, 2012

Andreas Eieland and Espen Krangnes, Atmel Corp.

The PES’s Event Routing Network is a set of programmable multiplexers that connect events from an event generator to the appropriate event user (Figure 2 below).

Each channel also includes programmable control and filtering logic that is used to define a peripheral’s behavior for a particular event, and the inputs required to produce it. This inter-peripheral communication allows actions to be triggered by external events, events generated by other peripherals, or by the CPU as a software-generated “manual” function.

Figure 2: - The Peripheral Event System
As shown in Figure 2, the PES can be configured so that individual or multiple peripheral elements can generate events simultaneously, often on the same conditions as interrupt requests.

These events are routed through the PES’s event routing system to other peripherals where they can be used to trigger subsequent actions. The CPU is only used for the initial setup phase, after this the peripherals and the PES operate completely independent of the CPU.

Using the earlier example, the PES could easily be configured to react on a timer/counter value or trigger an A/D conversion at a specific time, and without the CPU’s intervention.

In addition, either (or both) of these events can be triggered without ever bringing the MCU out of its sleep state, allowing the system’s limited battery capacity to be spared. The PES can also add more intelligence to the application by adding a sequence of events which wake the CPU if the timer/counter or the A/D reading it captures falls above or below a preset threshold value.

Even this relatively simple example illustrates how a peripheral event system can reduce an embedded system’s energy consumption, improve its ability to respond to real-time events, and simplify its software.

PES + ARM = Low Power + Real Time Performance
The SAM4L MCU’s Cortex M4 RISC processor is augmented with a Peripheral Event System that adds intelligence and autonomy to all its critical peripheral functions including:

*GPIO
*Asynchronous Timer (RTC)
*General-Purpose Timer /Counters
*Two-Wire Interface (TWI)
*Power Manager
*Analog Comparators and ADCs
*Capacitive Touch controller
*Peripherals and their associated multiplexer/filter logic is programmed by writing the appropriate data to each peripheral’s control registers.
* The code for the configuration sequence can also be created using a visual interface that’s available in Atmel’s Studio6 integrated development environment.

SleepWalking reduces power consumption and increases throughput. Once configured, the PES allows the SAM4L to spend most of its time in a “SleepWalking” state where its 32-bit ARM Cortex-M4 CPU remains asleep while it peripherals detect and respond to events, control I/O, energy management, and execute other routine functions.

It is also possible to configure the SAM4L’s Peripheral Event System to perform complex operations, with very little intervention from the Cortex M4 CPU, saving both valuable program memory and execution time. For example, it is possible to:

• Use a complex set of trigger conditions to start conversions on two ADCs at the same time

• Simultaneously perform an input capture and start an ADC conversion, in order to accurately time-stamp the conversion data.

• Simultaneously start two timers to ensure an identical time base without any offset

• Trigger a Timer/Counter input capture when a user presses a button

• Start an analog-to-digital conversion on the occurrence of a timer/counter overflow condition.

• Create responses based on virtually any other combination of ADC, DAC, Timer/counter and DMA events.

The PES’s intelligent peripherals can also be programmed to quickly bring the CPU out of its low-power SleepWalking mode to perform routine operations or respond to specific real-time events and alarm conditions which require its attention.

< Previous
Page 3 of 4
Next >

Loading comments...

Most Commented

  • Currently no items

Parts Search Datasheets.com

KNOWLEDGE CENTER