| |
| |
Preface | |
| |
| |
| |
| |
| |
| |
Introduction to the HCS12 | |
| |
| |
Microcontroller Objectives Number System Issue | |
| |
| |
The Computer Hardware Organization | |
| |
| |
The processor Microprocessor | |
| |
| |
Microcontroller Embedded Systems Memory | |
| |
| |
Magnetic Memory | |
| |
| |
Optical Memory | |
| |
| |
Semiconductor Memory | |
| |
| |
Non-Volatile and Volatile Memory | |
| |
| |
Random Access Memory | |
| |
| |
Read-Only Memory | |
| |
| |
Memory System | |
| |
| |
Operation Read | |
| |
| |
Operation Write | |
| |
| |
Operation Program Execution | |
| |
| |
The circuit of the Program Counter | |
| |
| |
Where does the Processor Start to Execute Program? | |
| |
| |
Instruction Execution Process Instruction | |
| |
| |
Sequence Example Instruction Execution Process | |
| |
| |
Overview of the HCS12 | |
| |
| |
Microcontroller The HCS12 | |
| |
| |
CPU Registers HCS12 | |
| |
| |
Addressing Modes | |
| |
| |
Inherent Mode | |
| |
| |
Immediate Mode | |
| |
| |
Direct Mode | |
| |
| |
Extended Mode | |
| |
| |
Relative Mode | |
| |
| |
Indexed Addressing Modes | |
| |
| |
Indexed Addressing Modes with Constant Offsets | |
| |
| |
Indexed Addressing Mode with Offset in an Accumulator | |
| |
| |
Auto Pre/Postdecrement/Increment | |
| |
| |
Indexed Addressing Modes 16-bit | |
| |
| |
Offset Indexed-Indirect Mode | |
| |
| |
Accumulator D Indirect Indexed Addressing | |
| |
| |
Addressing More than 64 Kbytes | |
| |
| |
A Sample of HCS12 | |
| |
| |
Instructions The Load and Store | |
| |
| |
Instructions Transfer and Exchange | |
| |
| |
Instructions Move | |
| |
| |
Instructions Add and Subtract | |
| |
| |
Instructions Instruction Queue | |
| |
| |
Summary | |
| |
| |
Exercise 2 | |
| |
| |
| |
HCS12 Assembly Programming Objectives | |
| |
| |
Assembly Language Program Structure | |
| |
| |
The Label Field | |
| |
| |
The Operation Field | |
| |
| |
The Operand Field | |
| |
| |
The Comment Field Assembler Directives | |
| |
| |
Software Development Issues | |
| |
| |
Writing Programs to Do Arithmetic Carry/Borrow Flag | |
| |
| |
Multiprecision Addition Subtraction and the C Flag | |
| |
| |
Multiprecision Subtraction Binary-Coded-Decimal (BCD) | |
| |
| |
Addition Multiplication and Division Program | |
| |
| |
Loops Condition Code | |
| |
| |
Register Branch Instructions | |
| |
| |
Compare and Test Instructions | |
| |
| |
Loop Primitive Instructions | |
| |
| |
Implementation of Looping Constructs | |
| |
| |
Decrementing and Incrementing Instructions | |
| |
| |
Bit Condition Branch Instructions | |
| |
| |
Instructions for Variable Initialization | |
| |
| |
Shift and Rotate Instructions | |
| |
| |
Boolean Logic Instructions | |
| |
| |
Bit Test and Manipulate Instruction | |
| |
| |
Program Execution Time | |
| |
| |
The Multiply and Accumulate Instruction EMACS | |
| |
| |
Summary | |
| |
| |
Exercises 3 | |
| |
| |
| |
Hardware and Software Development Tools for the HCS12 | |
| |
| |
Objectives HCS12 | |
| |
| |
Members Development Tools for the HCS12 | |
| |
| |
Software Development Tools | |
| |
| |
Hardware Development Tools | |
| |
| |
Types of HCS12 Demo boards | |
| |
| |
The Dragon12-Plus Demo Board | |
| |
| |
The D-Bug12 Monitor | |
| |
| |
The D-Bug12 Operating Modes EVB Mode | |
| |
| |
Using a Demo Board with the D-Bug12 | |
| |
| |
Monitor Starting the MiniIDE Communicating with the Demo Board | |
| |
| |
Using the D-Bug12 Commands Entering an Assembly Program | |
| |
| |
Assembling the Program Downloading the S-Record | |
| |
| |
File onto the Demo Board for Execution | |
| |
| |
Running and Debugging the Program | |
| |
| |
Other D-Bug12 Modes | |
| |
| |
The Pod Mode | |
| |
| |
The Jump-to-EEPROM Mode | |
| |
| |
The Bootloader Mode | |
| |
| |
Tips for Assembly Language Program Debugging | |
| |
| |
Syntax Errors | |
| |
| |
Logical Errors | |
| |
| |
Using the CodeWarrior | |
| |
| |
Building Software Project | |
| |
| |
Using the CodeWarrior Project | |
| |
| |
Setup Source Code Entering Project | |
| |
| |
Build Program Debugging BDM | |
| |
| |
Serial Interface | |
| |
| |
The BDM-Based Debugger | |
| |
| |
Summary | |
| |
| |
Lab Exercises and Assignment 4 | |
| |
| |
| |
Advanced Assembly Programming Objectives | |
| |
| |
Introduction Stack Indexable Data Structures | |
| |
| |
Strings Data Conversion Character and Word Counting | |
| |
| |
Word Matching | |
| |
| |
String Insertion Subroutines | |
| |
| |
Issues in Subroutine Calls | |
| |
| |
Parameter Passing Result Returning Allocation of Local Variables | |
| |
| |
The Stack Frame Examples of Subroutine Calls | |
| |
| |
Finding the Greatest Common Divisor | |
| |
| |
Multiple Byte Division Bubble Sort | |
| |
| |
Finding the Square Root | |
| |
| |
Using the D-Bug12 Functions to Perform I/O Operations | |
| |
| |
Calling D-Bug12 Functions from Assembly Language | |
| |
| |
Descriptions of Callable Functions | |
| |
| |
Using the D-Bug12 Functions | |
| |
| |
Tips for Program Debugging Involving | |
| |
| |
Subroutine Calls What to Do When the Program | |
| |
| |
Gets Stuck General Debugging Strategy | |
| |
| |
Summary Exercises Lab Exercises and Assignments 5 | |
| |
| |
| |
C Language Programming Objectives | |
| |
| |
Introduction to C Types, Operators, and Expressions | |