Home > Store

Real-Time Programming: A Guide to 32-bit Embedded Development

Register your product to gain access to bonus material or receive a coupon.

Real-Time Programming: A Guide to 32-bit Embedded Development

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 1999
  • Dimensions: 7-3/8" x 9-1/4"
  • Pages: 728
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-48540-0
  • ISBN-13: 978-0-201-48540-0

Real-time embedded systems have rigid requirements and must conform to strict size, cost, weight, power, operation, and response-time specifications. They must be crash-proof and must operate under a wide range of conditions. Add to these requirements the ever-increasing competitive pressures to bring products to market faster and at a lower cost, and it is easy to see why building such systems is difficult. Real-time programmers must write software that meets unforgiving objectives under numerous constraints. Teaching you how is the goal of this book.

Real-Time Programming is a comprehensive guide that

  • Covers 32-bit real-time embedded programming topics, including debugging, timers, interrupts, multitasking, serial I/O, TCP/IP networking, and ROMing an application
  • Explores implementing new technologies, such as flash storage and Web-enabled applications
  • Emphasizes a practical, hands-on approach, drawing on code examples from real-world projects constructed during the course of the book
  • Provides complete coverage of the embedded development cycle, from design through implementation
  • Lets developers start building real-time embedded systems immediately using commercial, off-the-shelf hardware and software.

No matter what hardware and software platforms you will ultimately use, this book lays the groundwork and gets you up-to-speed on the unique requirements of real-time embedded programming.



0201485400B04062001

Downloads

CD Contents

Untitled Document This file contains the CD Contents from the book Adapting PCs for Disabilities

Sample Content

Table of Contents

(Each chapter concludes with a Summary.)

Acknowledgments.


Introduction.


1. An Introduction to Embedded Systems.

Real-Time Systems.

Hard Real-Time.

Soft Real-Time.

Real-Time Embedded Systems.

Embedded Processors.

The Advent of PC Embedded Systems.

PC Hardware Components.

The Advantages of the PC Architecture.

Does an Embeddable PC Suit Your Application?



2. Designing and Developing Your Real-Time System.

A Practical Approach.

The Iterative Approach.

The Analysis Phase.

Stating the Problem.

Specifying Project Constraints.

Listing Customer Requirements.

Specifying Hardware and Software.

Verifying Your Analysis.

An Example.

The Design Phase.

Reviewing the Analysis.

Specifying Hardware Components.

Defining Hardware Interfaces.

Specifying Software Subsystems.

Defining Software Interfaces.

Specifying the Start-up and Shutdown Processes.

Specifying Error Handling.

Verifying Your Design.

An Example.

Some Decisions.

Choosing a Processor.

Choosing Hardware Components.

Choosing an Operating System.

Choosing a Programming Language.

Choosing Software Development Tools.

Choosing Hardware Debugging Tools.

Choosing Software Components.

The Implementation Phase.

Planning the Implementation.

Implementing the Design.



3. Chapter 3 Software Installation and Setup.

Choosing a Platform and Tools.

ToolSuite Lite Components.

Embedded StudioExpress.

LinkLoc.

Real-Time ETS Kernel.

What’s Lite About ToolSuite Lite?

ETS Kernel Application Environment.

Segment Selectors.

Null Pointer Detection.

The Stack and the Heap.

The Command Line and the Environment.

Interrupts.

Hardware Setup.

Software Installation and Setup.

Installing ToolSuite Lite.

Configuring Visual C++ and Developer Studio.

Setting Up the Host Environment.

Building a Boot Disk.

Testing the Host-Target Connection.

Programming Projects.

Opening a Workspace.

Running a Program.

Building a Program.

Creating New Programming Projects.



4. Debugging.

Software Debuggers.

Hardware Debuggers.

In-Circuit Emulators.

ROM Emulators.

Software Simulators.

Debugging with ToolSuite.

A Buggy Calculation.

Debugging the Application.

Embedded StudioExpress Extensions.

Target Port Input/Output.

Target System Information.



5. A Point-of-Sale Terminal.

How the POS Project Works.

Designing the Simulation.

Software Subsystems.

Software Interfaces.

Start-up and Shutdown Processes.

Error Handling.

Building the POS Project.

Running the POS Project.

A Quick Tour of the Source.



6. Keyboard and Screen I/O.

Buttons, Keypads, and Keyboards.

LEDs, LCDs, and Displays.

ETS Kernel Support of Keyboard and Screen I/O.

Host Console I/O.

ETS Kernel Keyboard Driver.

ETS Kernel Screen Driver.

Code from the POS Project.

Keyboard Input.

Screen Output.



7. File Systems.

Choosing a File System.

Performance.

Reliability.

Multitasking and Multiuser Capabilities.

Choosing a Storage Device.

RAM Disks.

Flash Disks.

ROM Disks.

Hard Disk Drives.

Floppy Disk Drives.

CD-ROM Drives.

Magnetic Tape.

ETS Kernel File System.

Local File System.

Remote File System.

File I/O in the POS Project.



8. A Simple UPS.

How the UPS Project Works.

Designing the Simulation.

Software Subsystems.

Software Interfaces.

Start-up and Shutdown Processes.

Error Handling.

Building the UPS Project.

Running the UPS Project.

A Quick Tour of the Source.



9. Interrupts.

How Interrupts Work.

Hardware Interrupts.

Software Interrupts.

Exceptions.

ISR Fundamentals.

Using High-Level Languages.

Reentrancy.

Interrupt Latency.

Chaining ISRs.

Multitasking Considerations.

Interrupts on the PC Architecture.

Interrupt Handling Under ETS Kernel.

C Interrupt Handlers.

IDT Interrupt Handlers.

Timer and Keyboard Callbacks.

Interrupts in the UPS Project.

Keyboard Callbacks.

Timer Callbacks.



10. Timers.

Timer Applications.

Selecting Timer Hardware.

Software Considerations.

ETS Kernel Timers.

Timers in the UPS Project.



11. A Smart UPS.

How the Smart UPS Project Works.

Designing the Simulation.

Software Subsystems.

Software Interfaces.

Start-up and Shutdown Processes.

Error Handling.

Building the Smart UPS Project.

Running the Smart UPS Project.

A Quick Tour of the Source.



12. Multitasking.

Processes and Multiprocessing.

Threads and Multithreading.

Processes versus Threads.

Scheduling.

Round-Robin Scheduling.

Task Priorities.

vPriority Inversion.

Deadlock.

Starvation.

Synchronization.

Mutex Objects.

Semaphore Objects.

Event Objects.

Interlocked Variable Access.

Intertask Communication.

Pipes.

Message Queues.

Shared Memory.

Remote Procedure Calls.

Interrupt Handling.

Choosing an RTOS.

Debugging.

Threads in the Smart UPS Project.

Starting a Thread.

Controlling Thread Priority.

Terminating a Thread.

Writing ISRs.

The Smart UPS Code.



13. Serial I/O.

Fundamentals of Serial I/O.

Baud Rate versus Bits Per Second.

Asynchronous versus Synchronous Communications.

Error Detection.

Flow Control.

Electrical Standards and Communication Protocols.

The UART.

Writing Serial Port ISRs.

The RS-232C Serial Standard.

Mechanical Specification.

Electrical Specification.

Functional Specification.

Procedural Specification.

Peripheral Serial Buses.

Chip-to-Chip Serial Buses.

Serial I/O in the Smart UPS.

The 8250/16x50 UART Family.

Initializing the Serial I/O Subsystem.

Cleaning Up.

The Serial I/O Thread.



14. A Network-Aware UPS.

How the Network-Aware UPS Project Works.

Designing the Simulation.

Software Subsystems.

Software Interfaces.

Start-up and Shutdown Processes.

Error Handling.

Building the Network-Aware UPS Project.

Running the Network-Aware UPS Project.

A Quick Tour of the Source.



15. Networking.

Networking Concepts.

What Is a Network?

Internetworks and the Internet.

Network Technologies.

Protocols.

The ISO/OSI Network Design Model.

Repeaters, Bridges, and Routers.

Virtual Communication.

Comparing Connection-Oriented and Connectionless Protocols.

Comparing Reliable and Unreliable Protocols.

The Client/Server Model.

Networking in Embedded Systems.

Selecting the Protocol Stack.

Selecting a Network Technology.

Selecting an Existing Implementation.

Using Standard Application Protocols.

Popular Network Architectures.

Advantages of the TCP/IP Protocol Stack.

The TCP/IP Network Implementation.

Network Interface Layer.

Internet Layer.

Transport Layer.

Application Layer.

Network Programming for ETS Kernel.

WinSock API.

Building the Finger Server Project.

Running the Finger Server Project.

The Finger Server Code.



16. Connecting to the Web.

HTTP In Embedded Applications.

The HTTP Protocol.

Web Browsers.

Web Servers.

URLs and URIs.

HTTP Messages.

Persistent Connections.

Caching.

Secure HTTP.

HTML in Embedded Applications.

Dynamic HTML.

ETS Kernel HTTP Server.

HTML-On-The-Fly in the Network-Aware UPS.



17. Java.

A Language and a Platform.

Platform Alternatives.

Compiler Alternatives.

Advantages for Embedded Development.

Processor Independence.

Object-Oriented Programming.

Security and Secure Operations.

Memory Management.

Garbage Collection.

Networking.

Dynamic Configuration.

Exception Handling.

Threading.

Graphics.

Limitations of Java.

Performance.

Garbage Collection Overhead.

JVM Overhead.

Hardware Access.

Language Immaturity.

The Java-Enabled UPS.

Building the Java-Enabled UPS Project.

Running the Java-Enabled UPS Project.

A Quick Tour of the Source.



18. Floating-Point Programming.

Scientific Notation Terminology.

Floating-Point Support on Embedded Systems.

Floating-Point Data Formats.

Exponent Format.

Mantissa Format.

Number Holes.

Special Numbers.

Floating-Point Hardware and Software.

Hardware.

Software.

Why Use Floating-Point Emulation Software?

A Bitmap Filter.

How the Bitmap Filter Project Works.

Building the Bitmap Filter Project.

Running the Bitmap Filter Project.

A Quick Tour of the Source.



19. Dynamic Link Libraries.

What Is a DLL?

Advantages of Using DLLs.

Memory Requirements.

System Upgrades.

System Configuration and Customization.

Disadvantages of Using DLLs.

Using DLLs with ETS Kernel.

The ENCDEC Project.

Building the ENCDEC Project.

Running the ENCDEC Project.

A Quick Tour of the Source.



20. C++ Exceptions and Structured Exceptions.

Benefits of Exception Handling.

Exception Handling in Embedded Systems.

Robust Code.

Clean Code.

C++ Exception Handling.

Structured Exception Handling.

Structured Exceptions in C.

Structured Exceptions in C++.

A Restartable UPS.

Building the Restartable UPS Project.

Running the Restartable UPS Project.

A Quick Tour of the Source.



21. ROMing an Application.

Using ROM in Embedded Systems.

Types of ROM.

Mask-Programmed and Fusible-Link ROMs.

EPROMs.

EEPROMs.

Flash Memory.

Programming PROMs.

Device Programmers.

Input Files for Device Programmers.

In-Circuit Programmers.

In-the-Field Software Updates.

Debugging Programs in ROM.

PC Boot Methods.

Boot Jump ROM.

BIOS Extension Boot.

ROM-based File System Boot.

ToolSuite Support for ROM.



Appendix A. A Hardware Resource Guide.


Appendix B. APIs.


Appendix C. Configuring Serial Networking Connections for Windows.


Appendix D. Development Methodologies for Real-Time and Embedded Systems.


Index.


0201485400T04062001

Introduction

This is a practical, hands-on guide to building real-time embedded software. You read right. Plenty of books take a high-level, theoretical approach to real-time embedded systems development; other texts take a hardware-specific approach, emphasizing building applications for atypical hardware. Few books, however, focus on developing real-time embedded software.

We understand why authors have gravitated to one of these two extremes. The absence of standard hardware, standard development tools, and a standard operating system virtually demanded that authors pursue either a theoretical or hardware-specific approach.

The world is changing, however. As time to market becomes ever more important, developers of embedded systems are starting to turn more to off-the-shelf boards and components. In particular, the PC architecture, with its high-volume cost advantages, standardized interfaces, and plethora of suppliers, is an attractive choice for systems produced in low to medium quantities.

This shift--that is, the emergence of a standard platform that is also already widely used and understood by developers--enabled us to carve out a middle ground: a book that focuses on software issues surrounding real-time embedded application development. From the beginning, we cover everyday programming topics such as designing, developing, and debugging real-time embedded applications. We show you how to implement interrupts, timers, threads, and more in real-time embedded programs. And we illustrate all topics with code examples. Because you're probably already familiar with the PC architecture, and because it's been exhaustively explored and documented, we don't spend time on hardware details--and neither do you. Both the host and target development platforms are PC-based, so you should have all the hardware you need to get started; you don't have to spend time or money building custom hardware.

At least half the value of using standard hardware is using standard software. This is where Phar Lap Software's ToolSuite Lite comes in. Included on the CD-ROM, ToolSuite Lite is a limited version of Phar Lap's TNT Embedded ToolSuite, Realtime Edition. TNT Embedded ToolSuite supports off-the-shelf compilers and tools, and enables you to build and deploy real-time embedded applications that use the PC architecture.

ToolSuite Lite includes a real-time embedded operating system (ETS Kernel) that supports a subset of Microsoft's Win32 API--the same API used for Windows 95, 98, and NT. (ETS Kernel is not Microsoft Windows. The kernel looks and acts like Windows, but that's as far as the similarity goes. Phar Lap's ETS Kernel is compact, scalable, and optimized for real-time embedded systems.) ToolSuite Lite also includes support for the Microsoft Visual C++ compiler and run-time libraries, Microsoft Developer Studio Integrated Developer Environment (IDE), and the use of the Developer Studio debugger as a cross-debugger for real-time embedded programs.

Note: According to Microsoft Visual C++ 6.0 Programmer's Guide (Microsoft Press, 1998), with the release of Visual C++ 6.0, Microsoft no longer distinguishes between Visual C++ the product and Developer Studio the IDE, and uses Visual C++ to refer to both. For the purposes of our discussion, however, we continue to refer to the IDE in Visual C++ 6.0 as Developer Studio.

We included ToolSuite Lite because the best way to learn how to write programs is to, well, write them. With the software on the CD-ROM, a copy of Microsoft Visual C++, two PC-compatible computers, and a LapLink-compatible cable, you can build, run, and debug all the programming projects in this book.

Is This Book for You?

Does this book target only PC and Win32 developers? Not at all. We had to choose specific hardware and software platforms so that you could actually build and run the real-time embedded programs in this book. But you can apply the principles of embedded systems development described here to the design and development of any embedded product, regardless of which specific processor, real-time operating system, and software tools you use.

You'll find this book worthwhile if you are one of the following:

  • A programmer who is new to or had limited exposure to embedded systems and wants to acquire a good, overall understanding of embedded systems programming.
  • A programmer who is familiar with at least one of the Windows operating systems, has never explored real-time embedded systems programming, and wants to experience it firsthand.
  • A programmer who has worked on non-Intel hardware and wants some hands-on experience with the kind of embeddable PC systems supported by ToolSuite.
  • A programmer with a hardware/software project you've been toying with. You suspect the implementation solution to this project is some sort of embedded system, but you don't know how to go about turning your idea into a reality.
  • A student or a teacher in the engineering or scientific disciplines who anticipates building projects that will require computer control.
  • Someone who is already familiar with ToolSuite and wants an adjunct to the examples given in the ToolSuite documentation.
  • An inquisitive person who wants to explore embedded systems just because you find them interesting.

We have only one prerequisite. You should be conversant in the C programming language so that you can read the source code (most examples are in C) and understand what's going on. A few projects are written partially in C++, and one of the programming projects includes a Java applet. Nevertheless, C is the only requirement. Knowledge of C++, the Win32 API, and Java, however, would provide a headstart.

Embedded Systems: Wave? You Mean Tsunami

The number and types of embedded systems available make it almost impossible to miss the trend toward embedded systems. Your programmable microwave is an embedded system. Your VCR is an embedded system. Your TV remote is an embedded system. And if your TV is programmable, it's embedded, too.

You can expect the embedded systems trend to continue. In the September 1996 issue of Computer Design magazine, Ray Weiss wrote an article titled, "Embedded Advances in Auto, Communications, Office, Industry, and Consumer Markets." Based on information released by Motorola, Weiss wrote that the average 1990 car contained about 14 microprocessors; by the year 2000, that number is expected to reach 35.

Now combine this with another trend that's even more difficult to miss: that wildfire called the Internet. The same Computer Design article mentioned earlier continues:

Home set-top-box and Internet connections via ISDN or higher home-connection technologies like 8-Mbit ADSL (Asymmetric Digital Subscriber Line) have the potential to feed huge communications growth as homes tie into advanced digital services for set-top or cable boxes. And expect these boxes to become integrated into TV sets soon...VMEbus and PC-based systems are expected to play a major role as system bases for these applications.

Set-top boxes, routers, modems--in short, the infrastructure of the Internet--are embedded systems, a fact that further supports the expectation that embedded systems will become increasingly prevalent.

Although the growth of the embedded market is largely due to new uses and applications for embedded systems, it's also been fueled by advancements in microprocessors. Increases in processor speed, bus width, and the number of peripherals that manufacturers can squeeze on a chip have increased the variety of chips available for embedded systems and their suitability to a wider variety of tasks. RISC chips are now common in high-end embedded applications and even in not so high-end applications, if you loo

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020