68HC11 Notes

Total Page:16

File Type:pdf, Size:1020Kb

68HC11 Notes 68HC11 Notes Version 1.1.1 Oct 30, 2006 Andrew J. Blauch School of Engineering 68HC11 Notes i DISCLAIMER: All software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose. COMPATABILITY: This software has been created and tested using the following development systems: Compiler(s): GCC 68HC11 compiler version 2.2 Processor(s): Motorola 68HC11 E1,E9 operating at 2 MHz E-clock Evaluation Board(s): Axiom Manufacturing CMM11E1-EVBU Axiom Manufacturing CME11E9-EVBU Simulators(s): 68HC11 EVBU Simulator Version 0.6. PySim11 Version 0.5 (developed by Andrew Sterian) Copyright © 2005 School of Engineering Grand Valley State University 68HC11 Notes ii Table of Contents 1 HC11 Microcontroller.................................................................................................1 1.1 Overview.............................................................................................................1 1.2 Memory Maps .....................................................................................................1 2 Communication between PC and EVBU .................................................................... 6 2.1 Overview.............................................................................................................6 2.2 Block Diagram ....................................................................................................7 3 Gcc 68HC11 Compiler................................................................................................8 3.1 Overview.............................................................................................................8 3.2 Library Functions................................................................................................8 3.3 BUFFALO Library Functions............................................................................. 8 3.4 Sample Source Code ...........................................................................................8 4 I/O Registers................................................................................................................9 4.1 Overview.............................................................................................................9 4.2 Memory Mapped I/O Register ............................................................................ 9 5 Parallel I/O ................................................................................................................11 5.1 Overview...........................................................................................................11 5.2 Output Ports.......................................................................................................11 5.3 Input Ports .........................................................................................................11 5.4 Bi-directional Ports ...........................................................................................12 6 I/O Register C Definitions.........................................................................................13 6.1 Overview...........................................................................................................13 6.2 Register Defines................................................................................................13 6.3 Register Usage...................................................................................................13 6.4 Bit Defines.........................................................................................................14 6.5 Bit Usage...........................................................................................................14 7 Clocks and Counters..................................................................................................15 7.1 Overview...........................................................................................................15 7.2 Clocks................................................................................................................15 7.3 Free Running Clock and Counter...................................................................... 16 7.3.1 Overview...................................................................................................16 7.3.2 Sample Source Code ................................................................................. 17 7.4 Real-Time Interrupt Clock ................................................................................ 18 7.5 Software Timing Measurements ....................................................................... 19 7.5.1 Example – Measuring a Pulse Width........................................................20 7.5.2 Example – Generating a Pulse Width .......................................................22 8 Events and Flags........................................................................................................24 8.1 Overview...........................................................................................................24 8.2 Polling Technique .............................................................................................25 8.2.1 Overview...................................................................................................25 8.2.2 Sample Source Code ................................................................................. 25 8.3 Interrupt Technique...........................................................................................26 8.3.1 Overview...................................................................................................26 8.3.2 Sample Source Code ................................................................................. 26 68HC11 Notes iii 8.3.3 Terminology..............................................................................................27 8.3.4 Sequence of Operation.............................................................................. 29 9 Timer Overflow.........................................................................................................30 9.1 Overview...........................................................................................................30 9.2 Sample Source Code .........................................................................................30 10 Real-Time Interrupt...............................................................................................31 10.1 Overview...........................................................................................................31 10.2 Sample Source Code .........................................................................................31 11 Output Compares...................................................................................................32 11.1 Overview...........................................................................................................32 11.2 Output Compare 1.............................................................................................33 11.3 Output Compares 2…5......................................................................................33 11.4 Examples...........................................................................................................34 11.4.1 Generating a Pulse Width (Output Compare 1) ........................................34 11.4.2 Generating a Pulse Width (Output Compare 2) ........................................35 11.4.3 Generating a Pulse Width (Output Compare 1 and 2) ..............................36 11.4.4 Generating a PWM Signal (Output Compare 1 and 2) .............................37 12 Input Captures.......................................................................................................38 12.1 Overview...........................................................................................................38 12.2 Example – Measuring a Pulse Width................................................................ 39 13 Analog-to-Digital Conversion...............................................................................40 13.1 Overview...........................................................................................................40 13.2 Configuration ....................................................................................................41 14 Serial Communication Interface (SCI).................................................................. 42 14.1 Overview...........................................................................................................42 14.2 Baud Rate..........................................................................................................43 14.3 Transmit/Receive Data......................................................................................44 15 Pulse Accumulator ................................................................................................45 15.1 Overview...........................................................................................................45 15.2 Configuration ....................................................................................................45 15.3 Event Counting Mode .......................................................................................46 15.4 Gated Time Accumulation Mode...................................................................... 46 16 Interrupt Requests .................................................................................................47
Recommended publications
  • COSMIC C Cross Compiler for Motorola 68HC11 Family
    COSMIC C Cross Compiler for Motorola 68HC11 Family COSMIC’s C cross compiler, cx6811 for the Motorola 68HC11 family of microcontrollers, incorporates over twenty years of innovative design and development effort. In the field since 1986 and previously sold under the Whitesmiths brand name, cx6811 is reliable, field-tested and incorporates many features to help ensure your embedded 68HC11 design meets and exceeds performance specifications. The C Compiler package for Windows includes: COSMIC integrated development environment (IDEA), optimizing C cross compiler, macro assembler, linker, librarian, object inspector, hex file generator, object format converters, debugging support utilities, run-time libraries and a compiler command driver. The PC compiler package runs under Windows 95/98/ME/NT4/2000 and XP. Complexity of a more generic compiler. You also get header Key Features file support for many of the popular 68HC11 peripherals, so Supports All 68HC11 Family Microcontrollers you can access their memory mapped objects by name either ANSI C Implementation at the C or assembly language levels. Extensions to ANSI for Embedded Systems ANSI / ISO Standard C Global and Processor-Specific Optimizations This implementation conforms with the ANSI and ISO Optimized Function Calling Standard C specifications which helps you protect your C support for Internal EEPROM software investment by aiding code portability and reliability. C support for Direct Page Data C Runtime Support C support for Code Bank Switching C runtime support consists of a subset of the standard ANSI C support for Interrupt Handlers library, and is provided in C source form with the binary Three In-Line Assembly Methods package so you are free to modify library routines to match User-defined Code/Data Program Sections your needs.
    [Show full text]
  • M.Tech –Embedded System Design SEMESTER-I S.NO CODE
    CURRICULUM DEPARTMENT OF ELECTRONICS AND COMMUNICATION BRANCH: M.Tech –Embedded System Design SEMESTER-I S.NO CODE SUBJECT NAME L T P C 1 PMA105 Applied Mathematics for Electronics Engineers 3 1 0 4 2 PED101 Microcontroller Based System Design 3 0 0 3 3 PED102 Embedded Systems 3 0 0 3 4 PAE102 Advanced Digital System Design 3 0 0 3 5 PED1E1 Elective-I 3 0 0 3 6 PED1L1 Embedded System Design Lab-I 0 0 4 2 TOTAL CONTACT HOURS- 20 18 SEMESTER-II 1 PED101 ASIC Design 3 0 0 3 2 PED202 Software Technology for Embedded System 3 0 0 3 3 PED203 Real Time Systems 3 0 0 3 4 PED2E2 Elective-II 3 0 0 3 5 PED2E3 Elective-III 3 0 0 3 6 PED2L2 Embedded System Design Lab -II 0 0 4 2 TOTAL CONTACT HOURS -19 17 SEMESTER-III 1. PED3E4 Elective-IV 3 0 0 3 2. PED3E5 Elective-V 3 0 0 3 3. PED3E6 Elective-VI 3 0 0 3 4. PED3P1 Project work phase-I 0 0 12 6 TOTAL CONTACT HOURS-21 15 SEMESTER-IV 1 PED4P2 Project work phase-II 0 0 24 12 TOTAL CONTACT HOURS-24 12 TOTAL CREDITS FOR THE PROGRAMME-62 LIST OF ELECTIVES 1 PED 001 Design of Embedded System 3 0 0 3 2 PED 002 Embedded Control System 3 0 0 3 3 PED 003 Computer Vision and Image Understanding 3 0 0 3 4 PED 004 Distributed Embedded Computing 3 0 0 3 5 PED 005 Design of Digital Control System 3 0 0 3 6 PED 006 Crypto Analytic Systems 3 0 0 3 7 PED 007 Intelligent Embedded Systems 3 0 0 3 8 PAE 006 Artificial Intelligence and Expert systems 3 0 0 3 9 PED102 Embedded systems 3 0 0 3 10 PED201 ASIC Design 3 0 0 3 11 PVL002 Low power VLSI Design 3 0 0 3 12 PVL003 Analog VLSI Design 3 0 0 3 13 PVL004 VLSI Signal processing
    [Show full text]
  • Experience of Teaching the Pic Microcontrollers
    Session 1520 EXPERIENCE OF TEACHING THE PIC MICROCONTROLLERS Han-Way Huang, Shu-Jen Chen Minnesota State University, Mankato, Minnesota/ DeVry University, Tinley Park, Illinois Abstract This paper reports our experience in teaching the Microchip 8-bit PIC microcontrollers. The 8-bit Motorola 68HC11 microcontroller has been taught extensively in our introductory microprocessor courses and used in many student design projects in the last twelve years. However, the microcontroller market place has changed considerably in the recent years. Motorola stopped new development for the 68HC11 and introduced the 8- bit 68HC908 and the 16-bit HCS12 with the hope that customers will migrate their low- end and high-end applications of the 68HC11 to these microcontrollers, respectively. On the other hand, 8-bit microcontrollers from other vendors also gain significant market share in the last few years. The Microchip 8-bit microcontrollers are among the most popular microcontrollers in use today. In addition to the SPI, USART, timer functions, and A/D converter available in the 68HC11 [6], the PIC microcontrollers from Microchip also provide peripheral functions such as CAN, I2C, and PWM. The controller-area- network (CAN) has been widely used in automotive and process control applications. The Inter-Integrated Circuit (I2C) has been widely used in interfacing peripheral chips to the microcontroller whereas the Pulse Width Modulation (PWM) function has been used extensively in motor control. After considering the change in microcontrollers and the technology evolution, we decided to teach the Microchip 8-bit microcontrollers. 1 Several major issues need to be addressed before a new microcontroller can be taught: textbook, demo boards, and development software and hardware tools.
    [Show full text]
  • Chapter 7. Microcontroller Implementation Consideration
    Chapter 7. Microcontroller Implementation Consideration The overall performance of wheel slip control systems have been limited in the past primarily by the unavailability of low cost, flexible, high-speed electronic technology. The application of high speed digital microcontrollers in anti-lock brake systems allows increased computational capabilities and control performance. In this section, a Motorola 68HC11 microcontroller is evaluated for its suitability for the anti-lock brake control application. This family of microcontroller have been used in FLASH lab, Virginia Tech Center for Transportation Research for evaluation of the automatic highway system concepts and technologies (Kachroo, 1995). Due to the unavailability of the small-size electromagnetic brakes, we have not implemented the electromagnetic brakes and its control system on the small-scale vehicle in FLASH lab. But the digital control algorithm of the possible ABS system is evaluated and features of 68HC11 and alternative families of microcontrollers are evaluated to estimate their suitability for ABS application. For regular friction brakes, modulated brake torque can be calculated and applied to every individual wheel because there is a possibility that different wheels are on different road surfaces. On the other hand, due to the location of electromagnetic brakes, its output torque must be applied to all four wheels in an overall base. The anti-lock brake system discussed in this section takes both situations into consideration. 66 7.1. Motorola 68HC11 Microcontroller (Motorola, 1991) The high-density complementary metal-oxide semiconductor (HCMOS) 68HC11 is an advanced 8-bit microcontroller with sophisticated on-chip peripheral capabilities. The HCMOS technology combines smaller size and higher speeds with the lower power and high noise immunity of CMOS.
    [Show full text]
  • ZAP Cross Debuggers for Motorola Microcontrollers
    ZAP Cross Debuggers for Motorola Microcontrollers ZAP is a family of full-featured C and assembly language source-level debuggers designed to give Motorola embedded microcontroller developers a consistent and productive debugging environment across multiple target processors. Key Features: ZAP Addresses Your Debugging Needs At Each Stage of Your Project Provides a Portable Debugging Environment, ZAP’s multiple configurations are designed to address your debugging needs as your project moves from the design stage Debugger for Each Stage of Your Project, to final integration and test; ZAP configurations supported C and Assembler Source-level Debugging, are: software simulation, target monitor, background debug mode, and in-circuit emulator. Each configuration ANSI C Debugging, gives you essentially the same user interface, thus vastly Array and Structure Explorer, improving your productivity, but each addresses a different stage of your project. Debug Fully Optimized Code, Easy-to-use Graphical User Interface, C and Assembler Source-level Debugging If your source code is written in C, you want to debug at the C Extensive Program Control & Analysis Features, level; if parts of your source code are written in assembly Graphical Performance Analysis, language you want to debug at the assembly language level. ZAP automatically supports both modes without any special Code and Data Coverage, options or settings, so you always see your original source C Level Trace, code in the Source window. If you are debugging at the C level, you can activate a Disassembly window that shows you Robust Script language, the corresponding assembly language code for each line of C source. Automated Testing, Real-Time BDM debugging, ANSI C Debugging Hardware Breakpoint support, ZAP provides point and click access to any C object or construct including enums, bit fields, strings, doubles/floats, FLASH and EEPROM Programming, structures and stack frames.
    [Show full text]
  • The ZEN of BDM
    The ZEN of BDM Craig A. Haller Macraigor Systems Inc. This document may be freely disseminated, electronically or in print, provided its total content is maintained, including the original copyright notice. Introduction You may wonder, why The ZEN of BDM? Easy, BDM (Background Debug Mode) is different from other types of debugging in both implementation and in approach. Once you have a full understanding of how this type of debugging works, the spirit behind it if you will, you can make the most of it. Before we go any further, a note on terminology. “BDM” is Motorola’s term for a method of debugging. It also refers to a hardware port on their microcontroller chips, the “BDM port”. Other chips and other manufacturers use a JTAG port (IBM), a OnCE port (Motorola), an MPSD port (Texas Instruments), etc. (more on these later). The type of debugging we will be discussing is sometimes known as “BDM debugging” even though it may use a JTAG port! For clarity, I will refer to it as “on-chip debugging” or OCD. This will include all the various methods of using resources on the chip that are put there to enable complete software debug and aid in hardware debug. This includes processors from IBM, TI, Analog Devices, Motorola, and others. This paper is an overview of OCD debugging, what it is, and how to use it most effectively. A certain familiarity with debugging is assumed, but novice through expert in microprocessor/microcontroller design and debug will gain much from its reading. Throughout this paper I will try to be as specific as possible when it relates to how different chips implement this type of debugging.
    [Show full text]
  • A New Approach in Microprocessor/Microcontroller Courses/Laboratories Material Design and Development
    2006-386: A NEW APPROACH IN MICROPROCESSOR/MICROCONTROLLER COURSES/LABORATORIES MATERIAL DESIGN AND DEVELOPMENT Steve Hsiung, Old Dominion University STEVE C. HSIUNG Steve Hsiung is an associate professor of electrical engineering technology at Old Dominion University. Prior to his current position, Dr. Hsiung had worked for Maxim Integrated Products, Inc., Seagate Technology, Inc., and Lam Research Corp., all in Silicon Valley, CA. Dr. Hsiung also taught at Utah State University and California University of Pennsylvania. He earned his BS degree from National Kauhsiung Normal University in 1980, MS degrees from University of North Dakota in 1986 and Kansas State University in 1988, and a PhD degree from Iowa State University in 1992. Jeff Willis, Utah State University Jeff Willis Jeff Willis is a Software Engineer developing Mission Planning Software at Hill Air Force Base in Utah. He earned a BS degree in Computer Electronic Technology and a Masters degree in Computer Science from Utah State University. As part of his Master’s Thesis he co-authored two papers on self-configuring, deterministically latent intercommunication architectures for satellite payloads. Page 11.78.1 Page © American Society for Engineering Education, 2006 A New Approach in Microprocessor/Microcontroller Courses/Laboratories Material Design and Development Abstract Courses in microprocessors and microcontrollers are standard parts of the Engineering Technology core curricula. The traditional course material developments include both lectures and associated laboratory exercises. No matter how creative is the curriculum; it is usually budgetary constraints that confine the creativity when developing new curricula. This limits the freedom of the major approach in new course development.
    [Show full text]
  • HCS12 V1.5 Core User Guide Version
    not are currently here Freescale Semiconductor, I..nc. Family indicated Product negligent regardingthedesign ormanufactureofthepart. personal injury or deathagainst associated all claims, with costs, such damages,application, and unintended Buyer expenses, shall or and indemnify reasonable and unauthorized hold attorney use,personal Motorola fees and injury arising even its or out officers, if of, death employees, subsidiaries, such directly maysupport affiliates, or occur. claim and or indirectly, distributors Should alleges any sustain harmless Buyer claim that life, purchase of or Motorola or or authorized use was for for Motorola any products use otherneither for as does application any components it in such convey in unintended which any systemsdesign. or license the intended unauthorized Motorola under failure for does its of patent surgical not the rightsMotorola implant assume nor Motorola reserves into any the product the liability the rights could of body, arising right create others. or out to Motorola a other of products make situation the applications are where changes not application intended designed, without or to intended, use further of notice any to product any or products circuit described herein herein; to improve reliability, function or numbers part DragonBall and Family, lines Product product i.MX Freescale Semiconductor,Inc. Original ReleaseDate:12May2000 For More Information OnThis Product, HCS12 V1.5 Core 2010: BGA-packaged Revised: 17August2000 Go to:www.freescale.com Version 1.2 User Guide September to Motorola, Inc Commission, prior Trade States United the International in sale States or United import the for DOCUMENT NUMBER from order Freescale S12CPU15UG/D an from of Because available 1 not are currently here Freescale Semiconductor, I..nc.
    [Show full text]
  • Using As the Gnu Assembler
    Using as The gnu Assembler Version 2.14.90.0.7 The Free Software Foundation Inc. thanks The Nice Computer Company of Australia for loaning Dean Elsner to write the first (Vax) version of as for Project gnu. The proprietors, management and staff of TNCCA thank FSF for distracting the boss while they got some work done. Dean Elsner, Jay Fenlason & friends Using as Edited by Cygnus Support Copyright c 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". Chapter 1: Overview 1 1 Overview This manual is a user guide to the gnu assembler as. Here is a brief summary of how to invoke as. For details, see Chapter 2 [Command-Line Options], page 15. as [-a[cdhlns][=file]] [-D][{defsym sym=val] [-f][{gstabs][{gstabs+] [{gdwarf2][{help] [-I dir][-J][-K][-L] [{listing-lhs-width=NUM][{listing-lhs-width2=NUM] [{listing-rhs-width=NUM][{listing-cont-lines=NUM] [{keep-locals][-o objfile][-R][{statistics][-v] [-version][{version][-W][{warn][{fatal-warnings] [-w][-x][-Z][{target-help][target-options] [{|files ...] Target Alpha options: [-mcpu] [-mdebug | -no-mdebug] [-relax][-g][-Gsize] [-F][-32addr] Target ARC options: [-marc[5|6|7|8]] [-EB|-EL] Target ARM
    [Show full text]
  • Babu Madhav Institute of Information Technology, 2016 UTU
    Babu Madhav Institute of Information Technology, 2016 UTU Course: 060010901 – Embedded System Unit – 1 Introduction to Embedded System SHORT QUESTIONS: 1. What is an embedded system? 2. State the definition of embedded system given by Wayne Wolf. 3. State the full form of ASIP, ASIC. 4. What is a real time embedded system? 5. List the characteristics of a real time embedded system. 6. What is the purpose of the control unit? 7. What is the purpose of the execution unit? 8. List out the type of processors. 9. Give an example of multi core processor. 10. What is power dissipation? 11. Define non-recurring engineering costs. 12. What is the size of microcontrollers in medium sized embedded systems? LONG QUESTIONS: 1. Define embedded system. State the purpose of embedded system and describe briefly how an embedded system differs from a normal system. 2. Explain in detail the components on a normal pc and an embedded system. 3. State the difference between micro-processors and micro-controllers. Explain in detail the types of micro-processors. 4. List and explain the metrics of embedded system. 5. Describe in detail the challenges that can arise while developing embedded systems. MULTIPLE CHOICE QUESTION: 1. For a real time system, if the time limit for execution of the task is not achieved then select the appropriate result which can occur due to the failure: a. The system will only send alarms and do nothing b. The system's watch dog timer will be reset c. The system will have a high chance of being physically damaged d.
    [Show full text]
  • Lpc210x 'Armee'
    LPC210X ‘ARMEE’ Part 1: an ARM processor survey Tony Dixon In the first instalment of a three-part article we will look at recent developments in 32-bit ARM based microcontrollers, concentrating on those devices that are available, do not cost an arm and a leg or require a major investment in surface mount soldering equipment! 46 elektor electronics- 3/2005 DEVELOPMENT BOARD (1) Overview of the Thumb mode (T) ARM7TDMI core An ARM instruction is 32-bits long. The ARM7TDMI proces- sor supports a second instruction set that has been com- pressed into 16-bits, the Thumb instruction set. Faster execu- A[31:0] tion from 16-bit memory and greater code density can usu- ALE ABE I ally be achieved by using the Thumb instruction set instead n Scan c Control of the ARM instruction set, which makes the ARM7TDMI core Address Register r e m particularly suitable for embedded applications. P e C n DBGRQI However the Thumb mode has two limitations and these are: Address t BREAKPTI b Incrementer e u r DBGACK Thumb code usually uses more instructions for the same job, s ECLK b u nEXEC so ARM code is usually best for maximising the performance Register Bank s ISYNC (31 x 32-bit registers) BL[3:0] of the time-critical code. A (6 status registers) L APE U MCLK The Thumb instruction set does not include some instructions b nWAIT that are needed for exception handling, so the ARM code u nRW s A B MAS[1:0] needs to be used for exception handling.
    [Show full text]
  • Using the GNU Compiler Collection
    Using the GNU Compiler Collection For gcc version 4.2.4 Richard M. Stallman and the GCC Developer Community Published by: GNU Press Website: www.gnupress.org a division of the General: [email protected] Free Software Foundation Orders: [email protected] 51 Franklin Street, Fifth Floor Tel 617-542-5942 Boston, MA 02110-1301 USA Fax 617-542-2652 Last printed October 2003 for GCC 3.3.1. Printed copies are available for $45 each. Copyright c 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being “GNU General Public License” and “Funding Free Software”, the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled “GNU Free Documentation License”. (a) The FSF’s Front-Cover Text is: A GNU Manual (b) The FSF’s Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development. i Short Contents Introduction ............................................. 1 1 Programming Languages Supported by GCC ............... 3 2 Language Standards Supported by GCC .................. 5 3 GCC Command Options ............................... 7 4 C Implementation-defined behavior ..................... 215 5 Extensions to the C Language Family ................... 223 6 Extensions to the C++ Language .....................
    [Show full text]