EE 362 Microprocessor Systems and Interfacing © 1-1 Lecture 1: Introduction to Microprocessor Based Systems Microprocessor Architecture Microprocessor.

Slides:



Advertisements
Similar presentations
Computing Systems Organization
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.
The 8051 Microcontroller and Embedded Systems
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
Programming 68HC11.
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Introduction to 8086 Microprocessor
Processor Function Topic 3.
Processor System Architecture
MICRO PROCESSER The micro processer is a multipurpose programmable, clock driven, register based, electronic integrated device that has computing and decision.
The 68HC11 Microcontroller Minnesota State University, Mankato
H. Huang Transparency No.1-1 The 68HC11 Microcontroller Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.
TK 2633 Microprocessor & Interfacing
Execution of an instruction
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.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
EET 2261 Unit 2 HCS12 Architecture
Computer Architecture
ECE 265 – LECTURE 4 The M68HC11 Address Modes 8/14/ ECE265.
Lecture 18 Last Lecture Today’s Topic Instruction formats
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Revised: Aug 1, ECE 263 Embedded System Design Lesson 1 68HC12 Overview.
ME4447/6405 The George W. Woodruff School of Mechanical Engineering ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
General Concepts of Computer Organization Overview of Microcomputer.
Indira Gandhi National Open University presents. A Video Lecture Course: Computer Platforms.
Lecture 2 Microprocessor Architecture Image from:
ME4447/6405 The George W. Woodruff School of Mechanical Engineering ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics.
 Introduction to Micro processor Introduction to Micro processor  Microprocessor instruction and opcodes Microprocessor instruction and opcodes  Mnemonics.
Introduction to Microprocessors
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Addressing Modes MTT CPU08 Core Motorola CPU08 ADDRESSING MODES.
EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong.
1 Introduction to Microcontroller Microcontroller Fundamentals & 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.
Execution Architecture MTT CPU08 Core M CPU08 INTRODUCTION.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Embedded Systems Lecture 5 January 25 th, 2016.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Internal Programming Architecture or Model
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.
Addressing Modes in Microprocessors
ECE 3430 – Intro to Microcomputer Systems
Introduction to 8086 Microprocessor
ECE 3430 – Intro to Microcomputer Systems
The 8051 Microcontroller and Embedded Systems
Microprocessor and Assembly Language
Microcomputer Programming
William Stallings Computer Organization and Architecture 8th Edition
Number Representations and Basic Processor Architecture
ME4447/6405 Microprocessor Control of Manufacturing Systems and
The CPU12 Microprocessor Core
ECEG-3202 Computer Architecture and Organization
MARIE: An Introduction to a Simple Computer
CPU has 6 special locations called registers
Chapter 4: Computer Architecture
8051 ASSEMBLY LANGUAGE PROGRAMMING
A Top-Level View Of Computer Function And Interconnection
Information Representation: Machine Instructions
Computer Architecture Assembly Language
Computer Operation 6/22/2019.
Computer Architecture and System Programming Laboratory
COMPUTER ARCHITECTURE
Presentation transcript:

EE 362 Microprocessor Systems and Interfacing © 1-1 Lecture 1: Introduction to Microprocessor Based Systems Microprocessor Architecture Microprocessor Operation CPU, Memory, I/O, and Buses Machine Code DataTransfer Instructions Addressing Modes

EE 362 Microprocessor Systems and Interfacing © 1-2 Von Neumann Architecture Memory Input and Output (I/O) Central Processing Unit (CPU)  arithmetic and logic unit (ALU)  control unit CPU I/O Memory

EE 362 Microprocessor Systems and Interfacing © 1-3 Buses Communication is needed among components. Wires connecting the components are called buses. There are three types of buses:  address,  data, and  control. CPUMemoryI/O Address bus Data bus Control bus

EE 362 Microprocessor Systems and Interfacing © 1-4 Buses: 68HC12 Address Bus Communication is needed among components. Wires connecting the components are called buses. There are three types of buses:  address, (16 bits)  data,  control. CPUMemoryI/O Address bus Data bus Control bus

EE 362 Microprocessor Systems and Interfacing © 1-5 Buses: 68HC12 Data Bus Communication is needed among components. Wires connecting the components are called buses. There are three types of buses:  address,  data, (8 or 16 bits)  control. CPUMemoryI/O Address bus Data bus Control bus

EE 362 Microprocessor Systems and Interfacing © 1-6 Buses: 68HC12 Control Bus Communication is needed among components. Wires connecting the components are called buses. There are three types of buses:  address,  data,  control. CPUMemoryI/O Address bus Control bus Data bus

EE 362 Microprocessor Systems and Interfacing © 1-7 Computer Operation The computer executes instructions consisting of opcodes and operands, which are stored sequentially in memory as binary numbers. The program counter points to the next instruction to be executed. Operands may be data or addresses or address increments.

EE 362 Microprocessor Systems and Interfacing © 1-8 Computer Operation: 68HC12 The computer executes instructions consisting of opcodes and operands, which are stored sequentially in memory as binary numbers. The 68HC12 instruction set contains 209 instructions. The program counter (PC register) points to the next instruction to be executed. The 68HC12 address bus is 16 bits wide so its PC register is a 16-bit register. Operands may contain data or addresses. The number of bytes of operands depends on the instruction.

EE 362 Microprocessor Systems and Interfacing © 1-9 Exercise 1.1 What are the three basic components of a microcomputer? What are the three buses in a microcomputer? What is the functionality of each bus? The address bus of the 68HC12 has 16 bits. How many different memory addresses can the 68HC12 access? How many address lines are necessary to address one kilobyte of memory? How many address lines are necessary to address one megabyte memory?

EE 362 Microprocessor Systems and Interfacing © HC12 Registers Accumulators A,B and D Index registers IX and IY Program counter PC Stack pointer SP Flag (Condition Code) register CCR Record the size of the following registers: A _______ B ________ D ________ IX _______ IY ________ PC _______ SP ______ Flag ______

EE 362 Microprocessor Systems and Interfacing © HC12 Registers Accumulators A,B and D Index registers X and Y Program counter PC Stack pointer SP Flag (Condition Code) register CCR Record the size of the following registers: A 8 bits B 8 bits D 16 bits X 16 bits Y16 bits PC 16 bits SP 16 bits CCR 8 bits

EE 362 Microprocessor Systems and Interfacing © HC12 “Model”

EE 362 Microprocessor Systems and Interfacing © 1-13 Review: Machine Code What information does the op-code provide? machine instruction to be executed Give an example of an operand. address or data

EE 362 Microprocessor Systems and Interfacing © 1-14 Data Transfer Instructions: LDAA LDAA Load Accumulator A LDAA#$32;LDAA is the mnemonic for the ;machine code in computer memory, which is 86;opcode 32;operand After the execution of this instruction, what is the value in accumulator A in hex, binary and decimal? Answer _________ ________ _____________ Write the instruction to load a 2F hex into accumulator A. Answer ______________________ 1-24

EE 362 Microprocessor Systems and Interfacing © 1-15 Data Transfer Instructions: LDAA LDAA Load Accumulator A LDAA#$32;LDAA is the mnemonic for the ;machine code in computer memory, which is 86;opcode 32;operand After the execution of this instruction, what is the value in accumulator A in hex, binary and decimal? Answer 32 hex, binary, 50 decimal Write the instruction to load a 2F hex into accumulator A. Answer LDAA #$2F 1-24

EE 362 Microprocessor Systems and Interfacing © 1-16 Data Transfer Instructions: LDAB LDAB (Load Accumulator B) Example: LDAB #24 ;assembly instruction Stored as: Location Contents E000C6(Opcode) E00118(Operand)  What is the value in B after instruction execution?  How many memory accesses are required to execute this instruction (assuming the data bus is 16-bit)?  Why are the location addresses 16-bit numbers? 1-26

EE 362 Microprocessor Systems and Interfacing © 1-17 Data Transfer Instructions: LDAB LDAB (Load Accumulator B) Example: LDAB #24 ;assembly instruction Stored as: Location Contents E000C6(Opcode) E00118(Operand)  What is the value in B after execution of the instruction? 18 hex  How many memory accesses are required to execute this instruction (assuming the data bus is 16-bit)? 1  Why are the location addresses 16-bit numbers? Address bus is 16-bit. 1-26

EE 362 Microprocessor Systems and Interfacing © 1-18 Review: Data Transfer Instructions Write the assembly instruction to load the decimal value 22 into register B. Answer _________ Write the machine code for the above instruction. 1-27

EE 362 Microprocessor Systems and Interfacing © 1-19 Review: Data Transfer Instructions Write the assembly instruction to load the decimal value 22 into register B. Answer LDAB #22 or LDAB #$16 Write the machine code for the above instruction. C

EE 362 Microprocessor Systems and Interfacing © 1-20 Data Transfer Instructions: LDD LDD (Load Double Accumulator D) Example: LDD #$1024 ;assembly instruction Stored as: Location Contents E000CC(Opcode) E00110(Operand, first byte) E00224(Operand, second byte) What values are in A, B and D? Answers______, _______, ______ Why are two bytes of operands required? How many byte-sized memory accesses are required to execute the instruction? Answer ________ 1-28

EE 362 Microprocessor Systems and Interfacing © 1-21 Data Transfer Instructions: LDD LDD (Load Double Accumulator D) Example: LDD #$1024 ;assembly instruction Stored as: Location Contents E000CC(Opcode) E00110(Operand, first byte) E00224(Operand, second byte) What values are in A, B and D? 10, 24, and 1024 hex, respectively Why are two bytes of operands required? D is 16-bit How many byte-sized memory accesses are required to execute the instruction? 3 for code, 2 for data 1-28

EE 362 Microprocessor Systems and Interfacing © 1-22 Data Transfer Instructions: LDAA Example: LDAA$1006 Stored as: Location Contents E00086 E00110 E00206 What type of addressing is used? Where does the value to be loaded into A come from? ________ What happens if LDAA #$1006 is attempted? ______ 1-35

EE 362 Microprocessor Systems and Interfacing © 1-23 Data Transfer Instructions: LDAA Example: LDAA$1006 Stored as: Location Contents E00086 E00110 E00206 What type of addressing is used? extended Where does the value to be loaded into A come from? memory location 1006 hex What happens if LDAA #$1006 is attempted? error 1-35

EE 362 Microprocessor Systems and Interfacing © 1-24 The addressing mode determines how the CPU gets the data it needs to execute an instruction. Types of addressing modes: Examples:  Inherent ABA, DECA, INX  Immediate LDAA #30, LDD #$16  Direct LDD $3f, STX $3f  Extended LDAB $3425  Relative BEQ $10  Indexed ADDA $10,X  Indexed indirect LDAA [D,X] Addressing Modes

EE 362 Microprocessor Systems and Interfacing © 1-25 Lecture 2: Development Environment Assembler Assembly Language Fields Constants and Expressions Assembler Directives Linker Development Environment Macros

EE 362 Microprocessor Systems and Interfacing © 1-26 Assembler Directives Examples Offset:dc.b6 Count:dc.b$45 Scales:dc.b6,8,30 Msg:dc.b“FEED PART” How many bytes total are reserved above? _________ Assuming Offset starts at $800, what is the value of “Msg” _________ 2-11

EE 362 Microprocessor Systems and Interfacing © 1-27 Assembler Directives Examples Offset:dc.b6 Count:dc.b$45 Scales:dc.b6,8,30 Msg:dc.b“FEED PART” How many bytes total are reserved above? = 14 Assuming Offset starts at $800, what is the value of “Msg” 0x = 0x

EE 362 Microprocessor Systems and Interfacing © 1-28 Assembler Directives: dc.w dc.w reserves memory space for (16-bit) word constants and specifies their initial values. Mixa:dc.w$2000 Mixb:dc.w$23 Mixc:dc.w$45, 90, $3000 lddMixb How many bytes of memory are reserved? ____ Assuming Mixa is located at $800, what is the value of Mixb in the instruction above? _______ What value is loaded into D in the above instruction? ________ 2-12

EE 362 Microprocessor Systems and Interfacing © 1-29 Assembler Directives: dc.w dc.w reserves memory space for (16-bit) word constants and specifies their initial values. Mixa:dc.w$2000 Mixb:dc.w$23 Mixc:dc.w$45, 90, $3000 lddMixb How many bytes of memory are reserved? 2+2+3(2) = 10 Assuming Mixa is located at $800, what is the value of Mixb in the instruction above? 0x0802 What value is loaded into D in the above instruction? $

EE 362 Microprocessor Systems and Interfacing © 1-30 Exercise Write the assembler directives to define a constant, named FirstOffset, equal to and to reserve an uninitialized byte-sized memory location named “Offset”. Write the executable assembly code that will read this constant (load the value into a register) and store the value at location “Offset”. 2-15

EE 362 Microprocessor Systems and Interfacing © 1-31 Assembler Directive: offset 2-15

EE 362 Microprocessor Systems and Interfacing © 1-32 Exercise Write the assembler directives to define a constant, named FirstOffset, equal to and to reserve an uninitialized byte-sized memory location named “Offset”. FirstOffset: equ 25 aOffset: ds.b1 Write the executable assembly code that will read this constant (load the value into a register) and store the value at location “Offset”. LDAA#FirstOffset STAAaOffset 2-15

EE 362 Microprocessor Systems and Interfacing © 1-33 Exercise (cont) Show addresses in hex for the following. How many bytes total are reserved? _______ decimal. org0 _____augend:dc.b6,2 _____addend:equ5 _____results:ds.b5 _____store:dc.w$3A,20,$3F2 _____aoffset:dc.b

EE 362 Microprocessor Systems and Interfacing © 1-34 Exercise (cont) Show addresses in hex for the following. How many bytes total are reserved? 14 decimal. org0 0x0000augend:dc.b6,2 addend:equ5 0x0002results:ds.b5 0x0007store:dc.w$3A,20,$3F2 0x000Daoffset:dc.b

EE 362 Microprocessor Systems and Interfacing © 1-35 Exercise (cont) Considering the previous assembler directives, what are the operands for the following instructions? What values are loaded into the accumulator(s)? Assume the absolute addresses are 0x0800 plus the offset addresses. Answer in hex. Operand LDAAaugend_______ LDAA#addend_______ LDDstore_______ LDD#store _______ LDAAaugend+1_______ 2-17

EE 362 Microprocessor Systems and Interfacing © 1-36 Exercise (cont) Assembly Code Machine Code LDAAaugendB LDAA#addend86 05 LDDstoreFC LDD#storeCC LDAAaugend+1B

EE 362 Microprocessor Systems and Interfacing © 1-37 Exercise (cont) Assembly Code Register Contents After Execution A B LDAAaugend 06?? LDAA#addend 05?? LDDstore 00 3A LDD#store LDAAaugend

EE 362 Microprocessor Systems and Interfacing © 1-38 Linker Command File Exercises Define a code segment called code1 that starts at address address 0x900 and has max size $200 bytes. Define a data segment called const1 that starts immediately after the segment called.text. 2-32

EE 362 Microprocessor Systems and Interfacing © 1-39 Linker Command File Exercises Define a code segment called code1 that starts at address address 0x900 and has max size $200 bytes. +seg code1 -b 0x900 -m 0x200 Define a data segment called const1 that starts immediately after the segment called.text. +seg const1 -a.text 2-32

EE 362 Microprocessor Systems and Interfacing © 1-40 Miscellaneous $202 = decimal $abcd = % 5 kBytes = bytes decimal If we have 2 Kbytes of memory starting at 0x2000, what is the address of the last byte? Bit0:equ1 Bit2:equ 1 << 2 ldaa #Bit2 ; place ___ in A ldab #~Bit2 ; place ___ in B

EE 362 Microprocessor Systems and Interfacing © 1-41 Miscellaneous $202 = 2*16^2+0*16^1+2*16^0 = 514 decimal $abcd = % kBytes = 5*1024 = 5120 bytes decimal If we have 2 Kbytes of memory starting at 0x2000, what is the address of the last byte? 0x27ff (2048=$800) Bit0:equ1 Bit2:equ 1 << 2 ldaa #Bit2 ; place $04 in A ldab #~Bit2 ; place $FB in B