H. Huang Transparency No.1-1 The 68HC11 Microcontroller Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.

Slides:



Advertisements
Similar presentations
H. Huang Transparency No.1-1 The HCS12/MC9S12 Microcontroller Copyright © 2010 Delmar Cengage Learning HCS12 Instruction Examples The LOAD and STORE Instructions.
Advertisements

EET 2261 Unit 3 Assembly Language; Load, Store, & Move Instructions  Read Almy, Chapters 5 and 6.  Homework #3 and Lab #3 due next week.  Quiz next.
Programming 68HC11.
EE 362 Microprocessor Systems and Interfacing © 1-1 Lecture 1: Introduction to Microprocessor Based Systems Microprocessor Architecture Microprocessor.
Processor Function Topic 3.
EET 2261 Unit 5 Tables; Decision Trees & Logic Instructions
The 68HC11 Microcontroller Minnesota State University, Mankato
TK 2633 Microprocessor & Interfacing
LC-3 Computer LC-3 Instructions
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 1 Introduction to HCS12/MC9S12. Computer Hardware Organization What is a Computer? Software Hardware.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
1 ECE 372 – Microcontroller Design Basic Assembly Programming for(j=0; j
8051 ASSEMBLY LANGUAGE PROGRAMMING
EET 2261 Unit 2 HCS12 Architecture
ECE 265 – LECTURE 4 The M68HC11 Address Modes 8/14/ ECE265.
© 2010 Kettering University, All rights reserved..
UNDERSTANDING ASSEMBLY LANGUAGE.
The M68HC11 Basic Instruction Set Basic Arithmetic Instructions
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Module 10 Adapted By and Prepared James Tan © 2001.
Physics 413 Chapter 1: Introduction to the HCS 12 Microcontroller.
ME4447/6405 The George W. Woodruff School of Mechanical Engineering ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
ECE 265 – LECTURE 8 The M68HC11 Basic Instruction Set The remaining instructions 10/20/ ECE265.
© 2010 Kettering University, All rights reserved..
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
ME4447/6405 The George W. Woodruff School of Mechanical Engineering ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Machine Language ELEC 330 Digital Systems Engineering Dr. Ron Hayne.
1 ECE 372 – Microcontroller Design Assembly Programming HCS12 Assembly Programming Addressing Modes Stack Operations Subroutines.
EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong.
Ch.2 Intro. To Assembly Language Programming
Ch.2 Intro. To Assembly Language Programming From Introduction to Embedded Systems: Interfacing to the Freescale 9s12 by Valvano, published by CENGAGE.
1 Microcontroller Fundamentals & Programming Addressing Modes.
Microcontroller Fundamentals & Programming Arithmetic Instructions.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
Embedded Systems Lecture 5 January 25 th, 2016.
EE345 Chapter 2 Lecture 3 April 4. Quiz every Wednesday 1 quiz = 1% extra credit five quizzes before midterm  5% for midterm. five quizzes before final.
EE345 Chapter 2 Lecture 3 April Instruction and addressing modes 1.Extended Addressing 2.Direct Addressing 3.Inherent Addressing 4.Immediate Addressing.
Displacement (Indexed) Stack
EET 2261 Unit 3 Assembly Language; Load, Store, & Move Instructions
Addressing Modes in Microprocessors
HC11 Programming.
Assembly Language Programming of 8085
ECE 3430 – Intro to Microcomputer Systems
Microprocessor T. Y. B. Sc..
ECE 3430 – Intro to Microcomputer Systems
William Stallings Computer Organization and Architecture 8th Edition
Computer Science 210 Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
ME4447/6405 Microprocessor Control of Manufacturing Systems and
Computer Science 210 Computer Organization
ECE 3430 – Intro to Microcomputer Systems
MARIE: An Introduction to a Simple Computer
ECEG-3202 Computer Architecture and Organization
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Introduction to Micro Controllers & Embedded System Design
MARIE: An Introduction to a Simple Computer
Physics 413 Chapter 2.
CPU has 6 special locations called registers
Chapter 4: Computer Architecture
Instruction execution and ALU
Computer Architecture and System Programming Laboratory
Presentation transcript:

H. Huang Transparency No.1-1 The 68HC11 Microcontroller Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller

H. Huang Transparency No.1-2 The 68HC11 Microcontroller

H. Huang Transparency No.1-3 The 68HC11 Microcontroller

H. Huang Transparency No.1-4 The 68HC11 Microcontroller Memory Addressing Memory consists of addressable locations A memory location has 2 components: address and contents Data transfer between CPU and memory involves address bus and data bus CPU memory address bus lines data bus lines Figure 1.5 Data transfer between CPU and memory address contents

H. Huang Transparency No.1-5 The 68HC11 Microcontroller 68HC11 addressing modes Table 1.1 Prefix for number representation BasePrefix binary octal decimal hexadecimal nothing* $ *Note: Some assemblers use &

H. Huang Transparency No.1-6 The 68HC11 Microcontroller ADDRESSING MODES Operands needed in an instruction are specified by one of the 6 addressing modes Immediate mode Direct mode Extended mode Indexed mode Inherent mode Relative mode

H. Huang Transparency No.1-7 The 68HC11 Microcontroller Immediate mode The actual operand is contained in the byte or bytes immediately following the instruction opcode LDAA #22 ADDA LDD #1000 Note that the (#) is a critical assembler directive!

H. Huang Transparency No.1-8 The 68HC11 Microcontroller Direct mode A one-byte value is used as the address of a memory operand (located in on-chip SRAM) ADDA $10 SUBA $20 LDD $30 Extended mode A two-byte value is used as the address of a memory operand LDAA $1000 LDX $1000 ADDD $1030 Indexed mode The sum of one of the index registers and an 8-bit value is used as the address of a memory operand ADDA 10,X LDAA 3,Y

H. Huang Transparency No.1-9 The 68HC11 Microcontroller Inherent mode -Operands are implied by the instruction -No address information is needed ABA INCB INX Relative mode -Used in branch instructions to specify the branch target -Specified using either a 16-bit value or a label (preferred)... BEQ there ADDA #10... thereDECB

H. Huang Transparency No.1-10 The 68HC11 Microcontroller A Sample of 68HC11 Instructions The LOAD instructions A group of instructions that place a value or copy the contents of a memory location (or locations) into a register LDAA Load Accumulator A LDAB Load Accumulator B LDD Load Double Accumulator D LDX Load Index Register X LDY Load Index Register Y LDS Load Stack Pointer can be immediate, direct, extended, or index mode Examples LDAA $10 LDX #$1000

H. Huang Transparency No.1-11 The 68HC11 Microcontroller The ADD instruction A group of instructions perform addition operation ABA ABX ABY ADDA ADDB ADDD ADCA ADCB is specified using immediate, direct, extended, or index mode Examples. ADDA #10 ADDA $20 ADDD $30

H. Huang Transparency No.1-12 The 68HC11 Microcontroller The SUB instruction A group of instructions that perform the subtract operation SBA SUBA SUBB SUBD SBCA ; A  [A] - - C flag SBCB ; A  [B] - - C flag can be immediate, direct, extended, or index mode Examples SUBA #10 SUBA $10 SUBA 0,X SUBD 10,X

H. Huang Transparency No.1-13 The 68HC11 Microcontroller The STORE instruction A group of instructions that store the contents of a register into a memory location or memory locations STAA STAB STD STX STY STS can be direct, extended, or index mode Examples: STAA $20 STAA 10,X STD $10 STD $1000 STD 0,X

H. Huang Transparency No.1-14 The 68HC11 Microcontroller The 68HC11 Machine Code A 68HC11 instruction consists of 1 to 2 bytes of opcode and 0 to 3 bytes of operand information Examples Machine instructions Assembly instruction (in hex format) LDAA # D STAA $ ADDA $02 9B 02 STAA $ INY18 08

H. Huang Transparency No.1-15 The 68HC11 Microcontroller Decoding machine language instructions Procedure Step 1 Compare the first one or two bytes with the opcode table to identify the corresponding assembly mnemonic and format. Step 2 Identify the operand bytes after the opcode field. Step 3 Write down the corresponding assembly instruction. Step 4 Repeat step 1 to 3 until the machine code file is exhausted. A sample of machine codes and assembly instruction format machine code assembly instruction format 01NOP 86LDAA IMM 96LDAA DIR C6LDAB IMM D6LDAB DIR CCLDD IMM DCLDD DIR 8BADDA IMM 9BADDA DIR CBADDB IMM

H. Huang Transparency No.1-16 The 68HC11 Microcontroller DBADDB DIR C3ADDD IMM D3ADDD DIR 97STAA DIR D7STAB DIR DDSTD DIR machine codeassembly instruction format Example. Disassemble the following machine code to its corresponding assembly instructions B Solution: The disassembly process starts from the leftmost byte. We next look up the machine code table to see which instruction it corresponds to. Instruction 1. Step 1. The first byte 96 corresponds to the instruction LDAA DIR. Step 2. The second byte, 30, is the direct address. Step 3. Therefore, the first instruction is LDAA $30.

H. Huang Transparency No.1-17 The 68HC11 Microcontroller Instruction 2. Step 1. The third byte (8B) corresponds to the instruction ADDA IMM. Step 2. The immediate value is 07. Step 3. Therefore, the second instruction is ADDA $07. Instruction 3. Step 1. The fifth byte (97) corresponds to the instruction STAA DIR. Step 2. The DIR address is the next byte 30. Step 3. Therefore, the third instruction is STAA $30. Instruction 4. Step 1. The seventh byte (96) corresponds to the instruction LDAA DIR. Step 2. The DIR value is the next byte 31. Step 3. Therefore, the four instruction is LDAA $31.

H. Huang Transparency No.1-18 The 68HC11 Microcontroller machine code assembly instruction format 01NOP 86LDAA IMM 96LDAA DIR C6LDAB IMM D6LDAB DIR CCLDD IMM DCLDD DIR 8BADDA IMM 9BADDA DIR CBADDB IMM DBADDB DIR C3ADDD IMM D3ADDD DIR 97STAA DIR D7STAB DIR DDSTD DIR

H. Huang Transparency No.1-19 The 68HC11 Microcontroller The 68HC11 Instruction Execution Cycle - Perform a sequence of read cycles to fetch instruction opcode byte and address information. - Optionally perform read cycle(s) required to fetch the memory operand. -Perform the operation specified by the opcode. -Optionally write back the result to a register or a memory location. -Consider the following 3 instructions Assembly instructionMemory locationOpcode LDAA $2000$C000B ADAA $3000$C003BB STAA $2000$C006B

H. Huang Transparency No.1-20 The 68HC11 Microcontroller Instruction LDAA $2000 Step 1. Place the value in PC on the address bus with a request to read the contents of that location. Step 2. The opcode byte $B6 at $C000 is returned to the CPU and PC is incremented by 1.

H. Huang Transparency No.1-21 The 68HC11 Microcontroller Step 3. CPU performs two read cycles to obtain the extended address $2000 from locations $C001 and $C002. At the end the value of PC is incremented to $C003

H. Huang Transparency No.1-22 The 68HC11 Microcontroller Figure 1.12 Instruction 1--execution read cycle Memory contents $19 $37 CPU... $2000 Address bus Data bus $19 $2000 Address $3000 Step 4. The CPU performs another read to get the contents of the memory location at $2000, which is $19. The value $19 will be loaded into accumulator A.