A generic real time data acquisition pattern language for embedded applications involving interrupt driven I/O

This paper presents six design patterns on designing and developing generic real time embedded applications, which involve interrupt driven I/O. The pattern language includes patterns for real time data acquisition and developing device drivers for analog to digital converters and serial communication. These patterns balance the opposing forces of data encapsulation, system efficiency and managing change in software due to change in business and technical requirements over the course of a project. They provide general guidelines for developing embedded applications on custom hardware. A generic real time embedded data acquisition pattern language for interrupt driven I/O Copyright  2007 by Schlumberger Technology Corporation. All rights reserved. Page 2 of C2 1.0 Introduction The patterns presented in this paper aim at providing general architecture specific guidelines for developing real time embedded data acquisition systems involving interrupt driven I/O on proprietary hardware. The patterns are elements of a pattern language being developed by the author for developing real time applications, which drive drilling electronics in harsh environmental conditions while taking several measurements at the same time. While the pattern language that develops due to this effort will be rather specific in nature, it is the author’s belief that these individual patterns would have a more general appeal. The following figure presents the most current vision of the author for the aforementioned pattern language henceforth called “Real Time Data Acquisition (RTDA) firmware pattern language”. 2.0 Intended Audience and Scope The intended audience of this paper is beginning to intermediate level embedded software engineers developing custom real time applications for interrupt driven I/O based embedded systems on proprietary hardware using either homegrown or commercially available real time operating systems (RTOS). The author expects many senior or advanced level embedded software engineers to be familiar with most if not all of the concepts discussed in this paper. The technical scope of this work is limited to general design issues related to system development for proprietary embedded applications that are responsible for data acquisition, data processing, data transmission and data logging in real time. The patterns presented here are by themselves not enough for a good design since a good design requires deep knowledge of the device under consideration and the specific hardware and RTOS on which the device driver will run. What this paper tries to provide are some generic characteristics of a good design, which the author believes are independent of more specific hardware and RTOS issues. Some of the patterns in RTDA firmware patterns language provide the most benefit when they are applied together. This is because some provide a more specific refinement to the others in the language but still have enough intrinsic merit in author’s judgment to stand on their own as a pattern. For example the “Multi-Tiered Device Driver” and the “Friendship Zone” patterns can be applied together along with the “synchronous Managed Access” pattern to write a serial communication driver. Similarly the “Producer/Consumer” pattern can be applied with “MultiTiered Device Driver” pattern to define the overall architecture of the real time application. Figure 1 presents these patterns in a mosaic fashion to show how they fit with each other in the big picture. The following sections discuss the individual patterns in more detail and the reader of this paper may be well served by referring back to this diagram after reading each of the patterns. A generic real time embedded data acquisition pattern language for interrupt driven I/O Copyright  2007 by Schlumberger Technology Corporation. All rights reserved. Page 3 of C2 Figure 1: Pattern Mosaic for Architecture of a Real time data acquisition embedded application