George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.

Slides:



Advertisements
Similar presentations
Microprocessors.
Advertisements

Processor Function Topic 3.
Processor System Architecture
68HC11 Polling and Interrupts
EET 2261 Unit 9 Interrupts  Read Almy, Chapters 17 – 19.  Homework #9 and Lab #9 due next week.  Quiz next week.
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
EET 2261 Unit 2 HCS12 Architecture
Rabel Talpur:12BME#025.  40-pin chip  Developed by Motorola in 1975  16 address lines and 8 data lines  Used only +5V.
Embedded Systems 7763B Mt Druitt College of TAFE
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
created by :Gaurav Shrivastava
ME4447/6405 The George W. Woodruff School of Mechanical Engineering ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics.
MICROPROCESSOR INPUT/OUTPUT
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
ECE 265 – LECTURE 8 The M68HC11 Basic Instruction Set The remaining instructions 10/20/ ECE265.
Interrupts and reset operations. Overview  Introduction to interrupts – What are they – How are they used  68HC11 interrupt mechanisms – Types of interrupts.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Microprocessor. Interrupts The processor has 5 interrupts. CALL instruction (3 byte instruction). The processor calls the subroutine, address of which.
ME4447/6405 The George W. Woodruff School of Mechanical Engineering ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
1 Interrupts, Resets Today: First Hour: Interrupts –Section 5.2 of Huang’s Textbook –In-class Activity #1 Second Hour: More Interrupts Section 5.2 of Huang’s.
ECE 265 – LECTURE 5 The M68HC11 Basic Instruction Set 12/8/ ECE265.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Addressing Modes MTT CPU08 Core Motorola CPU08 ADDRESSING MODES.
1 ECE 372 – Microcontroller Design Assembly Programming HCS12 Assembly Programming Addressing Modes Stack Operations Subroutines.
1 Introduction to Microcontroller Microcontroller Fundamentals & Programming.
Advanced Assembly Language Programming
Execution Architecture MTT CPU08 Core M CPU08 INTRODUCTION.
MICRO-CONTROLLER MOTOROLA HCS12 Interrupts Mechatronics Department Faculty of Engineering Ain Shams University.
Resets & Interrupts MTT CPU08 Core Motorola CPU08 RESETS & INTERRUPTS.
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Subroutines and Stacks. Stack The stack is a special area in memory used by the CPU to store register information or general data information during program.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Block diagram of a computer system Basic components of a computer system using block diagrams: Cpu Memory Input and output unit Evolution of microprocessor.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
1 ECE 372 – Microcontroller Design Basic Assembly Programming for(j=0; j
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
ELE22MIC Lecture 6 Continuation of Lecture 5 Instruction Set Overview, Part 4 –HC-COM - Lab notes –Stack Pointer, Push, Pull Call/return Data –Conditional.
Unit Microprocessor.
COURSE OUTCOMES OF Microprocessor and programming
ECE 3430 – Intro to Microcomputer Systems
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
Introduction to microprocessor (Continued) Unit 1 Lecture 2
ECE 3430 – Intro to Microcomputer Systems
Interrupts In 8085 and 8086.
Introduction of microprocessor
ME4447/6405 Microprocessor Control of Manufacturing Systems and
Interrupts Interrupt is a process where an external device can get the attention of the microprocessor. The process starts from the I/O device The process.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Interrupts.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Interrupts 1/18/2019.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
8051 ASSEMBLY LANGUAGE PROGRAMMING
Register sets The register section/array consists completely of circuitry used to temporarily store data or program codes until they are sent to the.
Computer Operation 6/22/2019.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Presentation transcript:

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics Instructor: Professor Charles Ume Lecture #8

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Read: MC9S12C32 Device User Guide V01.14 HCS12 Microcontrollers: MC9S12C128 Rev 01.23

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Covered in Lecture 5: Quick Introduction to Microcontroller Subsystems Microcontroller Registers Microcontroller Modes (Single chip, Extended, etc..) EVBU Memory Maps Covered in this section: HCS12 CPU (Note: the Central Processing Unit (CPU) is the “core” of the microcontroller where instructions are executed) MC9S12C Microcontroller

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 (Note: HCS12 CPU registers are an integral part of the CPU and are not addressed as if they were memory locations) The HCS12 CPU contains: Circuits to process instructions CPU Registers

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Accumulators A, B, and D A & B are: –8-bit registers –Can be used for 8-bit math operations ( Note: This is why A & B are called “Accumulators”) –Can also be used for 8-bit binary logic, comparisons, memory transfers, etc… –Can be used for accumulator offsets in indexed addressing D is: –16-bit register –Cannot be used when A or B is in use –Can be used for 16-bit math in conjunction with Index X & Y –Can be used for 16-bit memory transfers, comparisons, etc.. –Can be used for accumulator offsets in indexed addressing Index Registers X & Y Can be used for 16-bit math with Accumulator D Mainly used for addressing memory in Indexed mode (Note: Indexed addressing mode will be covered in a later section) Program Counter (PC) Contains the address of the next instruction to be executed Can be used as index register in indexed addressing Stack Pointer (SP) Contains the address of the last stack location used (1 greater than the currently available location) Can be used as index register in indexed addressing

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example Problem 1 Example : Write a program to add the numbers and Solution ORG $1000 LDAA#$0A*Puts number $0A in acc. A LDAB #$0B*Puts number $0B in acc. B ABA*Adds acc. B to acc. A STAA $00*Stores results in address $00 SWI*Software interrupt END LDAB and LDAA use immediate addressing mode STAA uses direct addressing mode

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405  Stack is a region of RAM which may be used for temporary data storage during: programming or interrupt.  For Expanded Mode (MON12 in use): Stack location is $0E5F-$0E00  Upon reset, the stack pointer must be initialized.  MON12 loads stack pointer with $0E5F and has reserved memory locations $0E5E-$0E00 for the stack, creating 95 bytes of storage.  When MON12 is not in use, the user must load stack pointer with appropriate address using LDS instruction: LDS #$0E5F (or appropriate memory location)  User must determine stack location and ensure it does not conflict with other resources? HCS12 CPU STACK AND STACK POINTER

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405  Interrupt can be recognized at any time if it is enabled by its:  Local mask, if any (e.g. in Timers, SCI, ADC and etc), and  Global mask bit in CCR (e.g. I and X bits).  Once interrupt source is recognized, CPU responds at completion of instruction being executed.  Content of CPU Registers are pushed into Stack.  Interrupt latency varies according to number of cycles required to complete current instruction.  After CCR value is stacked, interrupt vector for highest priority pending source is fetched  I bit and X bit, if XIRQ is pending, are set to inhibit further interrupts.  Execution continues at address specified in corresponding interrupt vector.  At end of interrupt service routine, return-from-interrupt (RTI) instruction is executed. HCS12 CPU STACK POINTER

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 LEGEND: RTN = ADDRESS OF NEXT INSTRUCTION IN MAIN ROGRAM TO BE EXECUTED UPON RETURN FROM SUBROUTINE RTN HI = MOST SIGNIFICANT BYTE OF RETURN ADDRESS RTN LO = LEAST SIGNIFICANT BYTE OF RETURN ADDRESS X,Y HI = MOST SIGNIFICANT BYTE OF X OR Y INDEX REGISTER X,Y LO = LEAST SIGNIFICANT BYTE OF X OR Y INDEX REGISTER RTI:  Contents of CPU Registers saved in Stack are pulled from Stack in reverse order and put back in their respective registers.  Normal program execution will resume at address contained in Program Counter Register Stack Register will contain #$0E5E

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 RTS: JSR or BSR:  Execution of Jump To Subroutine (JSR) and Branch To Subroutine (BSR) instructions causes:  Contents of Program Counter (PC) to be pushed onto Stack.  Subroutine is executed  Last instruction code executed in subroutine is Return from Subroutine (RTS) instruction.  RTS causes return address to be pulled from Stack and put in Program Counter  CPU uses address in PC to determine where it should continue program execution in main program after JSR or BSR instruction.

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 MC9S12C CONDITION CODE REGISTER MASKING BITS S – Disables STOP instruction when set. X – Masks XIRQ Request when set. set by hardware reset, cleared by software set by unmasked XIRQ See page 116 of Technical Data I – Masks interrupt request from all IRQ level sources (both external and internal) when set. set by unmasked I level request or unmasked XIRQ See page 116 of Technical Data ARITHMETIC BITS Reflect results of instruction execution C – Carry/Borrow from MSB unsigned arithmetic: #$4A - #$CE V – 2’s complement overflow indication signed arithmetic Z – Zero result N – Negative (follows MSB of result) H – Half Carry from bit 3 to bit 4 ADD operations only: H will be set to 1 SXHINZVC

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 Example 3 from Lecture 4: = = = = 1’s comp. of = 2’s comp. of = 5A 16 = = 1’s comp. of 5A = 2’s comp. of 5A = (2’s comp. of ) = (2’s comp. of 5A 16 ) = = V bit will be set. C bit will be set.

George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 QUESTIONS???