A First Look at Microprocessors

Similar documents
A First Look at Microprocessors

A First Look at Microprocessors

A First Look at Microprocessors


8086 Interrupts and Interrupt Responses:

A 3-SPEED STEPPER MOTOR

Description of the Simulator

Chapter 09. Programming in Assembly

Chapter 7 Central Processor Unit (S08CPUV2)

Roberto Muscedere Images and Text Portions 2003 Prentice Hall 1

COSC 243. Input / Output. Lecture 13 Input/Output. COSC 243 (Computer Architecture)

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

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

Microcontrollers. Microcontroller

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

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

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

BHARATHIDASAN ENGINEERING COLLEGE. III Year / V Semester / EEE MICROPROCESSORS AND MICROCONTROLLERS (R-2013)

For more notes of DAE

Moodle WILLINGDON COLLEGE SANGLI (B. SC.-II) Digital Electronics

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

8051 Microcontroller

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss

Microprocessors & Interfacing

Computer and Hardware Architecture I. Benny Thörnberg Associate Professor in Electronics

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

Computers and Microprocessors. Lecture 34 PHYS3360/AEP3630

E3940 Microprocessor Systems Laboratory. Introduction to the Z80

address ALU the operation opcode ACC Acc memory address

Embedded Applications. COMP595EA Lecture03 Hardware Architecture

ARM Cortex-A9 ARM v7-a. A programmer s perspective Part 2

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

May the Schwartz be with you!

Digital IP Cell 8-bit Microcontroller PE80

CHAPTER 11 INTERRUPTS PROGRAMMING

In this lecture, we will look at how storage (or memory) works with processor in a computer system. This is in preparation for the next lecture, in

CS 101, Mock Computer Architecture

8051 Microcontrollers

MICROPROCESSOR MEMORY ORGANIZATION

Lab 9: On-Board Time Generation and Interrupts

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Chapter Operation Pinout Operation 35

Module 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1

INTERRUPTS in microprocessor systems

ARM Cortex-A9 ARM v7-a. A programmer s perspective Part1

Basic Components of Digital Computer

Lecture (01) Introducing Embedded Systems and the Microcontrollers By: Dr. Ahmed ElShafee

Microprocessors/Microcontrollers

Embedded Systems Design (630414) Lecture 1 Introduction to Embedded Systems Prof. Kasim M. Al-Aubidy Computer Eng. Dept.

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

ET2640 Microprocessors

Microprocessor and Microcontroller question bank. 1 Distinguish between microprocessor and microcontroller.

Fixed-Point Math and Other Optimizations

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

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

EE 308: Microcontrollers

8051 Microcontroller Interrupts

Digital System Design Using Verilog. - Processing Unit Design

EE 308: Microcontrollers

MOXSYN. General Description. Features. Symbol

EB-51 Low-Cost Emulator

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

Reset, Interrupts, Exceptions, and Break ECE 3534

FIFTH SEMESTER B.TECH DEGREE EXAMINATION MODEL TEST QUESTION PAPER, NOVEMBER CS 305: Microprocessor and Microcontrollers PART A

Microcomputer Architecture and Programming

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

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

Question Bank Microprocessor and Microcontroller

Week 11 Programmable Interrupt Controller

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

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

BASIC INTERFACING CONCEPTS

Microprocessor Systems

1. What is Microprocessor? Give the power supply & clock frequency of 8085?

Have difficulty identifying any products Not incorporating embedded processor FPGA or CPLD In one form or another

Microcontroller Not just a case of you say tomarto and I say tomayto

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

SOLUTION MANUAL FOR THE 8051 MICROCONTROLLER 4TH EDITION BY MACKENZIE AND PHAN

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

University of Florida EEL 4744 Spring 2014 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 1 April Apr-14 9:03 AM

PC Interrupt Structure and 8259 DMA Controllers

Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto

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

Microcontroller basics

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

8051 Overview and Instruction Set

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

CS401 - Computer Architecture and Assembly Language Programming Glossary By

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text

MICROPROCESSOR B.Tech. th ECE

3.1 Description of Microprocessor. 3.2 History of Microprocessor

ECE 571 Advanced Microprocessor-Based Design Lecture 3


QUESTION BANK CS2252 MICROPROCESSOR AND MICROCONTROLLERS

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

ELEG3924 Microprocessor

Practical Malware Analysis

real-time kernel documentation

Transcription:

A First Look at Microprocessors using the The General Prototype Computer (GPC) model Part 4

Ports CPU Ecosystem All CPUs need RAM, ROM, a clock source and reset circuit, and power. Power Supply 1 Vio Vcore PHY ISP/Debug Port 2 Depending on the application, CPUs will most typically have other connected devices as well. These other devices will use one of the serial busses, or a parallel bus, depending on the device itself. RAM ROM 3 0 1 2 3 4 5 6 7 8 9 A B C D E F Input devices Audio/Speaker Sensors Indicators Displays Oscillator (clock) Connectors Reset Generator CPU Ports Always Needed Application Specific

As transistors have become less expensive and smaller, many peripherals that were once separate IC s have migrated to the processor IC. Examples include audio and video processors, bus controllers, timers, media interfaces, etc. Many peripherals remain in separate ICs. Memory circuits are as large (or larger) than the processor there is simply no room for them. Same for high-end graphics processors. Some circuits require specialized manufacturing that is not compatible with the processes used to make processors for example, physical front-end chips (called PHYs) that drive cables like Ethernet or USB. Same for radios like Wifi and Bluetooth. So, most processor systems will have a central microprocessor surrounded by a collection of support IC s that are application dependent. A desktop computer will have (at least) a microprocessor, external memory, a clock source, a radio, and an Ethernet driver. Expansion slots allow other peripherals to be added later. An embedded microprocessor in an appliance might have a collection of on-board sensors and motor drivers particular to the application.

Processors typically use clocks that are in the 10MHz to 200MHz range. Many applications require a processor to interface with much slower signals from I/O devices, like humanactuated buttons or switches. Consider a CPU with a 40MHz clock (25ns period); every 25ns, an instruction can be executed. A fast typist can enter about four key strokes per second one every 250ms. This $6 processor can execute 10 million instructions between keystrokes!

Ports Instead of waiting around, for slow peripherals to produce or consume data, the CPU does other functions. Then when a port needs service, it asserts an interrupt request signal. Power Supply RAM 1 2 3 Vio Vcore I/O devices PHY ISP/Debug Port Displays Audio/Speaker 0 1 2 3 4 5 6 7 8 9 A B C D E F Input devices ROM Sensors Indicators Oscillator (clock) Connectors Reset Generator CPU Ports Always Needed Application Specific

Interrupts are exceptional event signals that interrupt the normal flow of CPU operations. Interrupts typically arise from peripheral devices that need service, or else data may be lost. Examples include a keyboard, a disc, various ports, and a power fail. The CPU may or may not respond to the interrupt request, depending on the interrupt priority. Memory Ports Program Memory If the interrupt is taken, the CPU immediately stops its regular execution and runs the interrupt service routine (ISR). Operand_ Operand_ Instr_ Instr_ Parallel Serial Etc Int1 Int2 Memory Controller Instructions Port Controller Interrupt Controller IntN CPUClk Controller Operand DST_ WR_Clk Port_ Immd_Op SRC1_Sel SRC2_Sel ALU_Func ALU_Status Interrupts Mux1 OP1 Sel Status Central Processing Unit ALU Out D_IN Registers WR_Add Clk Rn R1 R0 Mux2 OP2

When the ISR is complete, regular execution begins exactly where it left off. Since the main program was unexpectedly interrupted, the ISR must enable the main program to continue operating as if nothing happened. The ISR must save all registers, and optionally adjust priorities, before doing anything else. This essential context switch preserves the operating state of the processor, so it can resume execution right where it left off, as if the interrupt never occurred. Memory Ports Program Memory Operand_ Operand_ Instr_ Instr_ Parallel Serial Etc Int1 Int2 Memory Controller Instructions Port Controller Interrupt Controller IntN CPUClk Controller Operand DST_ WR_Clk Port_ Immd_Op SRC1_Sel SRC2_Sel ALU_Func ALU_Status Interrupts Mux1 OP1 Sel Status ALU Out D_IN Registers WR_Add Clk Rn R1 R0 Mux2 OP2 Central Processing Unit

CPUs have interrupt controllers that receive exceptional event signals, and redirect the CPU as required. Different interrupts are assigned a priority level by the programmer. Events that require quicker service are typically assigned higher priority. The CPU can set the interrupt level that it will respond to. Memory Ports Program Memory Operand_ Operand_ Instr_ Instr_ Parallel Serial Etc Memory Controller Instructions Port Controller Operand DST_ WR_Clk Port_ Interrupts D_IN Registers WR_Add Clk Rn R1 R0 Int1 Int2 Interrupt Controller Immd_Op SRC1_Sel SRC2_Sel Mux1 OP1 Mux2 OP2 IntN ALU_Func Sel ALU CPUClk ALU_Status Status Controller Out Central Processing Unit

Interrupts are a much more efficient way to deal with infrequent events, rather than polling (i.e., constantly checking signal status). Memory Operand_ Operand_ Operand Memory Controller Interrupts Ports Program Memory Instr_ Instr_ Parallel Serial Etc Instructions Port Controller DST_ WR_Clk Port_ D_IN Registers WR_Add Clk Rn R1 R0 Int1 Int2 Interrupt Controller Immd_Op SRC1_Sel SRC2_Sel Mux1 OP1 Mux2 OP2 IntN ALU_Func Sel ALU CPUClk ALU_Status Status Controller Out Central Processing Unit

Stack R13 (SP) Saving and restoring context ( context switching ) is a common occurrence, so a standard method has emerged. A FIFO stack data structure is used. Registers are pushed onto the stack on entry to the ISR, and popped on exit. The stack is simply an area of memory. A stack pointer (register) always points at the most recent entry. R4: 0101000101010010101001010 R5: 0101000001010010100001010 R6: 1110101110100001011001010 R7: 0000000000011010000100001 Main Memory 1GByte Heap Stack Program 3FFF FFFF Top of Stack 2000 FFFF The Stack can be located anywhere in memory, and be any size. Typically, it is located where it won t interfere with RAM or dynamically allocated RAM (the heap). Several Kbytes are usually reserved to allow nesting of subroutines 0000 0000

Events, Exceptions, and Interrupts Events are expected signal transitions generated by peripherals that happen during the normal course of operations. For example, a peripheral device may have data ready, or an internal timer might have expired. Exceptions are anomalous or exceptional conditions that occur during normal operations, but that require special and immediate attention. Examples include dividing by 0 (there is no suitable outcome), writing to protected memory, or overflowing certain memory structures. Interrupts are signals that may result from events or exceptions. Typically, the sources of events or exceptions can be configured to generate interrupts if desired. Interrupts can be assigned a priority level, and the CPU can be configured to respond to interrupts of a given priority level.

Low-level programs Machine code is a listing of the opcodes. For example, a simple program for our processor might be: 1101000100001101 1101001000000010 0000001100010010 0010010100110100 1110110000001101 This is not very user friendly. Mnemonics are. A Mnemonic is a memory device that is easy to remember. It is associated with something that is not easy to remember, as an aid in learning and recall.

Assembly mnemonics Assembly code is more or less a listing of the opcodes, but the binary numbers have been replaced with more readable mnemonics. Mnemonics are one-to-one replacements for machine codes that are easier to use and remember. A typical instruction format is: Machine Listing Assembly Comments 1101000100001101 XFER R1, data1 // load data1 into R1 1101001000000010 XFER R2, data2 // load data 2 into R2 0000001100010010 ADD R3, R1, R2 // add R1 and R2 into R3 0010010100110100 SUB R5, R3, R4 // compare R3 to R4 1110110000001101 BZ next // If equal, branch to label next

Assembler The Assembler program swaps out the assembler mnemonics for machine code. The machine code can then be forwarded to the linker, and then programmed into memory for execution. The Assembler also offers mechanisms to define memory structures at a given location, to use text labels for reference points (as in the BZ example), to include external files, etc. We will learn about the ARM assembler throughout the class.

Microcontrollers Transistors are relatively cheap; pins are relatively expensive. Off-chip functions must minimize signal pins Intel 80186 Circa 1983

Microcontrollers Microcontrollers are low-to-midrange performance microprocessors, with lots of on-board peripherals. Intended for one chip solutions for white goods, toys, and consumer products, and specialty markets like automotive, telecom, industrial controls, etc. Typically emphasize low power, low cost, low system complexity Typically don t emphasize high performance