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
[1]
Barry Rubel,et al.
Patterns for generating a layered architecture
,
1995
.
[2]
Dennis M. Ritchie,et al.
A stream input-output system
,
1990
.
[3]
R. E. Johnson,et al.
The Conduit: A Communication Abstraction in C++
,
1990,
C++ Conference.
[4]
Douglas C. Schmidt,et al.
A Family of Design Patterns for Applications-Level Gateways
,
1996,
Theory Pract. Object Syst..
[5]
Lui Sha,et al.
Priority Inheritance Protocols: An Approach to Real-Time Synchronization
,
1990,
IEEE Trans. Computers.
[6]
Armando P. Stettner.
The design and implementation of the 4.3BSD UNIX operating system
,
1988
.
[7]
Peter Sommerlad,et al.
Pattern-Oriented Software Architecture Volume 1: A System of Patterns
,
1996
.
[8]
Mark Grand.
Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with UML
,
2002
.
[9]
G. E. Reeves,et al.
What Really Happened on Mars
,
1998
.
[10]
Roy H. Campbell,et al.
Designing and implementing Choices: an object-oriented system in C++
,
1993,
CACM.
[11]
Sachin Bammi,et al.
Patterns for Designing a Generic Device Driver for Interrupt Driven I/O
,
2006
.
[12]
Douglas C. Schmidt,et al.
Patterns for concurrent and networked objects
,
2000
.
[13]
Guillermo A. Francia.
Embedded systems programming
,
2001
.
[14]
Ralph Johnson,et al.
design patterns elements of reusable object oriented software
,
2019
.
[15]
Dirk Riehle,et al.
Pattern Languages of Program Design 3
,
1997
.