Microcontroller Systems

Size: px
Start display at page:

Download "Microcontroller Systems"

Transcription

1 µcontroller systems 1 / 38 Microcontroller Systems Engineering Science 2nd year A2 Lectures Prof David Murray david.murray@eng.ox.ac.uk dwm/courses/2co Michaelmas 2014

2 µcontroller systems 2 / 38 Lecture 4 Input/Output, Interfacing, and Applications

3 µcontroller systems 3 / 38 Introduction We have learned how a computer s CPU and memory function and interact, but as yet we have not considered methods of getting information into or out of the computer without which the whole exercise is pointless. Computer I/O can be described at a number of levels. Layers of software protocols build on yet more layers of hardware definition. Our first aim here is to consider I/O the lowest level, which means...

4 µcontroller systems 4 / 38 Register transfers yet again We ve learned that the CPU is able to output to memory input from memory using an address bus and decoder to select a particular register in memory, a data bus to transfer the register s contents in or out of the CPU a control bus to carry control signals (OEmem, Write/Read) MAR Decoder CPU MBR Location Memory

5 µcontroller systems 5 / 38 Exactly the same idea can be exploited for output to a particular device printer, DAC, video display, etc. CPU MAR MBR Serial link Serializer Parallelizer OR Parallel link Decoder IO Register Device Data transfer to memory is performed in parallel high bandwidth option is suited to devices which are physically close to CPU. For longer distances, the output can be serialized. (For many years serial communications were s l o w, but fast serial links are nowadays available over Universal Serial Buses (USB) and Firewire.)

6 µcontroller systems 6 / 38 Buses In a modern desktop PC, the bus typically consists of 50 to 100 separate lines in these three functional groups, and made available on the motherboard A microcontroller will have the same buses, but there is no equivalent motherboard CPU Memory I/O I/O Control Bus Data Bus Address Bus buses, memory and i/o devices tend to be held within a single IC package.

7 µcontroller systems 7 / 38 Bus Designs Bus design made awkward by the intricacies of timing different device speeds plus accumulated transport delay td = gate delay (3-6 ns) + capacitance delay (5 ns) + transit delay (6 ns m 1 ). At the lowest level there are two major design approaches: Synchronous design requires devices to respond within a specified time. No continuous checks of whether the device received the data. Unsuitable when a mix of fast and slow devices sit on the bus. Asynchronous design devices are considered to have their own clocks, and they a treated as separate RTL modules. CPU and IO device negotiates transmission and receipt using two control bus signals that continually monitor readiness to send and receive data. (Hardware handshaking.)

8 µcontroller systems 8 / 38 Strategies for I/O: a comparison

9 µcontroller systems 9 / 38 Strategies for I/O Our main concern is with I/O that directly involves the CPU. We ll discuss Programmed I/O (uses CPU), not Direct Memory Access. Port mapped I/O Programmed I/O Polled I/O Interrupt driven I/O Memory Mapped I/O Direct Memory Access Within programmed I/O we compare... Port-mapped I/O with Memory-mapped I/O How can peripherals avoid wasting CPU time? We compare... Polled I/O with Interrupt-driven I/O

10 µcontroller systems 10 / 38 Register-based I/O towards port-mapped I/O Consider eight I/O registers that sit in a special port address space. We ll need a special 3-bit address bus & decoder to determine which to I/O with, and a special data bus. No need to group them together they can sit separately on the bus. Selection 3 Port address space I/O registers R/W by peripherals Data to and from registers Data to and from registers But we would need a special PortMAR and PortMBR...

11 µcontroller systems 11 / 38 Port-mapped I/O More economical to use the main data and address buses, and just connecting the lowest 3 address lines A0-A2 to the IO Registers. Address 24 Main Memory IO Registers CS Data Data to and from registers USEmem/USEport BUT the addresses of the IO registers overlap those of main memory... so we require a USEmem/USEport control level. This will feed into the memory s ChipSelect, and we need a similar ChipSelect on each set of IO Registers.

12 µcontroller systems 12 / 38 Port-mapped I/O Port-mapping CPUs have IN and OUT instructions. For example: LDA# 0x9A80 ;; shove hex 9A80 into AC OUT 0x007 ;; and send it to the PORT with address 0x07 Address 24 Main Memory IO Registers CS Data Data to and from registers USEmem/USEport Each IO register needs to be readable and writeable both by the cpu and by the external peripheral. Use dual-ported registers.

13 µcontroller systems 13 / 38 Port-mapped I/O Usually a device will not use just one port address, but many most for the transfer of proper data others transfer status info on the device. Status info used to implement hand shaking. E.g. 12 address lines (of our usual 24) are used to address K I/O registers. Address A0 A23 FFFFFF Address A0 A11 FFF Decoder Main Memory Decoder 28F Device IO Registers DP Data IOR IOW Control USEmem USEport

14 µcontroller systems 14 / 38 Memory-mapped I/O Recall that the memory address space may have gaps where there is no physical main memory. We could do away with the need to select between USEmem or USEport if we put the I/O Registers into available gaps in the memory address space. Memory address space I/O registers I/O registers Main Memory R/W by peripherals R/W by peripherals Main Memory I/O registers I/O registers (a) (b)

15 µcontroller systems 15 / 38 Memory-mapped I/O /ctd As earlier, dual Ported registers are required Now, writing and reading to a device can use the standard instruction for loading from and storing into memory. For example LDA# 0x9A80 ;; get 9A80 hex into accumulator STA 0x00CC00 ;; and send to IO reg at address CC00 hex

16 µcontroller systems 16 / 38 The methods compared Both methods have a mix of memory and i/o registers on the same bus and port-mapped requires that extra control wire. Address Main Memory I/O registers I/O registers Data USEmem/USEport Address Main Memory I/O registers I/O registers Data So why is port-mapping used? 1 In µcontrollers, main memory address space often full 2 The hardware cost of decoding (here, 3bits vs 24bits) Remember, each device requires its own decoder.

17 µcontroller systems 17 / 38 Polled versus Interrupt-driven I/O Port mapped I/O Programmed I/O Polled I/O Interrupt driven I/O Memory Mapped I/O Direct Memory Access

18 µcontroller systems 18 / 38 Handshaking When there is a mix of fast and slow devices on a bus one needs a method of handshaking between the CPU and device. Full handshaking involve conversations like... CPU: Are you ready? IOdev: I m ready CPU: Have you got it? IOdev: I ve got it The notes describe how handshaking is implemented at the lowest level on asynchronous buses. But we don t want to rely on nano-second timescale handshaking to cope with communication with devices which are orders of magnitude slower.

19 µcontroller systems 19 / 38 Example: Buffered I/O One approach to bridging the speed gap is to output data in bursts, buffering it in fast memory on the slow device. Peripheral Emptied slowly The FIFO buffer must be bigger than the volume of data that might be output in one burst Filled quickly... FIFO buffer Slow part of device But the arrangement is not wholly robust at very least the IOdevice must have a bit in a device status register indicating READY or NOTREADY. We consider two ways of handling handshaking at this higher level: Polling and Interrupts.

20 µcontroller systems 20 / 38 Polling The CPU periodically checks the status of the device. Code transfers 100 Bytes of data from an array at address 0x200 to an output register at Port 0x500. The status word is at Port 0x501. LDA #200 ; Load base address into AC STA 22 ; Loc22 hold address of array element LOOP: IN 501 ; read device status word <<<<<<<<< AND #1 ; is the lowest bit equal to 1? <<<<<<<<< BZ LOOP ; if not, jump to LOOP <<<<<<<<< LDA (22) ; Load contents of array location OUT 500 ; write them to device LDA 22 ; Load and ADD #1 ; increment the location STA 22 ; and store it back SUB #300 ; Have we gone too far? BNZ LOOP ; If not, carry on looping BIG SNAG: If the processor is fast and the device slow, the polling loop will be executed many times before the status bit changes.

21 µcontroller systems 21 / 38 How wasteful could this be? Er, VERY! Suppose the IO device handles some 1000 Bytes per second. To handle one Byte takes 10 3 s. A 2 GHz CPU taking 4 clock cycles per instruction will take only (3instructions 4cycles)/( ) 10 8 s to handle computation the polling loop. The polling loop executes approx 10 5 times while waiting for the device to be ready again! Could try to be more efficient by completing other tasks before re-polling... No Check device status Ready? Yes Transfer data to device (a) Increment Complete n th n useful task No Check device status Ready? Yes Transfer data to device (b)

22 µcontroller systems 22 / 38 Interrupt-driven i/o Fetch Decode Execute No IRQ=1? Yes Jump to Int Service Rtne Normal instruction cycle Much more efficient to allow the peripheral to signal to the CPU that it is ready to input or output the peripheral interrupts the processor from its usual grind through the programmed instructions. In program memory are a set of interrupt service subroutines each contains the instructions to handle a particular device interrupt. When the interrupt occurs the processor jumps to the subroutine and then returns to carry on with the programmed instructions. Although it is a subroutine... it could appear at any time! The machine must make sure the programmer s data in the CPU registers is saved before the interrupt and restore after the interrupt.

23 µcontroller systems 23 / 38 Interfacing for Real-time Control

24 µcontroller systems 24 / 38 Microcontroller architecture We can now appreciate the architecture of a typical microcontroller which integrates onto a single chip: CPU and Memory (ROM, RAM and (E)EPROM) IO Ports (digital and A/D, pulse, serial/parallel comms, etc) IO control and status registers Timers Internal buses to connect the components Hardware Timers Interrupt Controller Serial Comms I/O Ports External bus Clock CPU Program Memory (EPROM) Data Memory (RAM)

25 µcontroller systems 25 / 38 Connecting the microcontroller to peripherals Now we need to think about devices which might be connected to the I/O ports not printers etc, (most texts will discuss in some detail devices such as keyboards, printers, disks, etc), but devices used as part of a general engineering system for data acquisition and control output.

26 µcontroller systems 26 / 38 Simple Digital I/O: Input Simple means input from switches or similar that produce a few bits to indicate their state. Eg: A safety management system may wish to monitor pairs of switches indicating that a seat is occupied and a a seat-belt buckled. 5 switches are connect to bits D0... D4 of the input register. The device clocks the input register, but the CPU output-enables it for transfer to the AC Plant Sensors Output Decoder Select Digital inputs D D0 Input register CPU Enable Data Address Control

27 µcontroller systems 27 / 38 Simple Digital I/O: Input Output Plant Sensors Decoder Select Digital inputs D D0 Input register CPU Enable Suppose the port has address 0xFA all D[4:0] are meant to be high alarm set off if any of the 5 inputs is low Data Address Control again: IN 0xFA ;; read the register into the AC. ;; If all well, the AC should contain SUB #0x1F ;; subtract 0x1F or BNZ alarm ;; the answer should be 0, if it isn t, panic! JMP again alarm:..

28 µcontroller systems 28 / 38 Simple Digital I/O: Output Output Here a relay for switching a large current is controlled. PLANT Decoder Select Output register Digital outputs CPU WRITE Data Address Control data Select Write 8 Q7 + D type reset Output register Q0 Solid state relay

29 µcontroller systems 29 / 38 Simple Digital I/O: Output Suppose data Select Write the port is at OxFB, 8 Q7 + D type reset Output register Q0 all output lines are used and Solid state relay the current status is stored in memory location 0x0123. We want to send the entire current status to the register, except that we must ensure that the MSB is 1 to turn on the relay. The code is LDA 0x0123 ;; get desired status from memory OR #0x80 ;; OR with binary OUT 0xFB ;; out to port STA 0x0123 ;; store status for future use

30 µcontroller systems 30 / 38 Analogue Input: From an A-to-D Recall the role on the computer as part of a digital compensator Engineered transfer function Compensator Plant s Transfer Function Sensing Well behaved S&H + ADC S&H + ADC Computer DAC then ZOH Plant s Transfer Function Sensing Computer Controlled

31 µcontroller systems 31 / 38 Analogue Input: From an A-to-D Analogue Demand Multiplexer Channel select Sample and Hold Sample ADC Convert EofC IO Interface CPU Plant Analogue Sensor The I/O interface just contains an address decoder, data register, and some timing circuitry. The multiplexer allows the ADC to access several inputs here the analogue demand and the sensor feedback.

32 µcontroller systems 32 / 38 Analogue input: S&H and Flash Converter Vin Vref Vsh Vsh 7 Sample 6 V Vin Vsh priority encoder 3 3 bit binary output 2 Hold Track t gnd 1 0

33 µcontroller systems 33 / 38 Analogue I/O: Output with a D-to-A Provides continuous voltage control... Select Sample DAC ZOH Vin CPU IO Interface Plant Vsh DAC Sample DAC Vref 10V R R R 2R 2R 2R 2R 2R VZOH R 8 MSB LSB

34 µcontroller systems 34 / 38 Digital Control System

35 µcontroller systems 35 / 38 Digital control The continuous output y(t) is sampled and held, then digitized, giving discrete time samples of the input y(kt )... r(t) y(t) S&H + ADC S&H + ADC r(kt) y(kt) Computer c(kt) DAC then ZOH c(t) Plant s G(s) y(t) Sensing 1 But what computations are done in the computer box?

36 µcontroller systems 36 / 38 Controller implementation... eg PID control An important quantity to derive is the error between the output (kt )and the demand r(kt ). Dropping the sampling interval T... e(k) = r(k) y(k). A common method of control is to let the output of the compensator be the sum of three terms which are proportional (i) the error between the output and the demand, (ii) to its integral and (iii) to its derivative ) c(t) = K (e(t) + 1Ti e(t)dt + T d ė(t) ( ċ(t) = K ė(t) + 1 ) e(t) + T d ë(t) T i Now substitute backward differences for the derivatives... and ċ(k) ë(k) c(k) c(k 1) T ė(k) ė(k 1) T and ė(k) e(k) e(k 1) T e(k) 2e(k 1) + e(k 2) T 2

37 µcontroller systems 37 / 38 Controller implementation... eg PID control Plug these into ċ(t) = K ( ė(t) + 1 ) e(t) + T d ë(t) T i and rearrange to obtain c(k) = c(k 1) + [( K 1 + T + T ) d e(k) T i T ( T ) d e(k 1) + T ( ) ] Td e(k 2) T A few LDA s and STA s later...

38 µcontroller systems 38 / 38 What have we learned in this course... Separation of data from control The data section of the CPU contains nothing but a few registers and an ALU Aim is to shovel Bytes around! Pathways set up by Levels, Registers clocked by Pulses CSLs and CSPs come from the control unit. Their sequence determine by the instruction Memory just a bunch of registers I/O just a bunch of registers

Microcontroller Systems

Microcontroller Systems µcontroller systems 1 / 43 Microcontroller Systems Engineering Science 2nd year A2 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/2co Michaelmas 2014 µcontroller

More information

A3 Computer Architecture

A3 Computer Architecture A3 Computer Architecture Engineering Science 3rd year A3 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/3co Michaelmas 2000 1 / 1 2: Introduction to the CPU 3A3 Michaelmas

More information

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

COSC 243. Input / Output. Lecture 13 Input/Output. COSC 243 (Computer Architecture) COSC 243 Input / Output 1 Introduction This Lecture Source: Chapter 7 (10 th edition) Next Lecture (until end of semester) Zhiyi Huang on Operating Systems 2 Memory RAM Random Access Memory Read / write

More information

QUIZ Ch.6. The EAT for a two-level memory is given by:

QUIZ Ch.6. The EAT for a two-level memory is given by: QUIZ Ch.6 The EAT for a two-level memory is given by: EAT = H Access C + (1-H) Access MM. Derive a similar formula for three-level memory: L1, L2 and RAM. Hint: Instead of H, we now have H 1 and H 2. Source:

More information

Chapter 3 - Top Level View of Computer Function

Chapter 3 - Top Level View of Computer Function Chapter 3 - Top Level View of Computer Function Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 3 - Top Level View 1 / 127 Table of Contents I 1 Introduction 2 Computer Components

More information

CS 101, Mock Computer Architecture

CS 101, Mock Computer Architecture CS 101, Mock Computer Architecture Computer organization and architecture refers to the actual hardware used to construct the computer, and the way that the hardware operates both physically and logically

More information

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture 168 420 Computer Architecture Chapter 6 Input/Output Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In different formats All slower than CPU

More information

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system. CPU ARCHITECTURE QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system. ANSWER 1 Data Bus Width the width of the data bus determines the number

More information

Question Bank Microprocessor and Microcontroller

Question Bank Microprocessor and Microcontroller QUESTION BANK - 2 PART A 1. What is cycle stealing? (K1-CO3) During any given bus cycle, one of the system components connected to the system bus is given control of the bus. This component is said to

More information

Chapter 3. Top Level View of Computer Function and Interconnection. Yonsei University

Chapter 3. Top Level View of Computer Function and Interconnection. Yonsei University Chapter 3 Top Level View of Computer Function and Interconnection Contents Computer Components Computer Function Interconnection Structures Bus Interconnection PCI 3-2 Program Concept Computer components

More information

Unit 5. Memory and I/O System

Unit 5. Memory and I/O System Unit 5 Memory and I/O System 1 Input/Output Organization 2 Overview Computer has ability to exchange data with other devices. Human-computer communication Computer-computer communication Computer-device

More information

Accessing I/O Devices Interface to CPU and Memory Interface to one or more peripherals Generic Model of IO Module Interface for an IO Device: CPU checks I/O module device status I/O module returns status

More information

INPUT-OUTPUT ORGANIZATION

INPUT-OUTPUT ORGANIZATION INPUT-OUTPUT ORGANIZATION Peripheral Devices: The Input / output organization of computer depends upon the size of computer and the peripherals connected to it. The I/O Subsystem of the computer, provides

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 3, 2015 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 2, 2016 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

9. PERIPHERAL CHIPS 9a

9. PERIPHERAL CHIPS 9a 9. PERIPHERAL CHIPS 9a 8255: Programmable Peripheral Interface. Draw the pin diagram of PPI 8255. Ans. The pin diagram of 8255 is shown in Fig. 9a. PA 3 4 PA 4 PA2 2 39 PA 5 PA 3 38 PA 6 PA 4 37 PA7 RD

More information

Organisasi Sistem Komputer

Organisasi Sistem Komputer LOGO Organisasi Sistem Komputer OSK 5 Input Output 1 1 PT. Elektronika FT UNY Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In different formats

More information

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

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5. DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6502- MICROPROCESSORS AND MICROCONTROLLERS UNIT I: 8085 PROCESSOR PART A 1. What is the need for ALE signal in

More information

Computer Hardware Requirements for Real-Time Applications

Computer Hardware Requirements for Real-Time Applications Lecture (4) Computer Hardware Requirements for Real-Time Applications Prof. Kasim M. Al-Aubidy Computer Engineering Department Philadelphia University Real-Time Systems, Prof. Kasim Al-Aubidy 1 Lecture

More information

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers Lecture (4) Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers Prof. Kasim M. Al-Aubidy Philadelphia University-Jordan DERTS-MSc, 2015 Prof. Kasim Al-Aubidy 1 Lecture Outline:

More information

Computer Organization ECE514. Chapter 5 Input/Output (9hrs)

Computer Organization ECE514. Chapter 5 Input/Output (9hrs) Computer Organization ECE514 Chapter 5 Input/Output (9hrs) Learning Outcomes Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge

More information

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE: 1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE: A microprocessor is a programmable electronics chip that has computing and decision making capabilities similar to central processing unit

More information

Microprocessors and Microcontrollers Prof. Santanu Chattopadhyay Department of E & EC Engineering Indian Institute of Technology, Kharagpur

Microprocessors and Microcontrollers Prof. Santanu Chattopadhyay Department of E & EC Engineering Indian Institute of Technology, Kharagpur Microprocessors and Microcontrollers Prof. Santanu Chattopadhyay Department of E & EC Engineering Indian Institute of Technology, Kharagpur Lecture - 09 8085 Microprocessors (Contd.) (Refer Slide Time:

More information

Introduction to Computers - Chapter 4

Introduction to Computers - Chapter 4 Introduction to Computers - Chapter 4 Since the invention of the transistor and the first digital computer of the 1940s, computers have been increasing in complexity and performance; however, their overall

More information

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors Interface DAC to a PC Engineering 4862 Microprocessors Lecture 22 Cheng Li EN-4012 licheng@engr.mun.ca DAC (Digital-to-Analog Converter) Device used to convert digital pulses to analog signals Two methods

More information

COMP asynchronous buses April 5, 2016

COMP asynchronous buses April 5, 2016 All the I/O examples we have discussed use the system bus to send data between the CPU, main memory, and I/O controllers. The system bus runs at a slower clock speed than the CPU because of greater distances

More information

Microprocessors/Microcontrollers

Microprocessors/Microcontrollers Microprocessors/Microcontrollers A central processing unit (CPU) fabricated on one or more chips, containing the basic arithmetic, logic, and control elements of a computer that are required for processing

More information

Lecture 23. Finish-up buses Storage

Lecture 23. Finish-up buses Storage Lecture 23 Finish-up buses Storage 1 Example Bus Problems, cont. 2) Assume the following system: A CPU and memory share a 32-bit bus running at 100MHz. The memory needs 50ns to access a 64-bit value from

More information

Microcomputer Architecture and Programming

Microcomputer Architecture and Programming IUST-EE (Chapter 1) Microcomputer Architecture and Programming 1 Outline Basic Blocks of Microcomputer Typical Microcomputer Architecture The Single-Chip Microprocessor Microprocessor vs. Microcontroller

More information

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

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly. Unit I 8085 and 8086 PROCESSOR Introduction to microprocessor A microprocessor is a clock-driven semiconductor device consisting of electronic logic circuits manufactured by using either a large-scale

More information

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an Microcontroller Basics MP2-1 week lecture topics 2 Microcontroller basics - Clock generation, PLL - Address space, addressing modes - Central Processing Unit (CPU) - General Purpose Input/Output (GPIO)

More information

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

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller. UNIT V -8051 MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS 1. What is micro controller? Micro controller is a microprocessor with limited number of RAM, ROM, I/O ports and timer on a single chip

More information

MARIE: An Introduction to a Simple Computer

MARIE: An Introduction to a Simple Computer MARIE: An Introduction to a Simple Computer Outline Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution. Understand a simple

More information

Chapter Operation Pinout Operation 35

Chapter Operation Pinout Operation 35 68000 Operation 35 Chapter 6 68000 Operation 6-1. 68000 Pinout We will do no construction in this chapter; instead, we will take a detailed look at the individual pins of the 68000 and what they do. Fig.

More information

Machine Architecture. or what s in the box? Lectures 2 & 3. Prof Leslie Smith. ITNP23 - Autumn 2014 Lectures 2&3, Slide 1

Machine Architecture. or what s in the box? Lectures 2 & 3. Prof Leslie Smith. ITNP23 - Autumn 2014 Lectures 2&3, Slide 1 Machine Architecture Prof Leslie Smith or what s in the box? Lectures 2 & 3 ITNP23 - Autumn 2014 Lectures 2&3, Slide 1 Basic Machine Architecture In these lectures we aim to: understand the basic architecture

More information

1. Internal Architecture of 8085 Microprocessor

1. Internal Architecture of 8085 Microprocessor 1. Internal Architecture of 8085 Microprocessor Control Unit Generates signals within up to carry out the instruction, which has been decoded. In reality causes certain connections between blocks of the

More information

Segment 1A. Introduction to Microcomputer and Microprocessor

Segment 1A. Introduction to Microcomputer and Microprocessor Segment 1A Introduction to Microcomputer and Microprocessor 1.1 General Architecture of a Microcomputer System: The term microcomputer is generally synonymous with personal computer, or a computer that

More information

A3 Computer Architecture

A3 Computer Architecture Computer Architecture MT 2 A3 Computer Architecture Engineering Science 3rd year A3 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/3co Michaelmas 2 / Computer Architecture

More information

Chapter 4 Main Memory

Chapter 4 Main Memory Chapter 4 Main Memory Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge of mathematics, science and engineering fundamentals

More information

Chapter 1 : Introduction

Chapter 1 : Introduction Chapter 1 Introduction 1.1 Introduction A Microprocessor is a multipurpose programmable, clock driven, register based electronic device that reads binary instructions from a storage device called memory,

More information

INPUT-OUTPUT ORGANIZATION

INPUT-OUTPUT ORGANIZATION 1 INPUT-OUTPUT ORGANIZATION Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes of Transfer Priority Interrupt Direct Memory Access Input-Output Processor Serial Communication 2

More information

1 Digital tools. 1.1 Introduction

1 Digital tools. 1.1 Introduction 1 Digital tools 1.1 Introduction In the past few years, enormous advances have been made in the cost, power, and ease of use of microcomputers and associated analog and digital circuits. It is now possible,

More information

BV4626 General Purpose I/O. Product specification. Mar 2010 V0.a. ByVac Page 1 of 13

BV4626 General Purpose I/O. Product specification. Mar 2010 V0.a. ByVac Page 1 of 13 General Purpose I/O Product specification Mar 2010 V0.a ByVac Page 1 of 13 Contents 1. Introduction... 3 2. Features... 3 3. Physical Specification... 3 3.1. JP7... 3 3.2. Control Interface... 4 3.3. Serial

More information

CN310 Microprocessor Systems Design

CN310 Microprocessor Systems Design CN310 Microprocessor Systems Design Microcontroller Nawin Somyat Department of Electrical and Computer Engineering Thammasat University Outline Course Contents 1 Introduction 2 Simple Computer 3 Microprocessor

More information

Digital System Design

Digital System Design Digital System Design by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc350 Simon Fraser University i Slide Set: 15 Date: March 30, 2009 Slide

More information

Computer Organization and Assembly Language (CS-506)

Computer Organization and Assembly Language (CS-506) Computer Organization and Assembly Language (CS-506) Muhammad Zeeshan Haider Ali Lecturer ISP. Multan ali.zeeshan04@gmail.com https://zeeshanaliatisp.wordpress.com/ Lecture 2 Memory Organization and Structure

More information

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017 Lecture Objectives Introduction to Computing Chapter The AVR microcontroller and embedded systems using assembly and c Students should be able to: Convert between base and. Explain the difference between

More information

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals William Stallings Computer Organization and Architecture 7 th Edition Chapter 7 Input/Output Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In

More information

Microprocessor Architecture. mywbut.com 1

Microprocessor Architecture. mywbut.com 1 Microprocessor Architecture mywbut.com 1 Microprocessor Architecture The microprocessor can be programmed to perform functions on given data by writing specific instructions into its memory. The microprocessor

More information

Lectures More I/O

Lectures More I/O Lectures 24-25 More I/O 1 I/O is slow! How fast can a typical I/O device supply data to a computer? A fast typist can enter 9-10 characters a second on a keyboard. Common local-area network (LAN) speeds

More information

CPE/EE 421/521 Fall 2004 Chapter 4 The CPU Hardware Model. Dr. Rhonda Kay Gaede UAH. The CPU Hardware Model - Overview

CPE/EE 421/521 Fall 2004 Chapter 4 The CPU Hardware Model. Dr. Rhonda Kay Gaede UAH. The CPU Hardware Model - Overview CPE/EE 421/521 Fall 2004 Chapter 4 The 68000 CPU Hardware Model Dr. Rhonda Kay Gaede UAH Fall 2004 1 The 68000 CPU Hardware Model - Overview 68000 interface Timing diagram Minimal configuration using the

More information

Module 6: INPUT - OUTPUT (I/O)

Module 6: INPUT - OUTPUT (I/O) Module 6: INPUT - OUTPUT (I/O) Introduction Computers communicate with the outside world via I/O devices Input devices supply computers with data to operate on E.g: Keyboard, Mouse, Voice recognition hardware,

More information

Computer Organization

Computer Organization INF 101 Fundamental Information Technology Computer Organization Assistant Prof. Dr. Turgay ĐBRĐKÇĐ Course slides are adapted from slides provided by Addison-Wesley Computing Fundamentals of Information

More information

A First Look at Microprocessors

A First Look at Microprocessors 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

More information

Digital Input and Output

Digital Input and Output Digital Input and Output Topics: Parallel Digital I/O Simple Input (example) Parallel I/O I/O Scheduling Techniques Programmed Interrupt Driven Direct Memory Access Serial I/O Asynchronous Synchronous

More information

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT IV I/O INTERFACING PART A (2 Marks)

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT IV I/O INTERFACING PART A (2 Marks) MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI-621213. UNIT IV I/O INTERFACING PART A (2 Marks) 1. Name the three modes used by the DMA processor to transfer data? [NOV/DEC 2006] Signal transfer mode (cycling

More information

Roberto Muscedere Images and Text Portions 2003 Prentice Hall 1

Roberto Muscedere Images and Text Portions 2003 Prentice Hall 1 Microcomputer Structure and Operation Chapter 5 A Microprocessor ( P) contains the controller, ALU and internal registers A Microcomputer ( C) contains a microprocessor, memory (RAM, ROM, etc), input and

More information

SAE5C Computer Organization and Architecture. Unit : I - V

SAE5C Computer Organization and Architecture. Unit : I - V SAE5C Computer Organization and Architecture Unit : I - V UNIT-I Evolution of Pentium and Power PC Evolution of Computer Components functions Interconnection Bus Basics of PCI Memory:Characteristics,Hierarchy

More information

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

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085. (1) Draw and explain the internal architecture of 8085. The architecture of 8085 Microprocessor is shown in figure given below. The internal architecture of 8085 includes following section ALU-Arithmetic

More information

2.2 THE MARIE Instruction Set Architecture

2.2 THE MARIE Instruction Set Architecture 2.2 THE MARIE Instruction Set Architecture MARIE has a very simple, yet powerful, instruction set. The instruction set architecture (ISA) of a machine specifies the instructions that the computer can perform

More information

Lecture 2 Microcomputer Organization: Fig.1.1 Basic Components of Microcomputer

Lecture 2 Microcomputer Organization: Fig.1.1 Basic Components of Microcomputer Lecture 2 Microcomputer Organization: As discussed in previous lecture microprocessor is a central processing unit (CPU) with its related timing functions on a single chip. A microprocessor combined with

More information

Replacement Policy: Which block to replace from the set?

Replacement Policy: Which block to replace from the set? Replacement Policy: Which block to replace from the set? Direct mapped: no choice Associative: evict least recently used (LRU) difficult/costly with increasing associativity Alternative: random replacement

More information

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS UNIT I INTRODUCTION TO 8085 8085 Microprocessor - Architecture and its operation, Concept of instruction execution and timing diagrams, fundamentals of

More information

Computer Architecture CS 355 Busses & I/O System

Computer Architecture CS 355 Busses & I/O System Computer Architecture CS 355 Busses & I/O System Text: Computer Organization & Design, Patterson & Hennessy Chapter 6.5-6.6 Objectives: During this class the student shall learn to: Describe the two basic

More information

COMPUTER ORGANIZATION AND ARCHITECTURE

COMPUTER ORGANIZATION AND ARCHITECTURE Page 1 1. Which register store the address of next instruction to be executed? A) PC B) AC C) SP D) NONE 2. How many bits are required to address the 128 words of memory? A) 7 B) 8 C) 9 D) NONE 3. is the

More information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three subsystems of a computer. Describe the

More information

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

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 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 which we will examine how a microprocessor actually works

More information

Chapter 1 Microprocessor architecture ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 1.1 Computer hardware organization 1.1.1 Number System 1.1.2 Computer hardware

More information

Sender Receiver Sender

Sender Receiver Sender EEE 410 Microprocessors I Spring 04/05 Lecture Notes # 19 Outline of the Lecture Interfacing the Serial Port Basics of Serial Communication Asynchronous Data Communication and Data Framing RS232 and other

More information

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics Chapter 4 Objectives Learn the components common to every modern computer system. Chapter 4 MARIE: An Introduction to a Simple Computer Be able to explain how each component contributes to program execution.

More information

Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION

Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION Introduction A general purpose computer should have the ability to exchange information with a wide range of devices in varying environments. Computers

More information

Digital Design Laboratory Lecture 6 I/O

Digital Design Laboratory Lecture 6 I/O ECE 280 / CSE 280 Digital Design Laboratory Lecture 6 I/O Input/Output Module Interface to CPU and Memory Interface to one or more peripherals Generic Model of I/O Module External Devices Human readable

More information

Chapter 4 The Components of the System Unit

Chapter 4 The Components of the System Unit Chapter 4 The Components of the System Unit The System Unit What is the system unit? Case that contains electronic components of the computer used to process data Sometimes called the chassis p. 184 Fig.

More information

Microcontroller basics

Microcontroller basics FYS3240 PC-based instrumentation and microcontrollers Microcontroller basics Spring 2017 Lecture #4 Bekkeng, 30.01.2017 Lab: AVR Studio Microcontrollers can be programmed using Assembly or C language In

More information

lecture 22 Input / Output (I/O) 4

lecture 22 Input / Output (I/O) 4 lecture 22 Input / Output (I/O) 4 - asynchronous bus, handshaking - serial bus Mon. April 4, 2016 "synchronous" bus = clock based (system bus clock is slower than CPU clock) "asynchronous" bus = not clock

More information

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad Objectives To be familiar with microcontrollers, PIC18F4550 microcontroller. Tools PIC18F4550 Microcontroller, MPLAB software,

More information

Computer Organization

Computer Organization Chapter 5 Computer Organization Figure 5-1 Computer hardware :: Review Figure 5-2 CPU :: Review CPU:: Review Registers are fast stand-alone storage locations that hold data temporarily Data Registers Instructional

More information

THE MICROCOMPUTER SYSTEM CHAPTER - 2

THE MICROCOMPUTER SYSTEM CHAPTER - 2 THE MICROCOMPUTER SYSTEM CHAPTER - 2 20 2.1 GENERAL ASPECTS The first computer was developed using vacuum tubes. The computers thus developed were clumsy and dissipating more power. After the invention

More information

COMP 273 Winter asynchronous I/O April 5, 2012

COMP 273 Winter asynchronous I/O April 5, 2012 All the I/O examples we have discussed use the system bus to send data between the CPU, main memory, and I/O controllers. The system bus runs at a slower clock speed than the CPU because of greater distances

More information

Micro-programmed Control Ch 15

Micro-programmed Control Ch 15 Micro-programmed Control Ch 15 Micro-instructions Micro-programmed Control Unit Sequencing Execution Characteristics 1 Hardwired Control (4) Complex Fast Difficult to design Difficult to modify Lots of

More information

Introduction to 8051 microcontrollers

Introduction to 8051 microcontrollers Introduction to 8051 microcontrollers Posted on May 7, 2008, by Ibrahim KAMAL, in Micro-controllers, tagged This tutorial is specially tailored to electronics and robotics hobbyists that have already realized

More information

address ALU the operation opcode ACC Acc memory address

address ALU the operation opcode ACC Acc memory address 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 which we will examine how a microprocessor actually works

More information

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4)

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4) Micro-programmed Control Ch 15 Micro-instructions Micro-programmed Control Unit Sequencing Execution Characteristics 1 Machine Instructions vs. Micro-instructions Memory execution unit CPU control memory

More information

Micro-programmed Control Ch 15

Micro-programmed Control Ch 15 Micro-programmed Control Ch 15 Micro-instructions Micro-programmed Control Unit Sequencing Execution Characteristics 1 Hardwired Control (4) Complex Fast Difficult to design Difficult to modify Lots of

More information

The Central Processing Unit

The Central Processing Unit The Central Processing Unit All computers derive from the same basic design, usually referred to as the von Neumann architecture. This concept involves solving a problem by defining a sequence of commands

More information

Module 5 - CPU Design

Module 5 - CPU Design Module 5 - CPU Design Lecture 1 - Introduction to CPU The operation or task that must perform by CPU is: Fetch Instruction: The CPU reads an instruction from memory. Interpret Instruction: The instruction

More information

Blog -

Blog - . Instruction Codes Every different processor type has its own design (different registers, buses, microoperations, machine instructions, etc) Modern processor is a very complex device It contains Many

More information

Chapter 4. MARIE: An Introduction to a Simple Computer

Chapter 4. MARIE: An Introduction to a Simple Computer Chapter 4 MARIE: An Introduction to a Simple Computer Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution.

More information

Microcontrollers. Principles and Applications. Ajit Pal +5 V 2K 8. 8 bit dip switch. P2 8 Reset switch Microcontroller AT89S52 100E +5 V. 2.

Microcontrollers. Principles and Applications. Ajit Pal +5 V 2K 8. 8 bit dip switch. P2 8 Reset switch Microcontroller AT89S52 100E +5 V. 2. Ajit Pal Microcontrollers Principles and Applications +5 V 2K 8 8 bit dip switch P2 8 Reset switch Microcontroller AT89S52 100E +5 V +5 V 2.2K 10 uf RST 7 Segment common anode LEDs P1(0-6) & P3(0-6) 7

More information

Topics. Interfacing chips

Topics. Interfacing chips 8086 Interfacing ICs 2 Topics Interfacing chips Programmable Communication Interface PCI (8251) Programmable Interval Timer (8253) Programmable Peripheral Interfacing - PPI (8255) Programmable DMA controller

More information

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

These three counters can be programmed for either binary or BCD count. S5 KTU 1 PROGRAMMABLE TIMER 8254/8253 The Intel 8253 and 8254 are Programmable Interval Timers (PTIs) designed for microprocessors to perform timing and counting functions using three 16-bit registers.

More information

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions Micro-programmed Control Ch 17 Micro-instructions Micro-programmed Control Unit Sequencing Execution Characteristics Course Summary Hardwired Control (4) Complex Fast Difficult to design Difficult to modify

More information

CHAPTER 4 MARIE: An Introduction to a Simple Computer

CHAPTER 4 MARIE: An Introduction to a Simple Computer CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 177 4.2 CPU Basics and Organization 177 4.2.1 The Registers 178 4.2.2 The ALU 179 4.2.3 The Control Unit 179 4.3 The Bus 179 4.4 Clocks

More information

Computer Organization and Programming

Computer Organization and Programming Sep 2006 Prof. Antônio Augusto Fröhlich (http://www.lisha.ufsc.br) 8 Computer Organization and Programming Prof. Dr. Antônio Augusto Fröhlich guto@lisha.ufsc.br http://www.lisha.ufsc.br/~guto Sep 2006

More information

Computer Architecture and Organization (CS-507)

Computer Architecture and Organization (CS-507) Computer Architecture and Organization (CS-507) Muhammad Zeeshan Haider Ali Lecturer ISP. Multan ali.zeeshan04@gmail.com https://zeeshanaliatisp.wordpress.com/ Lecture 4 Basic Computer Function, Instruction

More information

3.1 Description of Microprocessor. 3.2 History of Microprocessor

3.1 Description of Microprocessor. 3.2 History of Microprocessor 3.0 MAIN CONTENT 3.1 Description of Microprocessor The brain or engine of the PC is the processor (sometimes called microprocessor), or central processing unit (CPU). The CPU performs the system s calculating

More information

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

Module 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1 Module 3 Embedded Systems I/O Version 2 EE IIT, Kharagpur 1 Lesson 15 Interrupts Version 2 EE IIT, Kharagpur 2 Instructional Objectives After going through this lesson the student would learn Interrupts

More information

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle CS 224: Computer Organization S.KHABET CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference Instructions

More information

Slide Set 9. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

Slide Set 9. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng Slide Set 9 for ENCM 369 Winter 2018 Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary March 2018 ENCM 369 Winter 2018 Section 01

More information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science ã Cengage Learning Objectives After studying this chapter, the student should be able to: q List the three subsystems of a computer. q Describe

More information