Document
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...
M68HC05
Applications Guide
M68HC05
Microcontrollers
M68HC05AG/D Rev. 4, 3/2002
WWW.MOTOROLA.COM/SEMICONDUCTORS
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc.
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc.
M68HC05
Applications Guide
To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to:
http://www.motorola.com/semiconductors/ The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location.
Motorola and the Stylized M Logo are registered trademarks of Motorola, Inc. DigitalDNA is a trademark of Motorola, Inc.
© Motorola, Inc., 1989, 1996, 2002
MOTOROLA
M68HC05 Applications Guide — Rev. 4.0
Applications Guide For More Information On This Product,
Go to: www.freescale.com
3
Revision History
Freescale Semiconductor, Inc.
Date April, 1997
March, 2002
Revision Level 3.0
4.0
Revision History
Description
Format and organizational changes Updated to current publication styles Appendix A. Instruction Set Details — Corrected Boolean formulae for compare accumulator with memory (CMP) instruction Appendix A. Instruction Set Details — Corrected Boolean formulae for subtract (SUB) instruction
Page Number(s) Throughout
270
297
NOTE:
As this document was originally released in 1989, there have been some changes in Motorola’s procedures. For example, there are references in this document to an electronic bulletin board system (BBS) for freeware. BBS has been replaced with the World Wide Web. For freeware and any other referenced documentation please refer to:
http://www.motorola.com/semiconductors/
Freescale Semiconductor, Inc...
M68HC05 Applications Guide — Rev. 4.0
4 Applications Guide For More Information On This Product, Go to: www.freescale.com
MOTOROLA
Freescale Semiconductor, Inc.
Applications Guide — M68HC05
List of Sections
Section 1. General Description . . . . . . . . . . . . . . . . . . . . 21 Section 2. Microcontroller Operation . . . . . . . . . . . . . . . 29 Section 3. MC68HC705C8 Functional Data . . . . . . . . . . . 73 Section 4. Applications. . . . . . . . . . . . . . . . . . . . . . . . . . 187 Appendix A. Instruction Set Details . . . . . . . . . . . . . . . 233 Appendix B. Review Questions . . . . . . . . . . . . . . . . . . . 303
Freescale Semiconductor, Inc...
MOTOROLA
M68HC05 Applications Guide — Rev. 4.0
List of Sections For More Information On This Product,
Go to: www.freescale.com
5
List of Sections
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...
M68HC05 Applications Guide — Rev. 4.0
6 List of Sections For More Information On This Product, Go to: www.freescale.com
MOTOROLA
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...
Applications Guide — M68HC05
Table of Contents
MOTOROLA
Section 1. General Description
1.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.3 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4 Background. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.5 Computer Systems Description . . . . . . . . . . . . . . . . . . . . . . . .24
1.6 Microcontroller Applications Overview . . . . . . . . . . . . . . . . . . .26
1.7 Project Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Section 2. Microcontroller Operation
2.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.3 Number Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4 Computer Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.4.1 Computer Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.4.2 Computer Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 2.4.3 CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.4.4 Memory Uses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.4.5 Memory Maps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.5 Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.6 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 2.6.1 Flowchart . . . .