| |
| |
Preface | |
| |
| |
| |
Computer Fundamentals | |
| |
| |
| |
Numbers and Number Systems | |
| |
| |
Octal, Hexadecimal, and Binary Numbers | |
| |
| |
Two's Complement Signed Numbers | |
| |
| |
Binary-coded Decimal Numbers | |
| |
| |
| |
Digital System Fundamentals | |
| |
| |
Signals, Functions, and Hardware | |
| |
| |
Combinational Logic Networks | |
| |
| |
Flip Flops and Registers | |
| |
| |
Memory | |
| |
| |
Synchronous Sequential Networks | |
| |
| |
| |
Digital Systems | |
| |
| |
Synchronous Serial Communications Example | |
| |
| |
Instruction-controlled Information Processor Example | |
| |
| |
| |
Stored Program Processors | |
| |
| |
Block Diagram | |
| |
| |
Instruction Operation | |
| |
| |
Definition of the Instruction Set | |
| |
| |
General-purpose Computer | |
| |
| |
| |
Microprocessors and Microcomputers | |
| |
| |
Integrated Circuit Technology | |
| |
| |
The Microprocessor and Microcomputer | |
| |
| |
Microcomputer Applications | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Instruction Subset and Machine Language | |
| |
| |
| |
The 68HC11 Computer Operation | |
| |
| |
The Programming Model | |
| |
| |
Internal Computer Operations | |
| |
| |
| |
Instructions and Addressing Modes | |
| |
| |
Extended Addressing | |
| |
| |
Direct Addressing | |
| |
| |
Inherent Addressing | |
| |
| |
Double-byte Data | |
| |
| |
Immediate Addressing | |
| |
| |
Indexed Addressing | |
| |
| |
Relative Addressing | |
| |
| |
| |
Addressing Mode Summary | |
| |
| |
| |
An Expanded Repertoire | |
| |
| |
The Instruction Set Table | |
| |
| |
A Tour through the Basic Instructions | |
| |
| |
The Comparison Branch Instructions | |
| |
| |
Applications of Complex Instructions | |
| |
| |
Double-precision Instructions | |
| |
| |
| |
Machine Language Programming Example | |
| |
| |
Minimum Requirements of a Good Program | |
| |
| |
A Classic Example: Copy a Table | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Assemblers and Assembly Language | |
| |
| |
| |
The Assembly Process | |
| |
| |
The Editor, Assembler, and Loader Programs | |
| |
| |
The Source Module, Load Module, and Listing | |
| |
| |
| |
The Motorola Assembly Language | |
| |
| |
Source Statement Content | |
| |
| |
Source Statement Format | |
| |
| |
The Basic Assembler Directives | |
| |
| |
| |
Examples from the Assembler | |
| |
| |
Some Good Assembly Language | |
| |
| |
Some Bad Assembly Language | |
| |
| |
Assembly Language to Copy a Table | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Program Structure and Design | |
| |
| |
| |
The Hard Cold Facts | |
| |
| |
What Does Software Cost? | |
| |
| |
What about Software Quality? | |
| |
| |
Programming Is Hard Work | |
| |
| |
Starting on the Right Path | |
| |
| |
| |
Program Design-What's Important | |
| |
| |
Programmers' Goals | |
| |
| |
What We Are Working With | |
| |
| |
Assessing the Goals Based on Reality | |
| |
| |
| |
Practical Programming | |
| |
| |
| |
Flowcharting | |
| |
| |
Flowchart Symbols | |
| |
| |
Flowchart Example | |
| |
| |
| |
Structured Programming | |
| |
| |
Fundamental Program Structures | |
| |
| |
Extended Program Structures | |
| |
| |
Identifying Structured and Unstructured Programs | |
| |
| |
Making Structured Loops | |
| |
| |
A Troublesome Case | |
| |
| |
Will You Use It? | |
| |
| |
Making Unstructured Programs Structured | |
| |
| |
| |
Top/Down Design | |
| |
| |
Choosing Program Modules | |
| |
| |
Top/Down Design Using Flowcharts | |
| |
| |
Top/Down Design Summary | |
| |
| |
| |
Structured Top/Down Assembly Language | |
| |
| |
A Good Program | |
| |
| |
A Bad Program | |
| |
| |
| |
Large-Scale Top/Down Design | |
| |
| |
The Top/Down Team | |
| |
| |
Top/Down Implementation | |
| |
| |
| |
Small-Scale Top/Down Design | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Advanced Assembly Language Programming | |
| |
| |
| |
More Indexing | |
| |
| |
Consequences of a Large Instruction Set | |
| |
| |
Op Code Maps | |
| |
| |
Index Register Exchange Instructions | |
| |
| |
Another Instruction for D | |
| |
| |
| |
Bit and Byte Manipulation | |
| |
| |
Shift Operations | |
| |
| |
Logical Operations | |
| |
| |
| |
Arithmetic Operations | |
| |
| |
Multiplication | |
| |
| |
Division | |
| |
| |
BCD Operations | |
| |
| |
| |
The Stack | |
| |
| |
Stack Operation | |
| |
| |
Stack Hardware | |
| |
| |
Stack Instructions | |
| |
| |
Stack Example | |
| |
| |
Using the Stack | |
| |
| |
| |
Subroutines | |
| |
| |
Subroutine Concepts | |
| |
| |
Instructions for Writing Subroutines | |
| |
| |
The First Subroutine Example | |
| |
| |
Flowcharting Subroutines | |
| |
| |
Parameter Passing | |
| |
| |
An Example of a Bad Subroutine | |
| |
| |
Some Basic Subroutine Design Considerations | |
| |
| |
| |
Subroutine Parameter Passing Techniques | |
| |
| |
Call-by-Value Technique | |
| |
| |
Call-by-Reference Technique | |
| |
| |
| |
Recursive Subroutines | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Hardware | |
| |
| |
| |
Hardware/Software Synergy | |
| |
| |
| |
The Hardware Building Blocks | |
| |
| |
Microcomputer | |
| |
| |
Memory | |
| |
| |
Microprocessor | |
| |
| |
Buses | |
| |
| |
I/O Integrated Circuits | |
| |
| |
| |
Memory Characteristics | |
| |
| |
Memory Terminology | |
| |
| |
Memory Principles | |
| |
| |
Read Only Memory ICs | |
| |
| |
Read/Write Memory ICs | |
| |
| |
Matching Software to Memory | |
| |
| |
| |
Microprocessor Buses | |
| |
| |
Bus Characteristics | |
| |
| |
Microprocessor Bus Connections | |
| |
| |
Bus Operation Example | |
| |
| |
Computer Failures | |
| |
| |
Memory Expansion | |
| |
| |
| |
Parallel I/O Principles | |
| |
| |
I/O Programming Model | |
| |
| |
| |
Parallel I/O Hardware | |
| |
| |
I/O Circuit Construction | |
| |
| |
Programmable I/O Hardware | |
| |
| |
| |
68HC11 Parallel I/O Hardware | |
| |
| |
The PORTB Register | |
| |
| |
The PORTC Register | |
| |
| |
The DDRC Register | |
| |
| |
The PIOC and PORTCL Registers | |
| |
| |
| |
Parallel I/O Example Using Polling | |
| |
| |
Problem Description | |
| |
| |
I/O Hardware | |
| |
| |
Polling Software | |
| |
| |
| |
Interrupt Concepts | |
| |
| |
| |
The 68HC11 Interrupt System | |
| |
| |
Interrupt Signal Path | |
| |
| |
Interrupt System Operation | |
| |
| |
| |
IRQ Interrupt Examples | |
| |
| |
Single Interrupting Device | |
| |
| |
Multiple Interrupting Devices | |
| |
| |
| |
The Concurrency Problem | |
| |
| |
How It Happens | |
| |
| |
Preventing Problems | |
| |
| |
Example Program with Concurrency Problem | |
| |
| |
| |
The Reentrancy Problem | |
| |
| |
The Data Corruption Problem | |
| |
| |
Data Corruption Solutions | |
| |
| |
More Examples of Reentrant Subroutines | |
| |
| |
| |
Troubleshooting Concurrency and Reentrancy Problems | |
| |
| |
What You Are Up Against | |
| |
| |
Don't Be Misled | |
| |
| |
Do It Right the First Time | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Advanced 68HC11 Hardware | |
| |
| |
| |
The Hardware Configuration | |
| |
| |
Operating Modes | |
| |
| |
The 68HC11 Chip Versions | |
| |
| |
Block Diagram of the 68HC11 | |
| |
| |
68HC11 Pin Connections | |
| |
| |
| |
Memory Space | |
| |
| |
| |
Hardware Reset | |
| |
| |
Reset Operation | |
| |
| |
Hardware Programmable Options | |
| |
| |
Timed-Write-Once Programmable Options | |
| |
| |
| |
Interrupt System | |
| |
| |
IRQ Interrupt | |
| |
| |
Software Interrupt | |
| |
| |
XIRQ Interrupt | |
| |
| |
Illegal Instruction Interrupt | |
| |
| |
Interrupt Priority | |
| |
| |
| |
Parallel I/O Ports | |
| |
| |
Hardware Initialization | |
| |
| |
Parallel I/O | |
| |
| |
| |
Internal Flags | |
| |
| |
The STAF Flag | |
| |
| |
Direct-Clearing Flags | |
| |
| |
| |
Real-Time Clock | |
| |
| |
The RTI Device | |
| |
| |
RTI Programming Example | |
| |
| |
| |
The Programmable Timer | |
| |
| |
Timer Principles | |
| |
| |
Free-Running Counter | |
| |
| |
Input Capture | |
| |
| |
Output Compare | |
| |
| |
Using Input Capture with Output Compare | |
| |
| |
Timer Flag Applications | |
| |
| |
| |
Pulse Accumulator | |
| |
| |
Event-Counting Mode | |
| |
| |
Gated-Time-Accumulation Mode | |
| |
| |
Pulse-Accumulator Flag Applications | |
| |
| |
| |
Serial Communications Interface | |
| |
| |
Data Transmission | |
| |
| |
Communication Terminology | |
| |
| |
ASCII Communication Codes | |
| |
| |
Serial Communication Principles | |
| |
| |
SCI Serial I/O Hardware | |
| |
| |
Programming the SCI | |
| |
| |
SCI Programming Example | |
| |
| |
| |
Analog-to-Digital Converter | |
| |
| |
Analog-to-Digital Conversion Principles | |
| |
| |
68HC11 A/D Converter | |
| |
| |
Analog Input Example | |
| |
| |
| |
Fail-Safe Operation | |
| |
| |
Watchdog Timer | |
| |
| |
Clock Failure Detection | |
| |
| |
| |
I/O Port Summary | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Hardware Expansion | |
| |
| |
Serial Peripheral Interface | |
| |
| |
Microprocessor Bus Expansion | |
| |
| |
| |
Special Hardware Operation | |
| |
| |
Highest-Priority Interrupt | |
| |
| |
Wait Mode | |
| |
| |
Stop Mode | |
| |
| |
Factory Tests | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Real-time Operating Systems | |
| |
| |
| |
System Characteristics | |
| |
| |
Real-time Systems | |
| |
| |
Multitasking Systems | |
| |
| |
| |
Operating System Structure | |
| |
| |
System Tables | |
| |
| |
System Software | |
| |
| |
System Clock | |
| |
| |
| |
Tasks and Their Control | |
| |
| |
Task State | |
| |
| |
Multitasking | |
| |
| |
Task Switching | |
| |
| |
| |
Operating System Services | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Real-time System Design | |
| |
| |
| |
Weather Station Design | |
| |
| |
Weather Station Specifications | |
| |
| |
Weather Station Hardware | |
| |
| |
| |
Operating System Design | |
| |
| |
Multitasking | |
| |
| |
System Clock | |
| |
| |
I/O Support | |
| |
| |
| |
Operating System Implementation | |
| |
| |
Task-Control-Blocks | |
| |
| |
System Startup | |
| |
| |
The Background Task | |
| |
| |
System Service Calls | |
| |
| |
Schedule Task with an Interrupt | |
| |
| |
The Dispatcher | |
| |
| |
The Suspend Service | |
| |
| |
The System Clock | |
| |
| |
The Schedule Service | |
| |
| |
The SCI Transmit/Receive Services | |
| |
| |
System Performance Indicators | |
| |
| |
| |
Weather Station Implementation | |
| |
| |
Task Variables | |
| |
| |
Task0--Wind Speed | |
| |
| |
Task5--Zero Wind Speed | |
| |
| |
Task1--Wind Direction | |
| |
| |
Task3--Wind Direction Message | |
| |
| |
Task2--Wind Speed Message on CRT | |
| |
| |
Task4--Wind Speed Digital Displays | |
| |
| |
Task6--Reset Highest Wind Speed and Flash Light | |
| |
| |
Final Details | |
| |
| |
| |
Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
The 68HC11 Instruction Set | |
| |
| |
| |
Instruction Set Table and Programming Model | |
| |
| |
Motorola 68HC11 Programming Model | |
| |
| |
Motorola 68HC11 Instruction Set | |
| |
| |
| |
Reverse Instruction Set Table | |
| |
| |
| |
The 68HC11 Op Code Maps | |
| |
| |
| |
Hardware Control Registers | |
| |
| |
| |
Register Addresses | |
| |
| |
| |
Control Registers and Bits | |
| |
| |
| |
The Motorola M68HC11EVB, EVBU, and EVBU2 Microcomputer Trainers | |
| |
| |
| |
Introduction to the Motorola Trainers | |
| |
| |
The Trainer Components | |
| |
| |
CRT Terminal | |
| |
| |
Monitor Program | |
| |
| |
Trainer Startup | |
| |
| |
Monitor Program Crashes | |
| |
| |
| |
Monitor Program Features | |