Patterns for Time-Triggered Embedded Systems: Building Reliable Applications with the 8051 Family of Microcontrollers (with CD-ROM)
Brand: Brand: Addison-Wesley Professional
Categories: Books, Computers & Technology, Hardware & DIY

Book by Pont, Michael

Used Book in Good Condition

Dimensions: 7.5 x 2 x 9.25 inches
Language: English
ISBN-10: 0201331381
Publisher: Addison-Wesley
Print length: 1024 pages
Publication date: July 12, 2001
ISBN-13: 978-0201331387
Edition: 1st
subtitle: 1st Edition
author: Visit Amazon's Michael J. Pont Page search results Michael J. Pont
review: Editorial Reviews From the Back Cover 'These patterns stand as an example of how much more can be done with patterns than is commonly attempted. Patterns at their best bridge the gap between problem and solution. They connect human needs and emotions with technology. And they open up new possibilities for people who just have a problem to solve.' --from the Foreword by Kent Beck This book provides the first comprehensive set of software patterns to support the development of embedded software systems. With a focus on reliability, it discusses techniques for the design and implementation of software for embedded applications based on the popular 8051 microcontroller family. You will find more than seventy software patterns, complete with guidelines to help you apply these techniques in your own projects. The author offers practical materials and advice advice for rapidly creating a wide range of different embedded applications. Using a substantial number of detailed examples, ranging from simple to complex systems, this book covers: * the design & implementation of complete scheduler operating systems for embedded applications involving one or more microcontrollers * creation of user interfaces with components including switches, keypads, LED displays and LCDs * effective use of networking and communication protocols * design of monitoring and control systems using, for example, PID algorithms and PWM Features: * extensive examples which illustrate how the patterns described may be applied in real-world projects * an associated WWW site (engg.le.ac.uk/books/Pont) with a collection of detailed case studies * accompanying CD-ROM containing: * full source code in C for all patterns & examples, including a number of complete schedulers * an evaluation version of industry-standard Keil C compiler & hardware simulator, allowing examples to be tested without the need to purchase additional hardware 0201331381B07032001 About the Author Michael J. Pont is a Senior Lecturer in Electronic & Software Engineering at the University of Leicester. Over the last ten years he has carried out research in various aspects of software design and programming, and has provided consultancy and training services to a range of international companies. Michael is the author or co-author of more than seventy technical publications, including the book 'Software Engineering with C++ and CASE tools'. 0201331381AB07032001 Excerpt. © Reprinted by permission. All rights reserved. Embedded software is ubiquitous. It forms a core component of an enormous range of systems, from aircraft, passenger cars and medical equipment, to children's toys, video recorders and microwave ovens. This book provides a complete and coherent set of software patterns to support the development of this type of application. The remainder of this preface attempts to provide answers to more detailed questions which prospective readers may have about the contents. I What are the key features of this book? The focus is on the rapid development of software for time-triggered, embedded systems, using software patterns. The meaning of 'time triggered' is explained in Chapter 1; software patterns are introduced in Chapter 2. The systems are all based on microcontrollers, from the widely used 8051 family. This vast family of 8-bit devices is manufactured by a number of companies, including Philips, Infineon, Atmel, Dallas, Texas Instruments and Intel. The range of different 8051 microcontrollers available is reviewed in Chapter 3. Time-triggered techniques are the usual choice in safety-related applications, where reliability is a crucial design requirement. However, the need for reliability is not restricted to systems such as drive-by-wire passenger cars, aerospace systems or monitoring systems for industrial robots: even at the lowest level, an alarm clock that fails to sound on time or a video recorder that operates intermittently may not have safety implications but, equally, will not have high sales figures. The patterns presented here allow time-triggered techniques to be simply and cost-effectively applied in virtually any embedded project. The applications discussed in detail must carry out tasks or respond to events over time intervals measured in milliseconds. This level of response can be economically and reliably achieved, even with an 8-bit microcontroller, using the approaches discussed in this book. The software is implemented entirely in 'C'. All of the examples in the book appear, in full, on the enclosed CD. The book is supported by a WWW site which includes, among other features, a wide range of detailed case studies, additional technical information and links to sources of further information (http://www.engg.le.ac.uk/books/Pont). II How do you build time-triggered embedded systems? The time-triggered systems in this book are created using schedulers. Briefly, a scheduler is a very simple 'operating system' suitable for use in embedded applications (see Chapter 13 for a detailed introduction to this topic). A range of complete scheduler architectures for applications involving a single microcontroller is described and illustrated (Chapters 14 to 17). Complete source code for a number of different schedulers is included on the CD. Like an increasing number of applications, many of the systems presented here involve the use of more than one microcontroller: a range of shared-clock scheduler architectures that can support this type of application is described (Chapters 25 to 29). Many of these systems make use of popular serial standards, including the CAN bus and RS-485. A selection of more specialized scheduler architectures is also presented (in Part H). This includes a 'stable' scheduler that can provide very precise timing over long periods, a scheduler optimized to run a single task and general-purpose schedulers designed for low-power and/or low-memory applications (see Chapters 36 and 37). III What other topics are discussed in the book? All embedded systems involve some hardware design and suitable hardware foundations are presented. These include designs for oscillator and reset circuits and techniques for connecting external ROM and RAM memory (see Chapters 4, 5 and 6). These also include interface circuits suitable for use with low- and high-voltage DC and AC loads (see Chapters 7 and 8). Suitable software foundations are also presented, including a simple architecture for embedded applications (Chapter 9), techniques for controlling port pins (Chapter 10), techniques for generating delays (Chapter 11) and techniques for using watchdog timers (Chapter 12). A key part of the user interface of some embedded applications is an RS-232 link to a desktop or notebook PC, while many other embedded systems have a user interface created using an LCD or LED display along with a small collection of switches and/or a keypad. Techniques for working with these different interface components are presented in Chapters 18 to 22. Many modern different peripheral devices (LCDs, LED displays, EEPROMs, A-D and D-A devices and so on) now have a serial interface, with the result that these devices can be connected to a microcontroller without consuming large numbers of port pins. Complete software libraries for the two main serial communication protocols (I2C and SPI) are presented in Chapters 23 and 24. Techniques suitable for use in condition monitoring and control applications are presented in Part G. This includes a discussion of 'PID control'. Again, detailed code libraries are provided (Chapter 30 to Chapter 35). IV Who should read this book? I had three main groups of people in mind as I wrote this book: Software engineers with previous experience of desktop systems now beginning to work with embedded systems. Hardware engineers who wish to understand more about the software issues involved in the development of embedded systems. University and college students on 'electronic and software engineering', 'software engineering', 'computer science', 'electronic engineering' or similar programmes who are taking advanced modules in embedded systems. It must be emphasized that this book is not intended for those requiring an introduction to programming and it is expected that readers will have previously developed 'desktop' software applications, using C, C++ or a similar high-level language. Readers with less experience in this area may find it useful to have a copy of an introductory book on 'C', such as Herbert Schildt's Teach Yourself C (Schildt, 1997)1 by their side as they read this book. Similarly, some familiarity with the principles of software design is assumed. Here, some experience with 'object-oriented' design, and 'process-oriented' design ('structured analysis') will be useful. Readers with less experience in this area may find it useful to have a copy of my previous introductory book on software design (Pont, 1996) by their side. Finally, some very basic electronics knowledge is also useful. Readers without hardware design experience may find it useful to have available a copy of The Art of Electronics (Horowitz and Hill, 1989). V What type of microcontroller hardware is used? The market for microcontrollers is vast. Most current estimates suggest that, for every processor sold for a desktop PC, 100 microcontrollers are sold for embedded systems. As the sub-title suggests, this book focuses on the 8051 family of microcontrollers, which was originally developed by Intel, but is now produced, in more than 300 different forms, by a wide range of companies, including Philips, Infineon, Atmel and Dallas. The use of the 8051 family is no accident. Together, sales of this vast family are estimated to account for more than 50% of the 8-bit microcontroller market and to have the largest share (around 30%) of the microcontroller market as a whole. Note that in this book I consider not only recent versions of the 'standard' 8051 (4 ports, 40/44 pins: e.g. the Atmel 89C52; Dallas 89C420; Infineon C501; Philips 89CRD2), but the full range of modern devices, including the 'small' 8051s (two ports, 20/24 pins: e.g. the Atmel 89C4051; Philips 87LPC764) and the 'extended' 8051s (up to ten ports, ~100 pins, CAN, ADC, etc. on chip: e.g. Infineon C509; Infineon C515c; Dallas 80c390). VI What's on the CD? The CD includes complete source code files for all the software patterns: as mentioned above, all of this code is in the 'C' programming language. The source code for these patterns is fully compatible with the industry-standard Keil C compiler. An evaluation version of this compiler, and a complete hardware simulator, is also included on the CD: this allows the majority of the patterns to be explored on a desktop PC without the need to purchase or construct any hardware at all. Finally, data sheets (in PDF format) for a large number of 8051 microcontroller are also included on the CD. VII What about the WWW site? There is a WWW site associated with this book, at the following URL: http://www.engg.le.ac.uk/books/Pont On this site you will find: A set of detailed case studies describing the application of the techniques discussed in this book in a series of small and large projects. Bug reports and code updates (please see section X, which follows). Further code samples. Links to other relevant sites. VIII Is the code 'free ware'? The code included in this book took many years to produce. It is not 'free ware' and is subject to some simple copyright restrictions. These are as follows: Having purchased a copy of this book, you are entitled to use the code listed in this book and included on the CD in your projects, should you choose to do so. If you use the code in this way, then no run-time royalties are due. However, I would appreciate it if you acknowledged the source of the code in the product documentation. If there are ten developers in your team using code adapted from this book, please purchase ten copies of the book. You may not, under any circumstances, publish any of the source code included in the book or on the CD, in any form or by any means, without explicit written authorization from me. If you wish to publish limited code fragments then, in most circumstances, I will grant this permission, subject only to an appropriate acknowledgement accompanying the published material. If you wish to publish more substantial code listings, then payment of a fee may be required. Please contact me for further details. IX How should this book be read? While writing this book, I had two types of reader in mind: those who like to read a book from cover to cover and those who prefer to treat a book like this as a reference source, to be first skim read and then opened, as needed, during the course of a project. To match the needs of the cover-to-cover readers, the material follows in a logical order, from the introductory and foundation material, through to more advanced material. To make it easy to read in this way, I have tried to ensure that the delivery of information is as sequential as possible: that is, that the material needed to understand (say) Chapter 14 is presented in Chapters 1 to 13. For use as a work of reference, I suggest that readers first read (or at least skim) the introductory chapters (1 and 2, plus 3, 9, 13 and 25): together, these chapters will provide a good overview of the material presented elsewhere in the book. X What about bug reports and code updates? There is huge amount of code involved in this project, both in the book itself and on the associated CD. I have personally tested all of the code that appears here. Nonetheless, errors can creep in. If you think you have found a bug, please first check the WWW site (see earlier section VII), to see if anyone else has picked up the error: if they have, a code correction will have been made available. If you have found a bug not listed on the WWW site, please send me an e-mail (the address is at the end of this preface) and I will do my best to help. I will be also be pleased to mention anyone who spots a bug in subsequent editions. XI What about other reader comments? I began my first 8051 project in 1986 and I have tried to write the book that I needed at this time. Only you can tell me if I have succeeded. I would appreciate your comments and feedback. For example, should the book be longer? Shorter? What other areas should I cover? What should I miss out? Would you like to see a future edition focusing on a different family of microcontrollers? If so, which one? To ensure that any future editions continue to provide the information you need, I would be delighted to hear of your experiences (good or bad) using the book. I can be contacted either by post (via the publishers, please), or much more efficiently by e-mail at the address given at the end of this Preface. I'll do my best to respond personally and promptly to every communication. XII Credit where credit is due The material presented here has evolved substantially in the three years since I began work on this project. The creation and subsequent development of this material would not have been possible without the help and support of a great many people. In particular, I would like to thank: Kent Beck (Three Rivers Institute) for providing the Foreword and introducing me to Ray. The Engineering and Physical Sciences Research Council (EPSRC) and the (then) Science and Engineering Research Council (SERC), which have funded most of my research in this area. Staff at a range of UK and European organizations who have employed me as a consultant and / or attended my training courses in software development over the last decade and from whom I - in turn - have learned an enormous amount about embedded systems, software design and programming. Various people associated with the EuroPlop (1999) conference: Fiona Kinnear (then at Addison-Wesley) for suggesting that I should attend. My 'shepherd', Ward Cunningham, for making me revise my submission to take into account more of the ideas and philosophy of this book: as Ward predicted, the revised version provoked much useful debate. All the people who took the time to comment on my draft patterns: of these people, Kent Beck deserves a particular mention as he provided numerous constructive comments and general support. The members of the Midlands Patterns Group for numerous helpful suggestions and ideas. Various people who have acted as reviewers during the evolution of this text: Michael Jackson (University of Wolverhampton) for invaluable comments on my early ideas for the first version of this book. Chris Hills (Keil Software), Niall Murphy (PanelSoft) and David Ward (The Motor Industry Research Association), who provided many useful comments on the first complete draft of this book. Mark Banner (University of Leicester) for providing useful comments on several of the final draft chapters. Various people at the University of Leicester: Members of the 'Frankenstein' group for inviting me to give my first talk on patterns and, through their enthusiasm and feedback, first convincing me that the ideas presented here had some validity. Royan Ong, who has taught me a great deal about hardware design over the last two years. Dave Dryden and Andy Willby for feedback on my hardware designs. Andrew Norman, for creating the first version of the SPI library in Chapter 24 and - more generally - for finding numerous 'features' in my designs and code since 1992. James Andrew, Adrian Banks, Mark Banner, Mathew Hubbard, Andrei Lesiapeto, Hitesh Mistry, Alastair Moir, Royan Ong, Chinmay Parikh, Keiron Skillett, Robert Smith, Thomas Sorrel, and Neil Whitworth, for destructive testing of many of the code examples. The people who 'saved my life' when my computer went up in smoke in March 2000, when the first draft of this book was (over)due at the publishers, in particular Andy Willby and Jason Palmer. Other members of staff for help and advice during the course of this project, including Declan Bates, Dave Dryden, Chris Edwards, Ian Jarvis, Fernando Schlindwein and Maureen Strange. Ian Postlethwaite, for allowing me time to complete this large project. Bob Damper (University of Southampton) who introduced me to the challenges of speech recognition using the 8051 family in the mid-1980s. People at Keil Software: Reinhard Keil, for his support and for providing an updated CD at the last minute. Chris Hills, for much useful advice. The members of various e-mail pattern and microcontroller lists for numerous helpful comments and suggestions. Various people at Addison-Wesley Longman and Pearson Education: Sally Mortimore (then of AWL) for letting me constantly change my mind about the contents of this book. Alison Birtwell for stepping courageously into Sally's shoes when Sally could take it no longer. Katherin Ekstrom for answering all my e-mails. Penelope Allport, for smooth management of the final production process. Helen Baxter, for careful copy editing. George Moore, for proof reading the final, vast, document. Isobel McLean, for the index. Everyone at Pantek, for the typesetting. Gordon Pont and Andrew Pont for proof reading. Last, but not least: Sarah, for supporting me throughout the last three years. Fiona, Mark, Siobhan and Clare, for teaching me how to fly kites. Anna, Nick and Ella, for numerous Friday nights. Lisa and Mike, for Tuscany. Cass and Kynall Washington, for always being there. Radiohead, for keeping me sane. Michael J. Pont Great Dalby, May 2001 M.Pont@leicester.ac.uk 0201331381P07032001 Read more