ME 4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 6

Similar documents
Chapter 7 Central Processor Unit (S08CPUV2)

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

Microcontrollers. Microcontroller

ECE 372 Microcontroller Design Parallel IO Ports - Interrupts. ECE 372 Microcontroller Design Parallel IO Ports - Interrupts

Accumulator and memory instructions 1. Loads, stores, and transfers 2. Arithmetic operations 3. Multiply and divide 4. Logical operations 5. Data test

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

Exam I Review February 2017

538 Lecture Notes Week 5

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

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1

538 Lecture Notes Week 5

Mark II Aiken Relay Calculator

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

ME 6405 Introduction to Mechatronics

PROGRAM CONTROL UNIT (PCU)

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Microcomputer Architecture and Programming

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

Wed. Aug 23 Announcements

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

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


CPU08RM/AD REV 3 8M68HC08M. CPU08 Central Processor Unit. Reference Manual

Week 11 Programmable Interrupt Controller

ME 6405 Introduction to Mechatronics

Module 8: Atmega32 Stack & Subroutine. Stack Pointer Subroutine Call function

MOS 6502 Architecture

1. Internal Architecture of 8085 Microprocessor

ECE 372 Microcontroller Design Basic Assembly Programming. ECE 372 Microcontroller Design Basic Assembly Programming

Module Introduction. PURPOSE: The intent of this module is to explain MCU processing of reset and interrupt exception events.

These three counters can be programmed for either binary or BCD count.

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss

HC11 Instruction Set

Digital IP Cell 8-bit Microcontroller PE80

Microcontrollers and the Freescale/Motorola HC11

Introduction to Mechatronics. Fall Instructor: Professor Charles Ume. Interrupts and Resets

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

EKT222 Miroprocessor Systems Lab 5

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

ME 4447 / ME 6405: Introduction to Mechatronics

Instruction Set Architecture of MIPS Processor

CPU: SOFTWARE ARCHITECTURE INSTRUCTION SET (PART

ME 4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume.

8051 Overview and Instruction Set

DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM

538 Lecture Notes Week 1

EE 3170 Microcontroller Applications

Interrupt is a process where an external device can get the attention of the microprocessor. Interrupts can be classified into two types:

Programming the Motorola MC68HC11 Microcontroller

Chapter 9. Programming Framework

MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes. Summary of HCS12 addressing modes ADDRESSING MODES

Using the stack and the stack pointer

Microcontrollers. Program organization Interrupt driven I/O. EECE 218 Microcontrollers 1

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

Procesory Sygnałowe w aplikacjach przemysłowych

Lecture 10 Exceptions and Interrupts. How are exceptions generated?

8086 INTERNAL ARCHITECTURE

Microprocessors & Interfacing

Lab 9: On-Board Time Generation and Interrupts

Subroutine. Chapter 8

Freescale Semiconductor

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

8085 Interrupts. Lecturer, CSE, AUST

SECTION 5 PROGRAM CONTROL UNIT

Design of Embedded Systems Using 68HC12/11 Microcontrollers

instruction 1 Fri Oct 13 13:05:

8086 Interrupts and Interrupt Responses:

ARM ARCHITECTURE. Contents at a glance:

EE Embedded Systems Design. Lessons Exceptions - Resets and Interrupts

3. The MC6802 MICROPROCESSOR

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

Select the single most appropriate response for each question. Note that none of the above MAY be a VALID ANSWER.

HC 11 Instructions! From Alex Hollowayʼs notes with! many thanks!

ME 4447/ME Microprocessor Control of Manufacturing Systems/ Introduction to Mechatronics. Instructor: Professor Charles Ume

MICROPROCESSOR BASED SYSTEM DESIGN

68HC11 PROGRAMMER'S MODEL

MACHINE CONTROL INSTRUCTIONS: 1. EI

68000 Instruction Set (2) 9/20/6 Lecture 3 - Instruction Set - Al 1

INTERRUPTS in microprocessor systems

real-time kernel documentation

EE 3170 Microcontroller Applications

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

Interrupt and Timer ISRs. Student's name & ID: Partner's name(s) & ID(s): Your Section number & TA's name

Co-processor Math Processor. Richa Upadhyay Prabhu. NMIMS s MPSTME February 9, 2016

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes

Interrupts (I) Lecturer: Sri Notes by Annie Guo. Week8 1

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

Introduction to Embedded Systems. Lab Logistics

Interrupts. by Rahul Patel, Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

Trap Vector Table. Interrupt Vector Table. Operating System and Supervisor Stack. Available for User Programs. Device Register Addresses

Outline. 2.8 Stack. 2.9 Subroutines

appendix a The LC-3 ISA A.1 Overview

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

OSIAC Read OSIAC 5362 posted on the course website

Introduction to Mechatronics

Process Context & Interrupts. New process can mess up information in old process. (i.e. what if they both use the same register?)

1. Internal Architecture of 8085 Microprocessor

Freescale Semiconductor, I SECTION 6 PROGRAM CONTROL UNIT

Transcription:

ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics Instructor: Professor Charles Ume LECTURE 6

MC9S12C Microcontroller 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)

The HCS12 CPU contains: Circuits to process instructions CPU Registers (Note: HCS12 CPU registers are an integral part of the CPU and are not addressed as if they were memory locations)

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 George currently W. available Woodruff location) School of Mechanical Engineering, Georgia Tech Can be used as index register in indexed addressing

HCS12 CPU STACK POINTER An interrupt can be recognized at any time after it is enabled by its local mask, if any, and by the global mask bit in the CCR. Once an interrupt source is recognized, the CPU responds at the completion of the instruction being executed. Interrupt latency varies according to the number of cycles required to complete the current instruction. When the CPU begins to service an interrupt, the contents of the CPU registers are pushed onto the stack in the order shown above (see also p. 2 of the CPU12 reference guide). After the CCR value is stacked, the I bit and the X bit, if XIRQ is pending, are set to inhibit further interrupts. The interrupt vector for the highest priority pending source is fetched and execution continues at the address specified by the vector. At the end of the interrupt service routine, the return-frominterrupt instruction is executed and the saved registers are pulled from the stack in reverse order George so W. that Woodruff normal School program of Mechanical execution Engineering, can resume. Georgia Tech

RTI: At the end of an interrupt service routine, the user writes a Return from Interrupt (RTI) instruction. This causes the CPU registers and the return address to be pulled from the stack, permitting main program execution to continue where it left off with the same values in the CPU registers as before the interrupt occured. 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

JSR or BSR: RTS: Execution of Jump To Subroutine (JSR) and Branch To Subroutine (BSR) instructions causes the contents of the program counter to be pushed onto the stack. At the end of the subroutine, the user writes a Return from Subroutine (RTS) instruction. This causes the return address to be pulled from the stack, permitting execution to continue after the JSR or BSR instruction 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

MC9S12C CONDITION CODE REGISTER S X H I N Z V C 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 ARITHMETIC BITS Reflect results of instruction execution C Carry/Borrow from MSB unsigned arithmetic V 2 s complement overflow indication signed arithmetic 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 Z Zero result N Negative (follows MSBit of result) H Half Carry from bit 3 to bit 4 ADD operations only 7 0 01001111 +00001000 George W. Woodruff School of Mechanical Engineering, 01010111 Georgia Tech H will be set to 1

Example 3 from Lecture 4: - 85 10-90 10 =-175 10 85 10 = 55 16 = 0101 0101 2 1010 1010 = 1 s comp. of 55 16 1010 1011 = 2 s comp. of 55 16 V bit will be set. C bit will be set. 90 10 = 5A 16 = 0101 1010 2 1010 0101 = 1 s comp. of 5A 16 1010 0110 = 2 s comp. of 5A 16 1010 1011 = (2 s comp. of 55 16 ) 1010 0110 = (2 s comp. of 5A 16 ) ------------- 1 0101 0001 = +51 16 = +81 10

QUESTIONS???