This book provides a ‘hardware-free' introduction to
embedded software for people who:
- Already know how to write software for ‘desktop'
computer systems.
- Are familiar with a C-based language (Java, C++ or
C).
- Want to learn how C is used in practical embedded
systems.
The remainder of this preface attempts to answer some
questions which prospective readers may have about the
contents.
Contents
Preface.
1. Programming Embedded Systems in C.
Introduction. What is an
Embedded System? Which Processor Should You Use? Which
Programming Language Should You Use? Which Operating System
Should You Use? How Do You Develop Embedded Software?
2. Introducing the 8051 Microcontroller Family.
Introduction. What's in a
Name? The External Interface of the Standard 8051. Reset
Requirements. Clock Frequency and Performance. Memory
Issues. I/O Pins. Timers. Interrupts. Serial Interface.
Power Consumption.
3. Hello, Embedded World. Introduction. Installing
the Keil Software and Loading the Project. Configuring the
Simulator. Building the Target. Running the Simulation.
Dissecting the Program. Aside: Building the Hardware.
4. Reading Switches. Introduction. Basic
Techniques for Reading from Port Pins. Example: Reading and
Writing Bytes. Example: Reading and Writing Bits (simple
version). Example: Reading and Writing Bits (generic
version). The Need for Pull-up Resistors. Dealing with
Switch Bounce. Example: Reading Switch Inputs (basic code).
Example: Counting Goats.
5. Adding Structure to Your Code. Introduction.
Object-oriented Programming with C. The Project Header
(main.h) The Port Header (port.h). Example: Restructuring
the 'Hello Embedded World' Example. Example: Restructuring
the Goat-counting Example. Further Examples.
6. Meeting Real-time Constraints. Introduction. Creating
'Hardware Delays' Using Timer 0 and Timer 1. Example:
Generating a Precise 50 ms Delay. Example: Creating a
Portable Hardware Delay. Why Not Use Timer 2? The Need for
'Timeout' Mechanisms. Creating Loop Timeouts. Example:
Testing Loop Timeouts. Example: A More Reliable Switch
Interface. Creating Hardware Timeouts. Example: Testing a
Hardware Timeout.
7. Creating an Embedded Operating System. Introduction. The Basis of
a Simple Embedded OS. Introducing sEOS. Using Timer 0 or
Timer 1. Is This Approach Portable? Alternative System
Architectures. Important Design Considerations When Using
sEOS. Example: Milk Pasteurization.
8. Multi-state Systems and Function Sequences.
Introduction. Implementing
a Multi-State (Timed) System. Example: Traffic Light
Sequencing. Example: Animatronic Dinosaur. Implementing a
Multi-State (Input/Timed) System. Example: Controller for a
Washing Machine.
9. Using the Serial Interface. Introduction. What is
RS-232? Does RS-232 Still Matter? The Basic RS-232
Protocol. Asynchronous Data Transmission and Baud Rates.
Flow Control. The Software Architecture. Using the on-chip
UART for RS-232 Communications. Memory Requirements.
Example: Displaying Elapsed Time on a PC. The Serial-Menu
Architecture. Example: Data Acquisition. Example:
Remote-control Robot.
10. Case Study: Intruder Alarm System. Introduction. The Software
Architecture. Key Software Components Used in This Example.
Running the Program. The Software.
11. Where Do We Go from Here. Introduction. Have We
Achieved Our Aims? Suggestions for Further Study. Patterns
for Time-Triggered Embedded Systems. Embedded Operating
Systems.
Index.