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.

Smart peripheral cores: the next step in MCU evolution
Intelligent peripherals are a natural extension of the I/O controllers, algorithmic accelerators, and other specialized hardware modules already used in many MCUs. Even many of today’s low-cost 8-bit microcontrollers include specialized accelerator modules or state machines to offload compute-intensive tasks such as encryption, arithmetic’s, error correction, and supporting communication protocols from the main processor.

Nevertheless, the accelerator modules, communication ports, and other I/O all rely on the main processor (CPU) for some aspects of their operation and often compete with it for access to the memory bus and other shared resources.

As a result, many applications require carefully-written interrupt service routines, a Real Time Operating System or other software mechanisms to manage the conflicting demands of the CPU and its peripherals, and even then the CPU can end up as a bottleneck in the total program flow

As a simple example, an MCU is often required to execute event-related tasks at specific times, such as performing an analog to digital conversion when a timer/counter’s register signals an overflow, or capture the value in a Timer/Counter’s register at the instant a user presses a button.

A traditional MCU would require the developer to either continuously poll the counter/timer and the push button or, more likely to create an interrupt service routine (ISR) for each task and include it in the MCU’s firmware.

This can introduce problems if the MCU is being used in a power-constrained application where it minimizes the drain in its battery or energy harvesting source by spending most of its time in a sleep state because each button press or timer-based interrupt requires the MCU wake up and attend to the event.

In addition, servicing real-time events adds another layer of challenges to software development. The speed with which the MCU can respond to an event will depend heavily on how many other interrupts are competing for its attention at that moment.

If, for example, the application in question had many other interrupt-driven peripherals to attend to, the count the MCU readings of the counter/timer’s output register might be much higher that it was at the instant of the actual button push.

Likewise, if the MCU took a few milliseconds too long to initiate the A/D conversion the signal it was trying to sample may have changed, or vanished entirely. As a result, great care must be taken to prioritize the peripheral inputs and their service routines so that the highest-priority events are attended to within their critical time window.

The Peripheral Event System eliminates these conflicts with an independent parallel network that allows peripherals to interact without intervention from the microcontroller’s CPU. It is an event-driven system where each event is an indication that a change of state within a peripheral has occurred in response to an internal or an external stimulus.

< Previous
Page 2 of 4
Next >

Loading comments...

Most Commented

  • Currently no items

Parts Search Datasheets.com

KNOWLEDGE CENTER