Gunjeet Kaur Dronacharya Group of Institutions COUNTERS AND TIME DELAYS LECTURE 3.

Slides:



Advertisements
Similar presentations
8085 Architecture & Its Assembly language programming
Advertisements

The 8051 Microcontroller and Embedded Systems
8085 Architecture & Its Assembly language programming
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.
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
TK2633: MICROPROCESSOR & INTERFACING
Flow Control Instructions
8051 ASSEMBLY LANGUAGE PROGRAMMING
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.
8254 Programmable Interval Timer
8254 Counter/Timer Counter Each of the three counter has 3 pins associated CLK: input clock frequency- 8 MHz OUT GATE: Enable (high) or disable.
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
Computer Architecture Lecture 12 by Engineer A. Lecturer Aymen Hasan AlAwady 25/3/2014 University of Kufa - Information Technology Research and Development.
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
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
2/22/20161 Assembly Language (continue). 2/22/20162 Assembly Language Format LabelOpcodeOperandComment Start:LXISP,3FF0H;Initialize stack pointer DelimiterPlacement.
P ROGRAMMING T ECHNIQUES : L OOPING, C OUNTING AND I NDEXING L ECTURE 7 Gunjeet Kaur Dronacharya group of Institutions.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني 8085 Instruction Set logic group. Branch group. Stack memory and machine control. Addressing modes.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني 8085 Instruction Set Instruction types. data transfer group. Arithmetic group.
Seminar On 8085 microprocessor
8085 interrupts.
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
Interfacing Keyboard and Seven Segment Display Lecture 2
Assembly Language (continue)
Gunjeet Kaur Dronacharya Group of institutions
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
Detailed Review of the 8085 Instruction Set.
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
1. Introduction A microprocessor executes instructions given by the user Instructions should be in a language known to the microprocessor Microprocessor.
Counters & Time Delays.
Interfacing of LCD with µP
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 2
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 3 & 4 Part 1
8085 microprocessor.
The 8085 Microprocessor Architecture
Interfacing of stepper motor
Instruction Formats Each instruction consists of two parts:
EMT 348: Microcontroller Timer/counter
Additional data transfer and 16 bit arithmetic instruction Lecture 1
EMT 245: lecture 4: assembly language
Timer.
Detailed Review of the 8085 Instruction Set.
Introduction to Micro Controllers & Embedded System Design Addressing Mode Department of Electrical & Computer Engineering Missouri University of Science.
INSTRUCTION SET OF 8085.
Conditional Jumps and Time Delays
TK2633: MICROPROCESSOR & INTERFACING
Introduction to Micro Controllers & Embedded System Design Instruction set Department of Electrical & Computer Engineering Missouri University of Science.
Conditional Jumps and Time Delays
BLOCK DIAGRAM OF AN ADDRESS
CNET 315 Microprocessor & Assembly Language
Conditional Jumps and Time Delays
EECE.3170 Microprocessor Systems Design I
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.
EECE.3170 Microprocessor Systems Design I
Branch & Call Chapter 4 Sepehr Naimi
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:

Gunjeet Kaur Dronacharya Group of Institutions COUNTERS AND TIME DELAYS LECTURE 3

A counter is designed simply by loading appropriate number into one of the registers and using INR or DNR instructions. Loop is established to update the count. Each count is checked to determine whether it has reached final number ;if not, the loop is repeated. C OUNTER AND T IME D ELAYS

T IME D ELAY Procedure used to design a specific delay. A register is loaded with a number, depending on the time delay required and then the register is decremented until it reaches zero by setting up a loop with conditional jump instruction. Time delay using One register:

L ABEL O PCODE O PERAND C OMMENTS T STATES MVI C,FFH ;Load register C 7 DCR C ;Decrement C 4 JNZ LOOP ;Jump back to 10/7 decrement C Clock frequency of the system = 2 MHz Clock period= 1/T= 0.5 μ s Time to execute MVI = 7 T states * 0.5= 3.5 μ s Time Delay in Loop T L = T*Loop T states * N 10 = 0.5 * 14* 255 = 1785 μ s = 1.8 ms N 10 = Equivalent decimal number of hexadecimal count loaded in the delay register T LA = Time to execute loop instructions =T L –(3T states* clock period)= = μ s LOOP :

T IME D ELAY USING A REGISTER PAIR Label Opcode Operand Comments T states LXI B,2384H Load BC with 16-bit count 10 LOOP: DCX B Decrement BC by 1 6 MOV A,C Place contents of C in A 4 ORA B OR B with C to set Zero flag 4 JNZ LOOP if result not equal to 0, 10/7 jump back to loop Time Delay in Loop T L = T*Loop T states * N 10 = 0.5 * 24* 9092 = 109 ms Time Delay using a LOOP within a LOOP MVI B,38H 7T Delay in Loop T L1 = μ s LOOP2: MVI C,FFH 7T Delay in Loop T L2 = (0.5*21+T L1)* 56 LOOP1: DCR C 4T =100.46ms JNZ LOOP1 10/7 T DCR B 4T JNZ LOOP 2 10/7T

Flowchart for time delay with two loops

Flowchart of a counter with time delay

I LLUSTRATIVE P ROGRAM : H EXADECIMAL C OUNTER Write a Program to count continuously from FFH to 00H using register C with delay count 8CH between each count and display the number at one of the output ports. MVI B,00H NEXT: DCR B MVI C,8CH DELAY: DCR C JNZ DELAY MOV A,B OUT PORT# JMP NEXT

I LLUSTRATIVE P ROGRAM : Z ERO TO NINE (M ODULO TEN ) C OUNTER START: MVI B,00H MOV A,B DSPLAY: OUT PORT # LXI H,16-bit LOOP: DCX H MOV A,L ORA H JNZ LOOP INR B MOV A,B CPI 0AH JNZ DSPLAY JZ START Start Initialize counter Display Output Load Delay register Decrement Delay register Is Delay register=0? Next Count Is count =0AH? If yes, Initialize counter If no, Display Output

I LLUSTRATIVE P ROGRAM : G ENERATING PULSE WAVEFORMS Generates a continuous square wave with the period of 500 Micro Sec. Assume the system clock period is 325ns, and use bit D0 output the square wave. Delay outside loop: T0=46 T states * 325=14.95 micro sec. Loop delay: T L =4.5 micro sec Total Td=To+T L Count=34 H

D EBUGGING C OUNTER AND TIME DELAY PROGRAMS It is designed to count from 100(base 10) to 0 in Hex continuously with a 1 second delay between each count. The delay is set up using two loops. The inner loop is executed to provide approximately 100ms delay and is repeated 10 times, using outer loop to provide a total delay of 1 second. The clock period of system is 330ns.