- Shopping Bag ( 0 items )
Ships from: Coquitlam, Canada
Usually ships in 1-2 business days
Ships from: Naperville, IL
Usually ships in 1-2 business days
|1||Introduction to the 68HC12||1|
|2||68HC12 Assembly Language Programming||14|
|3||Advanced Assembly Programming||71|
|6||Exceptions - Resets and Interrupts||199|
|7||The 68HC12 Clock Module and standard Timer Module (TIM)||240|
|8||The 68HC12 Memory System||294|
|9||Analog-To-Digital (ATD) Converter||351|
|10||68HC12 Communications System - Multiple Serial Interface||392|
|A||68HC12 Instruction Set||438|
|B||68HC812A4 Register Set||460|
|C||Number Systems and Number Arithmetic||465|
|D||Digital Logic Fundamentals||482|
|E||Mobile Robot and Related Products for the 68HC12||491|
One of the most compelling reasons to write 68HC12 Book is that Motorola is slowly phasing out the popular 68HC 11 microcontroller-based evaluation boards and replacing them with the 68HC 12. The 68HC 11 family of microcontrollers have been the preferred choice of educators due to their built-in input and output (I/O) capabilities, a variety of timer functions, and platforms for easy programming and interfacing. The 68HC 12 retained all the favorable features of the 68HC 11 (in fact, one can run any 68HC 11 code on the 68HC 12 with minor modifications) and increased the computational power while enhancing hardware and software components. Compared to its predecessor, the 68HC12 has reduced the interrupt latency time, increased the I/Ocapacity, added complex math operations, incorporated fuzzy logic functions, and improved the overall system performance by adapting a mechanism called instruction queuing, which is similar to the pipelining s6heme found in more powerful microprocessors. This book is about the 68HC 12; we show how to program and uncover the possibilities of 68HC 12 applications.
This book is written for undergraduate students taking a microcontroller or microprocessor course, frequently found in electrical engineering and computer engineering curricula. These courses aim to teach students the fundamental knowledge of microcontrollers/microprocessors and techniques to interface them with external devices, pointing out the important role of embedded microcontroller systems in our modern society. The book is designed to assist instructors to fulfill such course objectives by combining both the theory and applications of microcontrollers. In particular, we chose the 68HC12 microcontroller since it is becoming the industry standard.
We expect students to have taken an introductory logic course and a freshmen programming language course. For a quick review of digital logic, we included Appendix D. Having taken a computer language course will help students understand how assembly language programs are related to high-level language programs, but we expect students with a minimal exposure to computer programming will follow the text subjects without too much trouble.
We must also address one other category of readers. Although the book is mainly designed for students learning the subject in an academic setting, it can be easily adopted by engineers who want to learn the subject on their own. Since the underlying concepts and functional components of two different types of microcontrollers are very similar to each other, the acquired knowledge of the 68HC12 can naturally be applied to other microprocessors and microcontrollers. Such knowledge is essential for electrical and computer engineering students as we live in a society where more and more engineering problems are solved by embedded microcontrollers. In fact, we find the scope of actual applications of microcontrollers expanding as new problems are encountered and solved by the engineering community.
We have three objectives for writing this book; we want you to learn (1) fundamental assembly language programming skills, (2) functional hardware components of a microcontroller, and (3) skills to interface a variety of external devices with microcontrollers. The entire book is designed with those three objectives in mind. As you already know, skills cannot be mastered without practice, and we encourage you to program and try the examples as you read. The enclosed software on the back of the book provides a convenient means to write, edit, assemble, and execute your programs. We have included lots of examples and applications to introduce you to some of the important uses of the 68HC12 controller.
Among the many examples, you will find a set of mobile robot applications throughout the book. We included these applications for their pedagogical advantages learned from our own experience for using them in our microcontroller courses. In fact, the mobile robot applications not only made students appreciate the range of tasks the controller can perform, but also helped the students to understand and integrate multiple subject topics in a single project.
Each year, the student response has been nothing short of enthusiastic. The students consistently pointed out the value of the mobile robot applications that provided students with an experience to develop a hands-on working knowledge of the microcontroller. We hope you will take full advantage of the text by creating and developing your own mobile robots. Appendix E contains the information necessary for you to acquire parts to construct your own robot. The applications are, however, not limited to the robot applications. You will find an ample amount of nonrobot applications throughout the book.
In organizing each chapter, we gave a great deal of consideration to the order and means of subject presentations. The assembly language programming techniques are studied in the first portion of the book, whereas the rest of the book is dedicated to the controller hardware and how to program the hardware components to interface the controller with external devices. Each chapter starts with a list of chapter objectives to give you a clear purpose for reading the entire chapter. Following the objectives, you will also find an introductory subsection for each chapter, informing you of the section contents. After the main body of a chapter is presented, starting in Chapter 3, you will find an application section, where a particular application is chosen to illustrate the subjects contained in the chapter. We study the chapter subjects once again in the laboratory application section, which follows the application section.
A laboratory application section contains the mobile robot laboratory exercises associated with the chapter subject. The 11 exercises can be used as a set of optional, fun activities as you read this book or as a part of a course requirement. Figure 1 provides an overview of where each laboratory exercise fits in the development of the overall mobile robot control program.
The first five labs found in Chapters 2 through 4 will provide you with opportunities to exercise fundamental assembly language programming skills. Chapter 2 laboratory exercise A teaches you how to use the enclosed software editor, assembler, loader, and the 68HC12 built-in monitor commands. Chapter 2 laboratory exercise B is designed for you to write a simple assembly language program using some basic instructions as well as if-then-else programming constructs (branch instructions). This laboratory exercise is later modified to make navigational decisions for the mobile robot based on infrared sensor values. In Chapter 3 laboratory exercise A, you will write a program with two subroutines, applying two parameter passing methods to generate simulated motor speed profiles. Continuing the subroutine theme, Chapter 3 laboratory exercise B will show you how to access built-in D-bug12 I/O subroutines: You will write a program to display the motor speed profiles on a PC screen using appropriate I/O subroutines. The skills learned in this laboratory exercise are later used to debug other programs. Chapter 4 laboratory exercise gives you the first chance to program a fuzzy logic controller using special 68HC12 fuzzy logic instructions. The fuzzy controller uses a set of three IR sensor inputs and computes a navigational decision, simulating robot motions in a maze. By the end of this lab, we expect you to be comfortable with writing, assembling, running, and debugging small assembly language programs. In addition, you will have a library of routines that form the basis of the final robot control program.
The next six exercises in Chapters 5 through 9 are hardware intensive while we continue to reinforce learned and introduce new programming techniques; we extend your ability to program the controller's hardware modules. Chapter 5 laboratory exercise lets you interface a basic external switch with the 68HC 12. The lab can 'also be used to practice implementing a technique called polling. Chapter 6 laboratory exercise teaches students to write a program that incorporates an external interrupt. In addition, you will continue to build your I/O interface skills by controlling the display of an AND671 8-bit Liquid Crystal Display unit with the 68HC12. Chapter 7 laboratory exercises A and B are designed to teach you to program the timer function modules and the I/O ports of the 68HC 12. In these exercises, you will write programs to control the direction and speed of the mobile robot by generating pulse-width-modulated signals and control signals for two DC motors. These lab exercises build on Chapter 5 laboratory exercise and exploit the real-time I/O hardware. Chapter 9 laboratory exercise focuses on the built-in analog-to-digital (ATD) converter. Finally, the last lab exercise found in Chapter 10 gives you an opportunity to combine your accumulated 68HC12 hardware knowledge, assembly language programming skills, and hardware interfacing skills to create a fully operational mobile robot. In this exercise, you will find the rules and information necessary to conduct a mobile robot maze navigation competition, which we hold at the end of our microcontroller course. The competition is held during the last lesson period of the course each year; we invite all students and faculty to have a great time together.
These exercises tie together concepts and skills while reinforcing the objectives of this book. The students at the Academy have thoroughly enjoyed these exercises, and we have received very positive student feedback for using them in our courses. Even if you decide not to actually perform all of the laboratory exercises, you should take time to read the laboratory application sections since you will learn implementation details and find hardware interface techniques that do not appear in other parts of the book.
After the laboratory application section, you will find further reading and reference sections. These sections are for those who wish to pursue the chapter subjects beyond the scope covered in the chapter. Finally, the chapter problems that follow the summary sections are divided into three separate groups based on the estimated time to complete each problem: fundamental problems that should be solved within 10 minutes; advanced problems that should take up to 20 minutes to solve; and challenging problems that should take more than 20 minutes to complete. For instructors, the publisher has an instructor manual that contains answers to all chapter problems and the laboratory exercise programs. For both students and instructors, the textbook website includes links to a set of selected chapter problem solutions and links to a variety of resources. The website is of necessity due to the dynamic nature of the microcontroller industry and our desire to keep up with the latest industry changes.
The 10 chapters are organized in the following manner. Chapter 1 presents a brief computer history, principle components of a computer, embedded computers, and applications of embedded computers. In this chapter, we give an overview of the Motorola 68HC12 16-bit microcontroller: software and hardware. Chapter 2 starts with fundamental assembly language programming skills that include the 68HC 12 instruction set. We show valid addressing modes for the microcontroller and discuss functions of major instructions: arithmetic and logical operations, load and store operations, bit manipulation operations, and branch operations.
Chapter 3 continues to discuss software issues. We present additional assembly language programming skills that include the concept of stack, loops, subroutines, and if-then-else program structures. Chapter 4 explains how to design and implement fuzzy logic controllers. In this chapter, we explain the 68HC 12 instructions associated with fuzzy logic controllers by showing a number of example fuzzy logic controllers.
Chapter 5 is the first chapter where we start to present the hardware components of the 68HC12. In this chapter, we discuss how to set up modes of operation and introduce basic functional hardware components including hardware pin definitions. All I/O ports of the controller and their use are also studied in this chapter. Chapter 6 picks up the important subject of interrupts and resets, explaining how to program the exception handling actions in the forms of interrupt service routines.
Chapter 7 is a detailed description of the timer functions of the 68HC12. We spend some time discussing the output compare, input capture, and pulse accumulator functions. Chapter 8 focuses on the memory system of the 68HC 12, where we describe the different types of memory, the memory map, and how to, expand a memory system. This discussion leads to the topic of bus expansion and timing analysis. Chapter 9 starts with the theories involved in converting analog signals to digital signals. The chapter introduces different ATD conversion techniques and presents the 68HC 12 built-in ATD converter. Finally, Chapter 10 is dedicated to the serial communication hardware features of the 68HC12. Two different systems-a serial communication interface system and a serial peripheral interface system—are presented in detail.
For completeness, you will find five appendixes at the end of the book. Appendix A contains the entire instruction set of the microcontroller in a tabulated format: The table contains the opcode, operand, number of clock cycles for execution, and the effects to the control code register for each instruction. Appendix B lists the control registers of the 68HC 12, showing the default contents and the memory addresses. Appendix C provides background information on number systems, converting numbers among number systems. This appendix also studies binary arithmetic and the concept of 2's complement numbers. Appendix D summarizes fundamental digital logic concepts, including some combinational and sequential logic devices. Appendix E lists software and hardware vendors of products available for the 68HC 12. In this appendix, you will also find information to obtain parts to build your own mobile robot, including the engineering diagrams of the robot.