Introduction to Embedded Microcomputer Systems: Motorola 6811 and 6812 Simulation,

Jonathan W. Valvano, Thomson-Engineering Publishers, ISBN 0-534-39177-x

The two readme.exe movies are not on the CD, to get them, go to http://academic.cengage.com/
search isbn = 053439177X
click on Student Companion Site
click on Student Downloads
 

Click here for more recent readme movies

Preface
Embedded computer systems are electronic systems that include a microcomputer to perform a specific dedicated application. The computer is hidden inside these products. Embedded systems are ubiquitous. Every week millions of tiny computer chips come pouring out of factories like Motorola, Intel, Philips, and Mitsubishi finding their way into our everyday products. Our global economy, our production of food, our transportation systems, our military defense, our communication systems, and even our quality of life depend on the efficiency and effectiveness of these embedded systems. Engineers play a major role in all phases of this effort: planning, design, analysis, manufacturing, and marketing. This book provides an introduction to embedded systems, including both hardware interfacing and software fundamentals.
Although real applications require actual physical devices to perform desired operations, the approach taken in this book is to develop hardware and software using simulation. The simulator that accompanies this book is called Test EXecute And Simulate (TExaS). This simulator, like all good applications, has an easy learning curve. Although a professional engineer could use TExaS to develop actual embedded systems, its intended use is as an educational tool. It provides a self-contained approach to writing and testing microcomputer hardware and software. It is unique from other simulators in two aspects. If enabled, the simulator shows activity internal to the chip like the read/write address/data bus, the instruction register and effective address register. In this way, you can use TExaS to learn how a computer works. In particular, you can experience the architecture by observing activity inside the microcomputer. On the other end of the spectrum, you have the ability to connect external hardware devices like switches, LEDs, LCDs, keyboards, serial port devices, motors, and analog circuits. You can use logic probes, voltmeters, oscilloscopes and logic analyzers to observe the external hardware. The simulator supports most of the I/O port functions of the Motorola 6811 and 6812 microcomputers, like interrupts, serial port, input capture, output compare, key wakeup, STRA, timer overflow, real-time interrupt, and the ADC. With these features, you can use TExaS to learn microcomputer programming and interfacing. You can develop software either in assembly language using the TExaS assembler, or program in C using a cross-compiler. The freeware ICC11 compiler is included on the CD that accompanies this book. It can be found in the ICC11 folder as part of the TExaS installation. TExaS can import object code from most cross-compilers for the 6811 or 6812. So, combined with a commercial-grade cross-compiler, you will have a powerful hardware/software development system.

Objectives of the book
The overall objective of this book is to present basic computer architecture, teach assembly language programming, and present an introduction to interfacing. This book develops these topics around the TExaS simulator. Although TExaS can be used to develop hardware/software embedded systems on the Motorola 6805, 6808, 6811 or 6812, this book focuses on just the 6811 and 6812. The book describes both the general processes and the specific details involved in microcomputer simulation. In particular, detailed case studies are used to illustrate fundamental concepts, and laboratory assignments are provided. The specific objectives of this book include the understanding of:
• the basic procedures involved in hardware/software simulation,
• how information is represented on the computer,
• the basic arithmetic and logical operations performed by the computer,
• the fundamental architecture of the 6811 and 6812 microcomputers,
• the input/output operations,
• assembly language programming: considering both function and style,
• simple hardware interfaces, including
switches, keyboards, LEDs, LCDs, DC motors, DACs, ADCs, and serial ports,
• debugging techniques
breakpoints, ScanPoints, profiles, monitors, voltmeters, oscilloscopes, logic analyzers.
• program structures with a comparison between assembly and C,
• modular programming,
• elementary data structures,
• interrupt programming.

This book does not discuss in detail every 6811/6812 instruction, but rather presents some of the instructions and uses them to discuss the general issues of representation of information, computer architecture, developing embedded system software. In contrast, the Motorola programming reference guides do give details of each assembly instruction. In a similar manner, the Motorola microcomputer technical reference manuals explain all the I/O port functions. In other words, you will use this book along with the manuals from Motorola. Two short manuals are included as appendices and many of the Motorola manuals are available as pdf documents on the CD. It might be better to order physical documents from Motorola's literature center, or to download the latest version from the Motorola web site.

Prerequisites
This book is intended for an introductory laboratory course in microcomputer programming and/or microcomputer interfacing. It is assumed the student has some knowledge of C programming, digital logic and analog circuits. In fact, simple C programs are used throughout the book to assist the development of assembly language programs. Fortunately, located on the CD that accompanies this book, there is a reference called Developing Embedded Software in C using ICC11/ICC12 written as an HTML document. This reference is a complete C programming book, written specifically for embedded software on the 6811 and/or 6812. For more advanced information about microcomputer interfacing and programming, see Embedded Microcomputer Systems: Real Time Interfacing by Jonathan W. Valvano, published by Brooks/Cole, copyright (c) 2000.

Special features
This book incorporates a number of special features specifically designed for the beginning engineer. An effective educational approach is to learn by doing. The first action component of the book is the use of checkpoints, which can be found throughout the book. A checkpoint is a short question meant as an immediate feedback mechanism for the reader to evaluate his or her level of comprehension. Checkpoints should be performed while reading the chapter. Answers to checkpoints are given in Appendix 9. The second action component of the book is the tutorial. They are also included at the end of each chapter. The purpose of the tutorial is to immediately reinforce the specific topics of that chapter. Each tutorial includes a sequence of actions (specific things for the reader to do) and a list of questions. Tutorials are meant to be performed without supervision, and should be performed after reading the chapter, but before attempting the labs or homework. Answers to the tutorial questions are also included in Appendix 9. The most important action components of the book are the laboratory assignments included at the end of the chapters. Each laboratory solution can be built and tested using the TExaS simulator. Only by performing the laboratory assignments can the reader truly assimilate the hardware and software concepts introduced in this book. Laboratories are meant to be performed under the supervision of an instructor, and involve the classic engineering processes of design, construction, debugging, and evaluation. Homework problems can also be found at the end of each chapter. These problems are less detailed, and are intended to evaluate the reader’s understanding of specific topics introduced in the chapter.
Sections labeled with a * are advanced topics and can be skipped without loss of continuity. Chapter 9 contains a set of software style guidelines.

How to teach a course based on this book
The first step in the design of any course is to create a list of educational objectives. This book along with the two HTML documents on the CD could be used to teach introductory microcomputer programming and/or microcomputer interfacing. Specific educational objectives that are supported in this book are microcomputer architecture, number systems, assembly language programming, I/O device interfacing, subroutines, local variables, and interrupts. Chapters 1 through 8 could be used in this introductory assembly language programming class. This book can also be used for a more advanced course in microcomputer interfacing, using Chapters 6 through 12. In this more advanced class, assignments could be developed in assembly or in C.
The next important decision to make is the organization of the student laboratory. The importance of practical "hands on" experience is critical in the educational process. Unfortunately, space staff and money constraints force all of us to compromise, doing the best we can. On the other hand, the role of simulation is becoming increasingly important as the race for technological superiority is run with shorter and shorter design cycle times. Consequently, it is important to expose our students to the all phases of engineering design including problem specification, conceptualization, simulation, construction, and analysis. Universities that adopt this book will be allowed to download, rewrite, print out and distribute the laboratory assignments presented in this book.
The first laboratory configuration is based entirely on material included with book, and involves no extra costs. Each book comes with a CD that allows the student to install the TExaS application on a single computer. Students, for the most part, work off campus and come to a TA station for help or lab grading. In this configuration you can either develop software in assembly using the TExaS assembler or develop C programs using the demo version of ICC11. The simulator itself becomes the platform on which the lab assignments are developed and tested. For examples of this ICC11/TExaS combination run some of the demonstration examples in the ICC11 subdirectory of the TExaS application. Some laboratories are intended to be developed in assembly language using the TExaS simulator, while others could be performed in either assembly or C.
The second configuration performs simulation of C programs. In this laboratory setup, a standard PC-compatible laboratory room can be used. TExaS and a professional cross-compiler (like ImageCraft ICC11 or ICC12) are installed, and the students perform laboratory assignments in this central facility. Other than the professional cross-compiler, no additional setup costs are required. The advantage of this approach is that professional-style C software can be developed with only a modest expense. Laboratories can be adapted to be used with C instead of assembly language.
A third laboratory configuration combines simulation with some real microcomputer experiments. Labs can be first simulated, then run on a real microcomputer. Alternatively, some labs can be simulated, while other labs are developed on a real microcomputer. Students can work off campus on the simulation aspects of the labs. In this configuration, you can either develop software in assembly using the TExaS assembler or develop C programs using a cross-compiler. Object files generated by TExaS can be programmed into a real microcomputer, and debugged using standard debugging systems. This is the more expensive than the other two configurations because actual microcomputer hardware and debugging systems are required.

What's on the CD?
1) The Readme.exe is a 15-minute introductory tutorial about developing assembly language programs on TExaS. This animation does not need to be copied to your hard drive; you can simply watch the movie by double-clicking the Readme.exe that is on the CD itself.
2) The Readme2.exe is a 10-minute introductory tutorial about developing C language programs on TExaS. Again, this animation does not need to be copied to your hard drive to be viewed.
3) TExaS is a complete editor, assembler, and simulator for the 6805, 6808, 6811 and 6812 microcomputers. It simulates external hardware, I/O ports, interrupts, memory, and program execution. It is intended as a learning tool for embedded systems. This software is not freeware, but the purchase of the book entitles the owner to install one copy of the program. The texas directory contains the installer, which you must execute before using the application. Once installed TExaS creates these nine subdirectories
• MC6811 6811 assembly examples
• MC6812 6812 assembly examples
• ICC11 6811 C examples using the freeware compiler
• ICC11A 6811 C examples using the professional ICC11 compiler
• ICC12 6812 C examples using the professional ICC12 compiler
The subdirectory ICC11 also contains the ImageCraft Freeware compiler. You can run the existing ICC11A and ICC12 examples, but to edit and recompile you will need the commercial C compiler. For TExaS upgrades look at: users.ece.utexas.edu/~valvano
4) The PDF directory contains many data sheets in Adobe's pdf format. This information does not need to be copied to your hard drive; you can simply read the data sheets from the CD itself. In particular there are data sheets for microcomputers, digital logic, memory chips, op amps, ADCs, DACs, timer chips and interface chips.
5) The assmbly directory contains a short HTML document describing how to program in assembly for embedded systems using the TExaS application. This document does not need to be copied to your hard drive; you can simply read the HTML document from the CD itself. The TExaS application itself also contains a lot of information about assembly language development as part of its on-line help.
6) The embed directory contains an HTML document describing how to program in C for embedded systems using ImageCraft's ICC11/ICC12. This document does not need to be copied to your hard drive; you can simply read the HTML document from the CD itself.
7) The tutorial directory on the CD contains files needed to perform the tutorials in this book. To perform the tutorials, you will copy either the Mc6811T or Mc6812T subdirectory to a hard drive. The movies in this directory can be viewed directly from the CD itself.


Universities that adopt this textbook have the following teaching resources available to them:
1) Lecture note slides (Word documents) for a course based on this book. For pdf versions of these slides, see
 http://users.ece.utexas.edu/~valvano/EE319K/ 
2) lots of microcomputer programs, see
ICC12 C programs http://users.ece.utexas.edu/~valvano/programs/  and
Metrowerks C programs http://users.ece.utexas.edu/~valvano/metrowerks/   and
Many 6811/6812 assembly/C programs included with the TExaS simulator installation
3) TExaS simulator, see
http://users.ece.utexas.edu/~valvano/sim.html  
4) Free web-based homework service, see
 http://users.ece.utexas.edu/~valvano/homework/  and
 https://hw.utexas.edu/overview.html 

Go to Home Page

Last updated April 19, 2008 Send comments to: Jonathan W. Valvano .