TK2633: MICROPROCESSOR & INTERFACING

Slides:



Advertisements
Similar presentations
8085 Architecture & Its Assembly language programming
Advertisements

The 8051 Microcontroller and Embedded Systems
1 Chapter 3 Jump, Loop, and Call Instructions. 2 Sections 3.1 Loop and Jump Instructions 3.2 Call Instructions 3.3 Time Delay Generation and Calculation.
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
The 8085 Microprocessor Architecture
TK 2633 Microprocessor & Interfacing
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Room: Timbalan Pengarah Pusat Komputer Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 4: Introduction.
TK2633: MICROPROCESSOR & INTERFACING
TK 2633 Microprocessor & Interfacing
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 5: Arithmetic and Logic Instructions.
TK I/O Peripherals Interface DR MASRI AYOB.
Parul Polytechnic Institute Parul Polytechnic Institute Subject Code : Name Of Subject : Microprocessor and assembly language programming Name.
INSTRUCTION SET OF MICROPROCESSOR 8085
CHAPTER TIMER PROGRAMMING Timers The 8051 has two timers/counters, they can be used as ◦ Timers to generate a time delay ◦ Event counters.
The 8253 Programmable Interval Timer
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
Chapter 4 - Implementing Standard Program Structures in 8086 Assembly Language from Microprocessors and Interfacing by Douglas Hall.
Computer Architecture Lecture 12 by Engineer A. Lecturer Aymen Hasan AlAwady 25/3/2014 University of Kufa - Information Technology Research and Development.
TK2633 : MICROPROCESSOR & INTERFACING Lecture 10: Fixed Point Arithmetic Lecturer: Ass. Prof. Dr. Masri Ayob.
Computer Architecture Lecture 12 by Engineer A. Lecturer Aymen Hasan AlAwady 17/3/2014 University of Kufa - Information Technology Research and Development.
The 8051 Microcontroller and Embedded Systems
Ass. Prof. Dr Masri Ayob Lecture 5: Arithmetic and Logic Instructions TK 2633: Microprocessor & Interfacing.
Ass Prof Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 6: Control Instructions.
Projects 8051.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Interfacing Data Converters. D/A converters Design an O/P port with the address FFh to interface the 1408 D/A converter that is calibrated for 0 to 10V.
Assembly Language Programming of 8085 BY Prof. U. V. THETE Dept. of Computer Science YMA.
Computer Architecture Lecture 14 by Engineer A. Lecturer Aymen Hasan AlAwady 14/4/2014 University of Kufa - Information Technology Research and Development.
JUMP, LOOP, AND CALL INSTRUCTIONS
P ROGRAMMING T ECHNIQUES : L OOPING, C OUNTING AND I NDEXING L ECTURE 7 Gunjeet Kaur Dronacharya group of Institutions.
Gunjeet Kaur Dronacharya Group of Institutions COUNTERS AND TIME DELAYS LECTURE 3.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني 8085 Instruction Set Instruction types. data transfer group. Arithmetic group.
The 8085A is a general-purpose microprocessor with low hardware overhead requirements. Within the 8085A are contained the functions of clock generation,
8085 Microprocessor Architecture
Seminar On 8085 microprocessor
Gursharan Singh Tatla INSTRUCTION SET OF 8085 Gursharan Singh Tatla Gursharan Singh Tatla
Unit 1 Instruction set M.Brindha AP/EIE
PROGRAMMING OF 8085 PROCESSOR
Lecture – 5 Assembly Language Programming
The 8085 Microprocessor Architecture
Assembly Language (continue)
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Counters & Time Delays.
The 8085 Microprocessor Architecture
Interfacing of LCD with µP
Serial I/O and Data Communication.
Programmable Interval Timer
Programmable Interval Timer
Programmable Interval Timer 8254 LECTURE 3
Introduction to 8085 Instructions
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 3 & 4 Part 1
8085 microprocessor.
8085 Microprocessor Architecture
The 8085 Microprocessor Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
EMT 348: Microcontroller Timer/counter
Additional data transfer and 16 bit arithmetic instruction Lecture 1
Timer.
Programmable Interval timer 8253 / 8254
INSTRUCTION SET OF 8085.
Programmable Interval timer 8253 / 8254
The 8085 Microprocessor Architecture
CNET 315 Microprocessor & Assembly Language
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
Presentation transcript:

TK2633: MICROPROCESSOR & INTERFACING Programming Techniques

DELAY Procedure to use delay is almost similar to counter. A register is loaded with a number; depending on the delay required; the register is subtracted until zero is achieved by putting the conditional jump instruction. December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using a single register December 9, 2018 Dr. Masri Ayob: TK2633 figure 2

Time delay using a single register From the example, noticed that the MVI instruction uses 7 Time states for it to execute. Suppose the 8085 µp has a clock frequency of 2MHz, the MVI instruction will execute within 3.5µs. Below is the example to calculate the time of execution. December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using a single register If the clock frequency given is 1MHz, then the MVI instruction will take 7µs to execute. To calculate the time delay in a loop, the total T-states and total instructions must be predetermined. In figure 2, register C is loaded with FFH (25510). DCR and JNZ in the loop use 14 T-states. And the loop will repeat 255 times until C gets zero. Then the delay calculation is determined as follows: Where TL = Time delay in the loop. T = time states of the system (1/f) N10 = decimal number December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using a single register Most of the time, the delay calculation is almost accurate, however to get better accuracy the calculation for JNZ has to be modified. The T-states for JNZ shows 10/7. It means the 8085 µp requires 10 T-states for JNZ to jump within the loop process, and 7 T-states when JNZ jump out of the loop. Therefore in the final loop (255th loop) the JNZ instruction uses 7 T-states and the following calculation shows how to modified this accuracy. December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using a single register Therefore the overall delay including the delay outside the loop is as follows: December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using register pair Longer delay can be achieved by using register pair and 16-bits number. The 16-bit numbers require DCX instruction to decrement. However the DCX instruction will not affect Z flag. Therefore special technique has to be added. Below is the example of using BC register pair as delay register. December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using register pair In the previous example, the instruction LXI B, 2384H, causes B=23H and C = 84H. DCX instruction will decrement the BC by one. MOV A,C and ORA B, are to determine the content of Z flag. The OR instruction set the Z register whenever B and C have the same value that is zero. Therefore this loop will repeat 2384H times. The total T-states in the loop is 24 (for instructions DCX, MOV, ORA and JNZ). The conversion of 2384H times equivalent to its decimal: December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using register pair Suppose the time interval in the system is 0.5µs, the delay in the loop is: The same time delay technique can be used to calculate the delay of nested loop delay technique (loop within a loop). December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using a loop within a loop A longer time delay can be achieved using two loops; one loop is inside the other loop. As shown in the instructions below, the C register is used in the inner loop (LOOP1) and the B register is used in the outer loop (LOOP2). Example: December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using a loop within a loop Figure 3 December 9, 2018 Dr. Masri Ayob: TK2633

Time delay using a loop within a loop Delay in the LOOP1 is equal to the previous example, TL1 = 1783.5µs. The second loop, LOOP2 is generated 56 times equivalent to 38H in B register. Delay calculation for LOOP2 is as follows: December 9, 2018 Dr. Masri Ayob: TK2633

Counter design with time delay Figure 4 December 9, 2018 Dr. Masri Ayob: TK2633

Counter design with time delay Rajah 5 December 9, 2018 Dr. Masri Ayob: TK2633

Counter design with time delay Example : Write a programme to count number from FFH to 00H in a system with time interval of 0.5 µs. Use C register as delay register with the delay of 1ms for every count. Display the count at the output port. Analysis: The hexadecimal counter is loaded in a register and decremented until zero is reached. After reaches zero the counter will start again at FFH. To get 1ms delay, one value will be loaded into register C, and the delay calculation is as shown in previous example. December 9, 2018 Dr. Masri Ayob: TK2633

Counter design with time delay MVI B, 00H NEXT DCR B MVI C, COUNT DELAY DCR C JNZ DELAY MOV A, B OUT PORT JMP NEXT December 9, 2018 Dr. Masri Ayob: TK2633

Counter design with time delay Delay calculation (TL delay in the loop) : December 9, 2018 Dr. Masri Ayob: TK2633

Exercise Write a program to turn a light ON and OFF every 2 seconds. Use data bit D7 (at OUTPORT) to operate the light. Logic ‘0’ will ON the light, whilst logic ‘1’ OFF the light. The clock frequency of the MPU is 2 MHz. December 9, 2018 Dr. Masri Ayob: TK2633

Thank you Q&A December 9, 2018 Dr. Masri Ayob: TK2633