E-Book, Englisch, 397 Seiten
Qian / Den Haring / Cao Embedded Software Development with C
1. Auflage 2009
ISBN: 978-1-4419-0606-9
Verlag: Springer
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 397 Seiten
ISBN: 978-1-4419-0606-9
Verlag: Springer
Format: PDF
Kopierschutz: 1 - PDF Watermark
Embedded Software Development With C Kai Qian About this textbook:
Intelligible presentation of the fundamentals of embedded systems design and development using the C programming language and the 8051 microcontroller.
Examines the longevity and relevancy of the 8051 microcontroller for designing embedded systems in present applications.
Includes extensive appendices for reference work.
Encourages a hands-on, incremental learning approach with comprehensive tutorial materials provided both in textbook and online.
Embedded Software Development With C offers both an effectual reference for professionals and researchers, and a valuable learning tool for students by laying the groundwork for a solid foundation in the hardware and software aspects of embedded systems development. Key features include a resource for the fundamentals of embedded systems design and development with an emphasis on software, an exploration of the 8051 microcontroller as it pertains to embedded systems, comprehensive tutorial materials for instructors to provide students with labs of varying lengths and levels of difficulty, and supporting website including all sample codes, software tools and links to additional online references.
Autoren/Hrsg.
Weitere Infos & Material
1;Embedded Software Development with C;2
1.1;1 Introduction to Embedded Systems;14
1.1.1;1.1 Overview;14
1.1.2;1.2 Categories of Embedded Systems;15
1.1.3;1.3 Application Areas of Embedded Systems;17
1.1.4;1.4 Characteristics of Embedded systems;17
1.1.5;1.5 Hardware Overview;19
1.1.5.1;1.5.1 Overall Architecture;19
1.1.5.2;1.5.2 Memory;22
1.1.5.3;1.5.3 Bus;24
1.1.5.4;1.5.4 I/O Ports;25
1.1.5.5;1.5.5 Clock Oscillator, Timer and Watchdog;27
1.1.5.6;1.5.6 Analog to Digital Converter (ADC) and DAC;28
1.1.6;1.6 Embedded Software Design and Development;28
1.1.6.1;1.6.1 Software Engineering Life cycle;29
1.1.6.2;1.6.2 Choose RTOS and Programming Language;30
1.1.7;1.7 Practice Labs;32
1.1.7.1;1.7.1 Getting Started with the Keil mVision3 C51 Development Kit;32
1.1.7.2;1.7.2 Lab with 8051 Microcontroller Development Kit;40
1.1.8;1.8 Summary;48
1.1.9;1.9 Review questions;49
1.1.10;1.10 Exercises;50
1.1.11;References;50
1.2;2 Embedded Software Design and Development;51
1.2.1;2.1 Overview;51
1.2.2;2.2 Software Requirement Specification;53
1.2.3;2.3 Embedded Software Modeling Analysis and Design;54
1.2.3.1;2.3.1 Context Diagram;54
1.2.3.2;2.3.2 Finite State Machine (FSM) and State Chart;54
1.2.4;2.4 Time Requirement Analysis for Real-Time Systems;61
1.2.4.1;2.4.1 Non-Preemptive Scheduling;63
1.2.4.2;2.4.2 Pre-emptive Scheduling;64
1.2.4.3;2.4.3 RMS;65
1.2.4.4;2.4.4 Dynamic scheduling with EDF;67
1.2.5;2.5 Multi-Tasking Design Methodology;68
1.2.5.1;2.5.1 Polling;69
1.2.5.2;2.5.2 Interrupts;70
1.2.5.3;2.5.3 RTOS;72
1.2.6;2.6 Software Design Issues;74
1.2.6.1;2.6.1 Task Interactions;74
1.2.6.2;2.6.2 Resource Sharing;75
1.2.7;2.7 Lab Practice: A Traffic Light Control System Modelingand Design;78
1.2.8;2.8 Summary;80
1.2.9;2.9 Review Questions;81
1.2.10;2.10 Exercises;82
1.2.11;References;83
1.3;3 8051 Microcontroller;84
1.3.1;3.1 Overview;84
1.3.1.1;3.1.1 8051 Chip Pins;85
1.3.1.2;3.1.2 System Clock and Oscillator Circuits;86
1.3.1.3;3.1.3 8051 Internal Architecture;87
1.3.2;3.2 Ports;89
1.3.2.1;3.2.1 Port Reading and Writing;89
1.3.2.2;3.2.2 The Port Alternate Functions;90
1.3.3;3.3 Memory and SFR;91
1.3.3.1;3.3.1 Memory;91
1.3.3.2;3.3.2 Special Function Registers (SFRs);93
1.3.4;3.4 SFRs and Interrupts;101
1.3.4.1;3.4.1 External Interrupts;102
1.3.4.2;3.4.2 Timer/Counter Interrupts;103
1.3.4.3;3.4.3 Serial Interrupts;103
1.3.5;3.5 Summary;105
1.3.6;3.6 Review Questions;105
1.3.7;3.7 Exercises;107
1.3.8;References;107
1.4;4 Embedded C Programming with 8051;108
1.4.1;4.1 Overview;108
1.4.2;4.2 Memory in 8051 C Programming;109
1.4.2.1;4.2.1 8051 Memory Types;109
1.4.2.2;4.2.2 Memory Models;110
1.4.3;4.3 Data Types of 8051 C;111
1.4.4;4.4 Functions;115
1.4.4.1;4.4.1 Interrupt Functions;115
1.4.4.2;4.4.2 Reentrant Functions;120
1.4.4.3;4.4.3 Real Time Function;122
1.4.5;4.5 Pointers;122
1.4.6;4.6 Mix C and Assembly Code;123
1.4.7;4.7 Modular Programming in C;124
1.4.7.1;4.7.1 Scope of Functions and Variables;125
1.4.7.2;4.7.2 Header Files;127
1.4.7.3;4.7.3 Multi-module C Programming;127
1.4.8;4.8 Lab: Debug and Test Embedded C Program with the KeilmVision3;131
1.4.9;4.9 Practice Examples;137
1.4.10;4.10 Summary;144
1.4.11;4.11 Review Questions;144
1.4.12;4.12 Programming Exercises;146
1.4.13;References;146
1.5;5 Real-Time Operating Systems;147
1.5.1;5.1 Overview;147
1.5.2;5.2 RTX51-Tiny;150
1.5.3;5.3 Task Scheduling;152
1.5.3.1;5.3.1 Round Robin Multitasking;152
1.5.3.2;5.3.2 Cooperative Multitasking;155
1.5.3.3;5.3.3 Priority-Driven Preemptive Multitasking;157
1.5.4;5.4 RTOS Events;159
1.5.4.1;5.4.1 Signal Event Based Communication;159
1.5.4.2;5.4.2 Message Event Based Communication;159
1.5.4.3;5.4.3 Semaphores;160
1.5.4.4;5.4.4 Attaching Interrupts to Tasks;160
1.5.5;5.5 When to Use RTOS;161
1.5.6;5.6 Practice Labs;161
1.5.7;5.7 Summary;184
1.5.8;5.8 Review Questions;184
1.5.9;5.9 Exercises;186
1.5.10;References;188
1.6;6 Serial Communications;189
1.6.1;6.1 Introduction;189
1.6.1.1;6.1.1 Serial vs. Parallel;190
1.6.1.2;6.1.2 Simplex and Duplex;190
1.6.2;6.2 UARTs and Transceivers;191
1.6.2.1;6.2.1 UART;191
1.6.2.2;6.2.2 Transceivers (aka Line Drivers);192
1.6.2.3;6.2.3 Asynchronous vs. Synchronous;192
1.6.2.4;6.2.4 Data Transfer Rate;193
1.6.3;6.3 Configuring the Serial Port;194
1.6.4;6.4 Setting the Baud Rate;195
1.6.5;6.5 Reading and Writing;197
1.6.6;6.6 Handshaking;198
1.6.6.1;6.6.1 Software Handshaking;198
1.6.6.2;6.6.2 Hardware Handshaking;198
1.6.7;6.7 Examples;200
1.6.7.1;6.7.1 Example 1 – Hello World (Using STDIO);200
1.6.7.2;6.7.2 Example 2 – Hello World (Beyond the Serial Port);202
1.6.7.3;6.7.3 Example 3 – Interactive Console Using the Serial Port;206
1.6.8;6.8 Summary;210
1.6.9;6.9 Review Questions;211
1.6.9.1;6.9.1 Key to the Review Questions:;211
1.6.10;6.10 Exercises;212
1.7;7 Survey of Popular Microcontrollers;213
1.7.1;7.1 Introduction;213
1.7.2;7.2 Features for Comparison;214
1.7.2.1;7.2.1 Packages;215
1.7.3;7.3 The Large 8051 Family;216
1.7.3.1;7.3.1 8051 Development Tools;216
1.7.3.2;7.3.2 Silicon Laboratories Family;217
1.7.3.3;7.3.3 Atmel Family;217
1.7.3.4;7.3.4 Maxim (i.e. Dallas) Family;217
1.7.4;7.4 PIC Microcontrollers;219
1.7.4.1;7.4.1 PIC Development Tools;220
1.7.5;7.5 Rabbit Microprocessors;221
1.7.5.1;7.5.1 Rabbit Development Tools;222
1.7.6;7.6 Atmel AVR Microcontrollers;223
1.7.6.1;7.6.1 AVR 8-bit MCU;223
1.7.6.2;7.6.2 AVR 8-bit Development Tools;225
1.7.6.3;7.6.3 AVR 32-bit MCU;225
1.7.6.4;7.6.4 AVR 32-bit Development Tools;226
1.7.7;7.7 ARM Microprocessors;227
1.7.8;7.8 ColdFire Microprocessors (and Microcontrollers);227
1.7.8.1;7.8.1 ColdFire Development Tools;228
1.7.9;7.9 Basic St229
1.7.9.1;7.9.1 Basic Stamp Development Tools;230
1.7.10;7.10 Review Questions;231
1.7.11;7.11 Exercises;231
1.8;8 Ethernet Applications and the Future of the Microcontroller;232
1.8.1;8.1 Objectives;232
1.8.2;8.2 Introduction;232
1.8.3;8.3 Introduction to TCP/IP;233
1.8.3.1;8.3.1 Link Layer;234
1.8.3.2;8.3.2 Internet Layer;234
1.8.3.3;8.3.3 Transport Layer;235
1.8.3.4;8.3.4 Application Layer;235
1.8.4;8.4 Circuit Cellar"672-.4 Project;236
1.8.4.1;8.4.1 The Role of the Ethernet Controller;236
1.8.4.2;8.4.2 The Role of the 8051;237
1.8.4.3;8.4.3 Code Organization;238
1.8.5;8.5 Silicon Labs Ethernet Development Kit;239
1.8.5.1;8.5.1 Stage 1: Setup the Hardware;240
1.8.5.2;8.5.2 Stage 2: Setup the Software and Checkout the Hardware;240
1.8.5.3;8.5.3 Stage 3: Creating an Embedded Ethernet Application using the Wizard;243
1.8.5.4;8.5.4 Stage 4: The uWeb Embedded Web Server;254
1.8.6;8.6 The Future of the Microcontroller;255
1.8.6.1;8.6.1 Dominant Market Share;256
1.8.6.2;8.6.2 Networking, Networking, Networking;257
1.8.6.3;8.6.3 New Applications and Role Blurring;257
1.8.6.4;8.6.4 Better and Cheaper Development Tools;257
1.8.6.5;8.6.5 Roll your Own Chips;257
1.8.7;8.7 Review Questions;258
1.8.7.1;8.7.1 Key to the review questions:;258
1.8.8;8.8 Exercises;259
1.8.8.1;8.8.1 Note: The ETHERNETDK kit is needed for these exercises.;259
1.9;9 Hands-On Labs;260
1.9.1;9.1 Lab 1: Getting Started with The 8051 – Reading and Writing Ports;261
1.9.2;9.2 Lab 2: Intro to the 7-segment LED (Direct Driven and Decoded);267
1.9.3;9.3 Lab 3: Intro to A/D Conversion Using a Light Sensor;275
1.9.4;9.4 Lab 4: Intro to the Keypad;285
1.9.5;9.5 Lab 5: Intro to D/A Conversion Using a Speaker;293
1.9.6;9.6 Lab 6: 3-Wire RS232 Serial Communication;304
1.9.7;9.7 Lab 7: Intro to the LCD Display;312
1.9.8;9.8 Lab 8: Advanced RS232 Communications (Handshaking);323
1.10;A C programming Primer;335
1.10.1;A.1 Overview;335
1.10.2;A.2 Data Types in C;336
1.10.2.1;A.2.1 Primitive Data Types;336
1.10.2.2;A.2.2 Enumerated Type;337
1.10.2.3;A.2.3 Pointer Type;338
1.10.2.4;A.2.4 Arrays;338
1.10.2.5;A.2.5 Char and Strings;340
1.10.2.6;A.2.6 Structures and Unions;341
1.10.2.7;A.2.7 User Defined Type with typedef;342
1.10.2.8;A.2.8 Variable Scope Specifiers;343
1.10.3;A.3 Operators;343
1.10.3.1;A.3.1 Arithmetic and Shift Operators;343
1.10.3.2;A.3.2 Bitwise Operators;344
1.10.3.3;A.3.3 Relational Operators;344
1.10.3.4;A.3.4 Logical Operators;345
1.10.4;A.4 Functions;345
1.10.4.1;A.4.1 Function Definition;345
1.10.4.2;A.4.2 Function Parameters;347
1.10.5;A.5 Control Structures;348
1.10.5.1;A.5.1 Selection Statements;349
1.10.5.2;A.5.2 Loop Statements;351
1.10.5.3;A.5.3 break and continue Statement in a Loop;355
1.10.5.4;A.5.4 goto Statements;356
1.10.6;A.6 Reserved Keywords;356
1.10.7;A.7 Command-line Arguments;357
1.11;B Getting Started with The Keil mVision IDE;358
1.11.1;B.1 Introduction to the Keil mVision IDE;358
1.11.2;B.2 Run a Keil mVision IDE Project;358
1.11.3;B.3 Build your First Keil Project;361
1.12;C Getting Started with Silicon Laboratories C8051F005DK Development;370
1.13;D Counter with 7-Segment Numeric Display;380
1.13.1;D.1 Overview;380
1.13.2;D.2 Equipment;381
1.13.3;D.3 Schematic;382
1.13.4;D.4 Building the Circuit;382
1.13.5;D.5 Code;383
1.13.6;References;387
1.14;Index;390




