Computer Organization I. Lecture 28: Architecture of M68HC11

Similar documents
Microcontrollers. Microcontroller

Introduction to 6811 Programming

Introduction to Microcontrollers

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University

LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz

538 Lecture Notes Week 1

Introduction to the 9S12 Microcontroller

Getting Started with the HCS12 IDE

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Introduction to Microcontrollers III

MC68HC12 Parallel I/O

Introduction to Microcontrollers III

CS/ECE 5780/6780: Embedded System Design

Microcomputer Architecture and Programming

Computer Science and Engineering 331. Midterm Examination #1. Fall Name: Solutions S.S.#:

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7

Introduction to Computers - Chapter 4

Lecture 6 Assembly Programming: Branch & Iteration

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

MC9S12 Address Space

ECE 3610 MICROPROCESSING SYSTEMS


Introduction to Programming

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING. Principles of Computer Operation

ECE 30 Introduction to Computer Engineering

Lecture 5 Assembly Programming: Arithmetic

Microprocessors and Microcontrollers Prof. Santanu Chattopadhyay Department of E & EC Engineering Indian Institute of Technology, Kharagpur

AN1745. Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas. Introduction

ECE331 Handout 3- ASM Instructions, Address Modes and Directives

Serial Communication Through an Asynchronous FIFO Buffer

Lab 8: Debugging Embedded Devices and Software

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System

Mark II Aiken Relay Calculator

Microprocessors/Microcontrollers

Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12. EE383: Introduction to Embedded Systems University of Kentucky

Using the stack and the stack pointer

Menu Computer Organization Programming Model for the an example microprocessors (the G-CPU & Motorola 68HC11) Assembly Programming Look into my...

Roberto Muscedere Images and Text Portions 2003 Prentice Hall 1

Programming the Motorola MC68HC11 Microcontroller

Immediate vs. Extended mode: Immediate values are marked with a # symbol. They also are different instructions when assembled.

Cross Assembly and Program Development

538 Lecture Notes Week 5

EE 3170 Microcontroller Applications

ECE372 CodeWarrior Simulator Andreou/Michaelides

538 Lecture Notes Week 5

Introduction to CPU architecture using the M6800 microprocessor

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

Chapter 04: Instruction Sets and the Processor organizations. Lesson 08: Processor Instructions - Part 1

Fredrick M. Cady. Assembly and С Programming forthefreescalehcs12 Microcontroller. шт.

Chapter 7 Central Processor Unit (S08CPUV2)

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

LAB 1: MC68000 CPU PROGRAMMING DATA TRANSFER INSTRUCTIONS

Computer Architecture Prof. Mainak Chaudhuri Department of Computer Science & Engineering Indian Institute of Technology, Kanpur

EE 3170 Microcontroller Applications

POTENTIOMETER. Revision Class. Instructor / Professor LICENSE

EE319 K Lecture 7. Address mode review Assembler, Debugging Psuedo ops 16 bit timer finite state machines. University of Texas ECE

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013

COE538 Lecture Notes Week 3 (Week of Sept 17, 2012)

ECE232: Hardware Organization and Design

ME 6405 Introduction to Mechatronics

EEL 4744C: Microprocessor Applications. Lecture 7. Part 2. M68HC12 Interrupt. Dr. Tao Li 1

Computer Organisation CS303

Homework 12 Solutions

MC68705P3 Bootstrap ROM

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ).

ECE 367 -Experiment #1 Fall 2012

INTRODUCTION OF MICROPROCESSOR& INTERFACING DEVICES Introduction to Microprocessor Evolutions of Microprocessor

Macro Assembler. Defini3on from h6p://

EE 3170 Microcontroller Applications

MICROPROCESSOR BASED SYSTEM DESIGN

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 2. PIC and Programming

(Refer Slide Time: 1:40)

MC68705U3 Bootstrap ROM

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Introduction to Microcontrollers II

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

DSP Platforms Lab (AD-SHARC) Session 05

Introduction to Assembler Language Programming

10. INPUT/OUTPUT STRUCTURES

S12CPUV2. Reference Manual HCS12. Microcontrollers. S12CPUV2/D Rev. 0 7/2003 MOTOROLA.COM/SEMICONDUCTORS

HC11 Instruction Set

MC68HC05J1A/D Rev. 1.0 HC 5 MC68HC05J1A MC68HCL05J1A MC68HSC05J1A. HCMOS Microcontroller Units TECHNICAL DATA

AN Kbyte Addressing with the M68HC11. Overview

Programming Microcontroller Assembly and C

Micro II and Embedded Systems

N bit is set if result of operation in negative (MSB = 1) Z bit is set if result of operation is zero (All bits = 0)

3. The MC6802 MICROPROCESSOR

Lecture #3 Microcontroller Instruction Set Embedded System Engineering Philip Koopman Wednesday, 20-Jan-2015

Teaching and Curriculum Development of Microprocessor Classes

EE 3170 Microcontroller Applications

8051 Overview and Instruction Set

Lecture 7 Assembly Programming: Shift & Logical

Inf2C - Computer Systems Lecture Processor Design Single Cycle

CS61C - Machine Structures. Lecture 6 - Instruction Representation. September 15, 2000 David Patterson.

Design of Embedded Systems Using 68HC12/11 Microcontrollers

Lecture-55 System Interface:

Transcription:

Computer Organization I Lecture 28: Architecture of M68HC11

Overview Architecture of HC11 Microprocessor Format of HC11 Assembly Code

Objectives To understand the simplified architecture of HC11 To know the standard format of HC11 assembly code

The Simplified HC11 Architecture Diagram some of the ports have arrows running in both directions (e.g. ports A, C, and D), these ports are bidirectional, meaning that they can be used for either input or output.

The Simplified HC11 Diagram - Ports Each port contains eight bits, making it equivalent to one byte of data. Each bit is mapped to a physical pin on the microprocessor package. This means that when data is written to a particular output port, that data appears as voltage levels on the real pins connected to that port. In this way, the 68HC11 can interface with external devices.

The Simplified HC11 Diagram - Ports Port A This is a digital, bidirectional port that implements special timer and counter circuitry. The timers can be used to generate waveforms of varying frequencies; the counters can be used to count certain events (like rising edges of signal) on the input lines. Port B This is a digital port that may be used for output only Port C This is a digital, bidirectional port. Its default state is for input Port D This is a bidirectional port dedicated to serial input and output functions. Port E This is the analog input port.

The Simplified HC11 Diagram - Port B Port B This is a digital port that may be used for output only Port B is controlled by a register located at address $1004. In the 68HC11 literature, this register is named PORTB. The following two instructions write the value %00010000 at the Port B register location, $1004. LDAA #%00010000 STAA $1004 * store A at "PORTB" location A stands for the value of accumulator

The Simplified HC11 Diagram - Port C Port C This is a digital, bidirectional port. Its default state is for input Port C is controlled by reading the value of the location $1003. any input signals that are present on the Port C lines are "latched" into Port C during the read operation. The Port C register is referred to by the name PORTC. The following code sample reads the digital inputs from Port C and branches to the routine called AllZero if the input from Port C is zero. LDAA $1003 * load Port C value into A (Accumulator) BEQ AllZero * if zero, branch

Microprocessors store their programs and data in memory. Memory is organized as a contiguous string of addresses, or locations. Each memory location contains eight bits of data. The entire amount of memory that a processor can access is called its address space. The 68HC11 has an address space of 65,536 memory locations. corresponding exactly to 16 bits of address information. Memory Map of HC11 Processor

Memory Map

Registers of the HC11 Processor Microprocessor works by moving data from memory into its internal registers for processing, then stores the results in memory. There are two different types of registers: (1) accumulators, used to perform most arithmetic operations, e.g. addition, subtraction, or logical, bit operations (2) index registers, used to point at data that is located in memory.

Data Type of the HC11 Processor In assembly language, a programmer is given only "the bits" and must build more complex data types with subroutine libraries while most high-level languages (like C) support many data types, such as integers, floating point numbers, strings, and arrays. The 68HC11 has two data types: 8-bit numbers and 16-bit numbers. This means that there are instructions that process numbers of length eight bits, and there are instructions that process numbers of length sixteen bits An eight-bit number can have 256 different values ( 2 8 =256 ), and a sixteen-bit number can have 65536 different values ( 2 16 =65536 ).

Programming the HC11 Processor when a microprocessor runs a program, it advances sequentially through memory, fetching and executing one instruction at a time the PC ((program counter)) register keeps track of the address of the instruction currently being executed. the microprocessor automatically advances the PC to the next instruction after it is finished executing the current one. instructions may be one, two, three, or four bytes long, depending on what their function is.

Structure of a HC11 Assembly File HC11 Assembly files are broken into several different sections Data -- Located at the first of the assembly file. (1) contains all variables and data storage locations that can be modified while your code is executing; (2) contains all user defined constants. Code (1) contains all executable code for your application (2) execution should NEVER leave the code section, this would have unspecified results

Structure of a HC11 Assembly File

Formatting the HC11 Assembly Code HC11 Assembly file formatted with tabs and carriage returns Each assembly instruction is located on its own line. Each line is broken into separate columns Label<tab>Instruction <tab> Operand <tab> Comment Label is not required, but the tab MUST BE INCLUDED Comments and Labels discussed further later Formatting is of UTMOST importance. Forgetting to include the first tab will cause assembler errors!! Formatting makes your assembly much easier to debug.

Comments Comments are used just like comments in Java or C MAKE SURE YOU COMMENT EVERYTHING!! Comments can either be placed one tab over from the instruction or operand OR: Denote a comment using a * Example: Label<tab>Instruction<tab>Opcode<tab>Operand<tab>This is a comment -OR- * THIS IS A SINGLE LINE COMMENT anything that comes after a * on a line will be ignored

Why Comments in Assembly Commenting every line in a high level language can be annoying but Not so in an assembly program! Assembly programs are hard to read, so inline comments assist the reader in deciphering the meaning of code

Labels Labels are used as a reference to a memory address, instead of using an exact address. Labels are used when performing branch instructions to specify the branch/jump/subroutine target Example Loop LDAA #$FF * load A with 255 DECA * decrement A register BNE Loop * branch to Loop if not zero

ORG specifies the location for the assembler to deposit the machine code (or object code). For example: ORG $F800 * start of EEPROM ORG

Summary Simplified Architecture of HC11 General Format of HC11 Assembly Code

Thank you Q & A