© Mike Stacey 2008 Single Chip Microcontrollers 7765J Mount Druitt College of TAFE Lesson 6 Instruction Timing and Control Loops.

Slides:



Advertisements
Similar presentations
Microprocessors A Beginning.
Advertisements

Machine cycle.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Parul Polytechnic Institute
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 4.
A look at interrupts What are interrupts and why are they needed.
9/20/6Lecture 3 - Instruction Set - Al1 The Hardware Interface.
The 8085 Microprocessor Architecture
Timing Diagram is a graphical representation
Microprocessor and Microcontroller
Processor System Architecture
Instructor: Sazid Zaman Khan Lecturer, Department of Computer Science and Engineering, IIUC.
1 Lecture 6 Performance Measurement and Improvement.
1 TK2633TK Microprocessor Architecture DR MASRI AYOB.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
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.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Embedded Systems 7763B Mt Druitt College of TAFE
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Basic Microcomputer Design. Inside the CPU Registers – storage locations Control Unit (CU) – coordinates the sequencing of steps involved in executing.
created by :Gaurav Shrivastava
Timer/counter Chapter 12
Chapter 5 Basic Processing Unit
MICROPROCESSOR INPUT/OUTPUT
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n.
Unit-III Pipelined Architecture. Basic instruction cycle 6/4/2016MDS_SCOE_UNIT32.
Computer Organization and Architecture Tutorial 1 Kenneth Lee.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
The 8051 Microcontroller and Embedded Systems
© Mike Stacey 2008 Single Chip Microcontrollers 7765J Mount Druitt College of TAFE Lesson 3 Arrays in ASM, Bubble Sort algorithm.
Computer Hardware The Processing Unit.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
HOW COMPUTERS WORK THE CPU & MEMORY. THE PARTS OF A COMPUTER.
System Hardware FPU – Floating Point Unit –Handles floating point and extended integer calculations 8284/82C284 Clock Generator (clock) –Synchronizes the.
Fundamentals of Programming Languages-II
Lecture 41 CSE 341 – Microprocessors Lecture 4 Md. Omar Faruqe UB 1228
Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
Capability of processor determine the capability of the computer system. Therefore, processor is the key element or heart of a computer system. Other.
LECTURE 10 Pipelining: Advanced ILP. EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls,
M211 – Central Processing Unit
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
What’s going on here? Can you think of a generic way to describe both of these?
Unit Microprocessor.
COURSE OUTCOMES OF Microprocessor and programming
TIMING DIAGRAM OF 8085 By Sadhish Prabhu.
The 8085 Microprocessor Architecture
16.317: Microprocessor System Design I
Instruction format Instruction is a command to microprocessor to perform a given task on specified data. Each instruction has two parts: One is the task.
Chapter 2.1 CPU.
The 8085 Microprocessor Architecture
THE CPU i Bytes 1.1.
8085 Microprocessor Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Pipelining: Advanced ILP
Instruction cycle Instruction: A command given to the microprocessor to perform an operation Program : A set of instructions given in a sequential.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
8085 Microprocessor Architecture
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
The 8085 Microprocessor Architecture
Performance Cycle time of a computer CPU speed speed = 1 / cycle time
8085 Microprocessor Architecture
Computer Operation 6/22/2019.
Assignment 1) Explain how lower address bus is multiplexed with data bus? 2) Explain the function of all the control signals in the 8085 Control Logic.
Presentation transcript:

© Mike Stacey 2008 Single Chip Microcontrollers 7765J Mount Druitt College of TAFE Lesson 6 Instruction Timing and Control Loops

© Mike Stacey 2008 Instruction timing [1] One of the more important subroutines you will use is that which gives a time delay in a program. You often need to have these delays to wait for an event to occur. For example, you may need to wait for a user to respond to a prompt, or you may need to wait, in real time, for a slower device to provide input. The microcontroller operates at very high speed, performing millions of instructions per second. While this is advantageous in most applications it does not serve the control of slower equipment very well. A microprocessor relies on its clock to synchronise its operations. All control signals are derived from the clock, and the processor generates most of them. The speed of operation of the system is therefore directly dependent on the clock. The time taken to perform a particular operation, such as a memory access, depends on the number of actions required to execute the instruction. The following terms are used to describe the timing of an instruction.

© Mike Stacey 2008 Instruction timing [2] Instruction Cycle This is the total time taken to fetch, decode and execute an instruction. An instruction cycle is divided into a number of specific steps, generally referred to as machine cycles. Machine Cycle This is the time required to complete one specific operation; such as reading from or writing to memory, accessing input or output ports, or acknowledging an external request. Each machine cycle consists of a number of clock cycles. Clock Cycle A clock cycle is the smallest subdivision of a machine cycle and is usually the same frequency, or period, as the system clock.

© Mike Stacey 2008 Calculating the time taken to execute an instruction To determine how long a group of instructions takes to execute we must refer to the manufacturer’s data sheets for the uC or look in an appropriate textbook to ascertain the number of clock cycles each instruction requires. We then multiply this number by the period of the clock. When we know how long each instruction execution takes we can add the duration of each instruction to find the total time

© Mike Stacey 2008 Simple delay wait: ldi temp,$ff mov countreg, temp delay_1: dec countreg cpi countreg, $00 brne delay_1 ret How many clock cycles? if true 1 Totals: rcall:3 wait: ldi:1 mov1 delay_1: dec1 cpi1 brne2 - 4 per loop * 254 true loops and 1 false loop ret (4 * 254) = 1026 For a clock frequency of 8MHz, that’s (1/8 * 10 6 ) * 1026 = 0.13mS Also need an rcall wait 3 1

© Mike Stacey 2008 How to get a longer delay? Insert the previous code into another loop A Nested Loop

© Mike Stacey 2008 Nested loops for longer delays delay: ldi temp, $ff mov temp_outer, temp delay_outer: mov countreg_inner, temp delay_inner: dec countreg_inner cpi countreg_inner, $00 brne delay_inner dec countreg_outer cpi countreg_outer, $00 brne delay_outer ret inner loop outer loop Total Clock Cycles: delay: ldi: 1 mov: 1 delay_outer: mov: 1 delay_inner dec: 1 cpi: 1 brne: 2 if true, 1 if false dec: 1 cpi: 1 brne: 2 if true, 1 if false ret: 4 -What is the total? -What is the delay time for an 8MHz clock? ((4*254)+1) + ((( )*254)+1)