The HCS12 / 9S12 An Introduction to Software and Hardware Interfacing

  • ISBN13:


  • ISBN10:


  • Edition: 2nd
  • Format: Hardcover
  • Copyright: 2009-03-25
  • Publisher: Delmar Cengage Learning

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
  • We Buy This Book Back!
    In-Store Credit: $10.50
    Check/Direct Deposit: $10.00
  • Complimentary 7-Day eTextbook Access - Read more
    When you rent or buy this book, you will receive complimentary 7-day online access to the eTextbook version from your PC, Mac, tablet, or smartphone. Feature not included on Marketplace Items.
List Price: $329.99 Save up to $305.08
  • Rent Book $197.99
    Add to Cart Free Shipping


    7-Day eTextbook Access 7-Day eTextbook Access

Supplemental Materials

What is included with this book?

  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
  • The Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.


This new book provides a total solution for learning and teaching embedded system design based on the Freescale HCS12/9S12 microcontroller. Readers will learn step-by-step how to program the HCS12 using both assembly and C languages, as well as how to use such development tools as CodeWarrior, ImageCraft ICC12, MiniIDE, GNU C, and EGNU IDE. Supportive examples clearly illustrate all applications of the HCS12 peripheral functions, including parallel port, timer functions, PWM, UART port, SPI, I2C, CAN, on-chip flash and EEPROM programming, external memory expansion, and more. New sections on C programming style, software development methodology, and software reuse have been added in theis revision. A back-of-book CD contains the source code for all examples in the book, several groups of reusable utility functions, and complimentary freeware development tools for improved learning.

Table of Contents

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
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
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
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
Table of Contents provided by Publisher. All Rights Reserved.

Rewards Program

Write a Review