did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780766834484

Mc68Hc12

by
  • ISBN13:

    9780766834484

  • ISBN10:

    0766834484

  • Edition: CD
  • Format: Hardcover
  • Copyright: 2002-07-01
  • Publisher: Cengage Learning
  • Purchase Benefits
  • Free Shipping Icon 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.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $266.95

Summary

This comprehensive book from Delmar uses assembly language and the C language to provide readers with a refreshingly straightforward introduction to applications of the Motorola 16-bit microcontroller 68HC12. Using a methodical, step-by-step approach proven to facilitate learning, each of its thirteen chapters introduces a basic concept and proceeds gradually into more detail to guide readers to new programming skills while strengthening their understanding of 68HC12 architecture. The book begins by acquainting readers with 68HC12 CPU registers, addressing modes, Assembler directives, plus simple programs for arithmetic and program loops. Subsequent chapters feature detailed examples and tutorials that clearly demonstrate applications of parallel ports, timer functions, analog to digital (A/D) converters, serial communication interface, controller area network, plus on-chip and external memory expansion. Extraordinarily readable and easy to learn from, MC68HC12 An Introduction: Software and Hardware Interfacing – with its accompanying CD-ROM – serves as an excellent introductory book for students enrolled in electrical engineering, electronic engineering technology, and computer engineering technology. Clear and concise explanations, a glossary, and helpful appendices – including ICC12 library functions, SPI-compatible chips, plus a listing of 68HC12 development tool vendors, and more – also make this book ideal for any professional who wants to gain an understanding of Motorola 68HC12 hardware, software and interfacing.

Author Biography

Han-Way Huang is a Professor in the Department of Electrical and Computer Engineering and Technology at Minnesota State University in Mankato, MN.

Table of Contents

Preface xvii
Introduction to the 68HC12 Microcontroller
1(28)
Objectives
1(1)
Basic Computer Concepts
2(6)
The Processor
3(4)
Memory
7(1)
The Computer's Software
8(2)
The 68HC12 CPU Registers
10(2)
Memory Addressing
12(1)
68HC12 Addressing Modes
13(7)
Inherent Mode
14(1)
Immediate Mode
15(1)
Direct Mode
15(1)
Extended Mode
15(1)
Relative Mode
15(1)
Indexed Modes
16(4)
Addressing More than 64KB
20(1)
68HC12 Instruction Examples
20(5)
The Load & Store Instructions
20(2)
Transfer & Exchange Instructions
22(1)
Move Instructions
23(1)
Add & Subtract Instructions
23(2)
Instruction Queue
25(1)
Instruction Execution Cycle
25(1)
Summary
26(1)
Exercises
27(2)
68HC12 Assembly Programming
29(46)
Objectives
29(1)
Assembly Language Program Structure
30(2)
The Label Field
30(1)
The Operation Field
31(1)
The Operand Field
31(1)
The Comment Field
31(1)
Assembler Directives
32(3)
Software Development Issues
35(2)
Writing Programs to do Arithmetic
37(13)
Carry/Borrow Flag
39(1)
Multiprecision Addition
40(1)
Subtraction & the C Flag
41(1)
Multiprecision Subtraction
42(1)
Binary-Coded-Decimal (BCD) Addition
43(2)
Multiplication & Division
45(5)
Program Loops
50(12)
Condition Code Register
52(1)
Branch Instructions
53(3)
Compare & Test Instructions
56(1)
Loop Primitive Instructions
56(3)
Decrementing & Incrementing Instructions
59(1)
Bit Condition Branch Instructions
60(2)
Instructions for Variable Initialization
62(1)
Shift & Rotate Instructions
62(6)
Boolean Logic Instructions
68(1)
Bit Test & Manipulate Instruction
69(1)
Program Execution Time
70(2)
Summary
72(1)
Exercises
73(2)
68HC12 Members & Hardware & Software Development Tools
75(34)
Objectives
75(1)
68HC12 Members
76(2)
Development Tools for the 68HC12
78(1)
68HC12 Demo & Evaluation Boards
79(5)
68HC12 Demo Boards from Motorola
80(2)
Demo Boards from Axiom Manufacturing
82(2)
BDM-based Debuggers
84(1)
The D-Bug12 Monitor
84(1)
Using the Axiom CME-12BC Demo Board
85(21)
Starting the MiniIDE
86(1)
Communicating with the CME-12BC Demo Board
86(2)
Using the D-Bug12 Commands
88(10)
Entering an Assembly Program
98(2)
Assembling the Program
100(2)
Running & Debugging the Program
102(3)
The CME-12BC Memory Map
105(1)
Summary
106(1)
Lab Exercises & Assignments
107(2)
Advanced Assembly Programming
109(56)
Objectives
109(1)
Introduction
110(1)
Stack
110(2)
Indexable Data Structures
112(3)
Strings
115(13)
Data Conversion
116(5)
Character & Word Counting
121(2)
Word Matching
123(3)
String Insertion
126(2)
Subroutines
128(2)
Issues in Subroutine Calls
130(1)
The Stack Frame
131(1)
Examples of Subroutine Calls
132(13)
Finding the Greatest Common Divisor
132(2)
Multiple Byte Division
134(4)
Bubble Sort
138(4)
Finding the Square Root
142(3)
Using the D-Bug12 Functions to Perform I/O Operations
145(13)
Calling D-Bug12 Functions from Assembly Language
146(1)
Descriptions of Callable Functions
147(8)
Using the D-Bug12 Functions
155(3)
Summary
158(1)
Exercises
159(2)
Lab Practices & Assignments
161(4)
C Language Programming
165(34)
Objectives
165(1)
Introduction to C
166(1)
Types, Operators & Expressions
167(4)
Data Types
167(1)
Variable Declarations
167(1)
Constants
167(1)
Arithmetic Operators
168(1)
Bitwise Operators
168(1)
Relational & Logical Operators
169(1)
Precedence of Operators
170(1)
Control Flow
171(3)
If Statement
171(1)
If-Else Statement
171(1)
Multiway Conditional Statement
171(1)
Switch Statement
172(1)
For-Loop Statement
172(1)
While Statement
173(1)
Do-While Statement
173(1)
GOTO Statement
173(1)
Input & Output
174(2)
Functions & Program Structure
176(1)
Pointers, Arrays, Structures & Unions
177(6)
Pointers & Addresses
177(2)
Arrays
179(1)
Pointers & Arrays
179(1)
Passing Arrays to a Function
179(1)
Initializing Arrays
180(1)
Structures
181(1)
Unions
182(1)
Miscellaneous Items
183(1)
Automatic/External/Static/Volatile
183(1)
Scope Rules
183(1)
Using the Imagecraft C Compiler (ICC12)
184(12)
Inline Assembly Instructions
196(1)
Summary
196(1)
Exercises
197(1)
Lab Exercises & Assignments
198(1)
Interrupts, Resets &. Operation Modes
199(30)
Objectives
199(1)
Fundamental Concepts of Interrupts
200(4)
What is an Interrupt?
200(1)
Why are Interrupts Used?
200(1)
Interrupt Maskability
201(1)
Interrupt Priority
201(1)
Interrupt Service
201(1)
Interrupt Vector
202(1)
Interrupt Programming
203(1)
Overhead of Interrupts
204(1)
Resets
204(1)
68HC12 Exceptions
204(9)
Maskable Interrupts
205(3)
Nonmaskable Interrupts
208(1)
Resets
209(3)
Low Power Modes
212(1)
Exception Programming for the 68HC12
213(11)
Initializing the Interrupt Vector Table
213(3)
Writing Exception Service Routine
216(1)
Enabling the Interrupt
217(7)
Operation Modes
224(1)
Normal Operation Modes
224(1)
Special Operation Modes
225(1)
Background Debug Mode
225(1)
Summary
225(2)
Exercises
227(1)
Lab Exercises & Assignments
227(2)
Parallel Ports
229(60)
Objectives
229(1)
Basic Concepts of I/O
230(1)
I/O Addressing
231(1)
I/O Synchronization
231(3)
Synchronizing the Microprocessor & the Interface Chip
232(1)
Synchronizing the Interface Chip & I/O Device
232(2)
Overview of 68HC12 Parallel Port
234(8)
Port A & Port B
237(1)
Port C & Port D
237(1)
Port E
238(2)
Port F & Port G
240(1)
Port H & J
240(1)
Port K
241(1)
Port P
241(1)
Port S
241(1)
Port T
241(1)
Port AD
241(1)
Port ADO & AD1
241(1)
Port CAN
241(1)
Port CAN0, CAN1 & CAN2
242(1)
Port IB
242(1)
Interfacing with Simple Input & Output Devices
242(17)
Interfacing with LEDs
242(2)
Interfacing with Seven-Segment Displays
244(7)
Liquid Crystal Displays (LCDs)
251(1)
The Optrex DMC-20434 LCD Kit
252(6)
Interfacing with DIP Switches
258(1)
Interfacing Parallel Ports to a Keyboard
259(5)
Keyboard Scanning Techniques
259(2)
Keyboard Debouncing
261(2)
ASCII Code Table Lookup
263(1)
Interfacing the 68HC12 to a Keypad
264(5)
Interfacing with a D/A Converter
269(3)
The AD7302 D/A Converter
269(1)
Interfacing the AD7302 with the 68HC12
270(2)
Stepper Motor Control
272(7)
Stepper Motor Drivers
276(3)
Key Wakeups
279(5)
Key Wakeup Registers
280(1)
Key Wakeup Initialization
281(1)
Considerations of the Key Wakeup Application
282(2)
Summary
284(1)
Exercises
285(2)
Lab Exercises & Assignments
287(2)
Timer Functions
289(70)
Objectives
289(1)
Why are Timer Functions Important?
290(1)
Standard Timer Module
291(1)
Timer Counter Register
291(3)
Timer System Control Register (TSCR)
291(1)
Timer Interrupt Mask Register 2 (TMSK2)
292(2)
Timer Interrupt Flag 2 Register (TFLG2)
294(1)
Input Capture Function
294(10)
Input-Capture/Output-Compare Selection
294(1)
Pins for Input Capture
295(1)
Registers Associated with Input Capture
295(1)
Input-Capture Applications
296(8)
Output-Compare Function
304(13)
Operation of the Output-Compare Function
304(1)
Registers Related to the Output-Compare Function
305(1)
Applications of the Output-Compare Function
305(6)
Using OC7 to Control Multiple Output-Compare Functions
311(5)
Forced Output-Compare
316(1)
Real-Time Interrupt (RTI)
317(2)
Pulse Accumulator
319(7)
Registers Related to the Pulse Accumulator
319(1)
Pulse Accumulator Applications
320(6)
Pulse-width-modulation (PWM) Function
326(16)
Operation of the PWM
329(1)
Registers Related to PWM
329(4)
PWM Duty Cycle & Period
333(4)
DC Motor Control
337(5)
Enhanced Capture Timer (ECT) Module
342(8)
Enhanced Capture Timer Modes of Operation
342(1)
Why Enhanced Capture Timer Module?
342(1)
Registers Associated with Enhanced Input Capture Function
343(5)
Applications of the Enhanced Capture Function
348(2)
Pulse Accumulators Associated with Enhanced Capture Timer
350(4)
Operations of the Enhanced Pulse Accumulators
352(2)
Summary
354(1)
Exercises
355(2)
Lab Exercises & Assignments
357(2)
Serial Interface - SCI & SPI
359(68)
Objectives
359(1)
Fundamental Concepts of Serial Communications
360(1)
The RS-232 Standard
360(8)
EIA-232 Electrical Specifications
361(1)
EIA-232-E Functional Specifications
361(1)
EIA-232-E Mechanical Specifications
362(1)
EIA-232-E Procedural Specifications
363(2)
Data Format
365(2)
Data Transmission Errors
367(1)
Null Modem Connection
367(1)
The 68HC12 Serial Communication Interface
368(8)
SCI Baud Rate Generation
369(1)
Registers Associated with SCI
369(7)
Interfacing SCI with EIA-232
376(6)
The SPI Function
382(3)
SPI Signal Pins
382(1)
SPI Operation
383(1)
Bidirectional Mode (MOMI or SISO)
384(1)
Registers Related to the SPI Subsystem
385(6)
SPI Circuit Connection
391(2)
SPI-Compatible Chips
393(1)
The HC595 Shift Register
393(4)
The MAX7221 Seven-Segment Display Driver
397(13)
MAX7221 Pins
398(1)
MAX7221 Functioning
399(5)
Using the MAX7221
404(6)
Using the Serial E2PROM X25138
410(12)
Principles of Operation
411(5)
Using SPI to Interface with the X25138
416(6)
Summary
422(1)
Exercises
423(3)
Lab Exercises & Assignment
426(1)
Analog-to-Digital Converter
427(42)
Objectives
427(1)
Fundamental Concepts of the A/D Converter
428(1)
Successive Approximation Method
429(1)
Signal Conditioning Circuits
430(3)
Optimal Voltage Range for the A/D Converter
430(1)
Voltage Scaling Circuit
431(1)
Voltage Shifting/Scaling Circuit
432(1)
The 68HC12 A/D Converter
433(1)
ATD Registers
434(7)
ATD Control Register 2 (ATDCTL2, ATD0CTL2 & ATD1CTL2)
434(1)
ATD Control Register 3 (ATDCTL3, ATD0CTL3 & ATD1CTL3)
435(1)
ATD Control Register 4 (ATDCTL4, ATD0CTL4 & ATD1CTL4)
436(1)
ATD Control Register 5 (ATDCTL5, ATD0CTL5 & ATD1CTL5)
437(2)
ATD Status Registers (ATDSTAT0, ATDSTAT1, ATD0STAT0, ATD0STAT1, ATD1STAT0 & ATD1STAT1)
439(1)
ATD Test Registers (ATDTESTH/L, ATD0TESTH/L & ATD1TESTH/L)
440(1)
Port AD Data Input Register (PORTAD & PORTAD0/PORTAD 1)
440(1)
ATD Result Registers (ADR0H/L..ADR7H/L, ADR00H/L..ADR 7H/L, & ADR10H/L..ADR17H/L..ADR17H/L)
440(1)
The Procedure for Using the A/D Converter
441(4)
Measuring the Temperature
445(9)
Measuring Barometric Pressure
454(6)
Using the External A/D Converter AD7894
460(6)
Signals
461(1)
Chip Functioning
461(3)
Interfacing the AD7894 with the 68HC12
464(2)
Summary
466(1)
Exercises
466(2)
Lab Exercises & Assignments
468(1)
Development Support
469(36)
Objectives
469(1)
Fundamental Concepts of Software Debugging
470(1)
Instruction Queue
471(1)
Background Debug Mode (BDM)
472(1)
BDM Serial Interface
473(2)
BDM Registers
475(4)
BDM Instruction Register
475(2)
BDM Status Register
477(1)
BDM CCR Holding Register
478(1)
BDM Shift Register
478(1)
BDM Address Register ($FF04-$FF05)
478(1)
BDM Internal Register Position Register (BDMINR)
479(1)
BDM Commands
479(3)
BDM Operation
482(2)
Executing Firmware Commands
482(1)
Instruction Tracing
483(1)
Instruction Tagging
483(1)
BDM & CPU Modes of Operation
484(1)
Breakpoints
484(3)
Breakpoint Registers
484(3)
Breakpoint Modes
487(1)
The BDM-based Debugger
487(1)
Using the Axiom AX-BDM12 Debugger
488(14)
Summary
502(1)
Lab Exercises & Assignments
502(3)
Controller Area Network (CAN)
505(56)
Objectives
505(1)
Overview of Controller Area Network (CAN)
506(3)
CAN Messages
509(8)
Data Frames
509(3)
Remote Frame
512(1)
Error Frame
512(1)
Overload Frame
513(1)
Interframe Space
514(2)
Message Filtering
516(1)
Message Validation
516(1)
Bit-Stream Coding
516(1)
Error Handling
517(1)
Bit Error
517(1)
Stuff Error
517(1)
CRC Error
517(1)
Form Error
517(1)
Acknowledgement Error
517(1)
Error Signaling
517(1)
Fault Confinement
518(1)
CAN Node Status
518(1)
Error Counts
518(1)
CAN Message Bit Timing
519(1)
Nominal Bit Time
519(1)
Length-of-Time Segments
520(1)
Synchronization Issues
520(1)
Resynchronization Jump Width
520(1)
Phase Error of an Edge
521(1)
Synchronization Rules
521(1)
Overview of the MSCAN12 Module
521(1)
MSCAN12 Message Storage
522(2)
Receive Structures
522(1)
Transmit Structures
523(1)
Identifier Acceptance Filter
524(3)
Interrupts
527(1)
CAN Low-Power Modes
528(2)
MSCAN Sleep Mode
528(1)
MSCAN Soft-Reset Mode
529(1)
MSCAN Power-Down Mode
529(1)
Wakeup Function
529(1)
Timer Link
530(1)
Clock System
530(1)
Registers Associated with MSCAN12
531(12)
Message Buffer Registers
532(1)
MSCAN12 Module Control Register 0 (CxMCR0)
533(1)
MSCAN12 Module Control Register 1 (CxMCR1)
534(1)
MSCAN12 Bus Timing Register 0 (CxBTR0)
535(1)
MSCAN12 Bus Timing Register 1 (CxBTR1)
536(1)
MSCAN12 Receiver Flag Register (CxRFLG)
537(1)
MSCAN12 Receiver Interrupt Enable Register (CxRIER)
538(1)
MSCAN12 Transmitter Flag Register (CxTFLG)
538(1)
MSCAN12 Transmitter Control Register (CxTCR)
539(1)
MSCAN12 Identifier Acceptance Control Register (CxIDAC)
539(1)
MSCAN12 Receive Error Counter (CxRXERR)
540(1)
MSCAN12 Transmit Error Counter (CxTXERR)
540(1)
MSCAN12 Identifier Acceptance Registers (CxIDARO-7)
540(1)
MSCAN12 Identifier Mask Registers (CxIDMR0-7)
541(1)
MSCAN12 Port CAN Control Register (PCTLCAN)
542(1)
MSCAN12 Port CAN Data Register (PORTCAN)
542(1)
MSCAN12 Port CAN Data Direction Register (DDRCAN)
542(1)
Physical CAN Bus Connection
543(14)
The PCA82C250 CAN Transceiver
544(1)
Interfacing PCA82C250 to the 68HC12
545(2)
Setting the CAN Timing Parameters
547(3)
CAN Programming
550(7)
Summary
557(1)
Exercises
558(1)
Lab Exercises & Assignments
559(2)
Internal Memory Configuration & External Memory Expansion
561(140)
Objectives:
561(1)
Overview of the 68HC12 Memory System
562(1)
Internal Resource Mapping
562(6)
Register Block Mapping
563(1)
RAM Mapping
564(1)
EEPROM Mapping
564(1)
Flash Memory Mapping
565(1)
Program Space Expansion
565(3)
The Flash Memory Operation
568(13)
Flash Memory Control
569(3)
Erasing the Flash Memory
572(3)
Programming the Flash Memory
575(4)
Memory Paging in Programming
579(2)
EEPROM Memory
581(14)
EEPROM Programmer's Model
581(1)
EEPROM Control Registers
582(4)
EEPROM Standard Mode Erasing Algorithm
586(1)
EEPROM AUTO Mode Erasing Algorithm
587(4)
EEPROM Program Operation
591(1)
Standard Mode Programming Algorithm
591(1)
EEPROM AUTO Mode Programming Algorithm
592(3)
External Memory Expansion
595(7)
Memory Space Assignment
596(1)
Address Decoder Design
597(5)
Basics of Bus Signals
602(4)
Waveforms of Bus Signals
603(1)
Bus Transactions
604(1)
Bus Multiplexing
605(1)
The 68HC12 Bus Timing Diagram
606(2)
Adding External Memory to the 68HC12
608(13)
The IDT7164 SRAM
609(5)
The Atmel AT28HC64B EEPROM
614(6)
The Optrex DMC-20434 LCD Kit
620(1)
The Memory Expansion Issue
621(11)
Memory Space Assignment
621(1)
Control Signal Requirements
622(10)
Summary
632(1)
Exercises
633(1)
Lab Exercises & Assignments
634(1)
Appendixes
A Instruction Reference
635(20)
B C Library Functions in ICC12
655(6)
C Register Block
661(26)
D Interrupt Vectors
687(4)
E SPI-Compatible Chips
691(8)
F 68HC12 Development Tool Vendor
699(2)
Glossary 701(10)
Index 711

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 Used, 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.

Rewards Program