Chapter 9

Interrupts, Timers, and Tasks

Abstract

This chapter explores aspects of timeliness in embedded systems and how they are addressed in the ARM mbed. The interrupt mechanism applied in the mbed is explored, and simple interrupt-driven programs developed. Further aspects of interrupts are considered, including latency, and the use of more than one interrupt sources. The concept of the digital counter is reviewed, notably in its application as a timer. The mbed timers are applied, first in simple form, and then to implement timeout and periodic interrupts. C coding techniques are developed further, including the generation of pseudorandom numbers. Practical applications include the implementation of an mbed-based metronome, and the use of accelerometer-generated ...

Get Fast and Effective Embedded Systems Design, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.