0% found this document useful (0 votes)
61 views3 pages

D D D D R R: Elays and Elays and Elay Elay Outines Outines

The document discusses different methods for creating delays in software on the 8085 microprocessor. It describes delays created using NOP instructions, a single 8-bit register, a single 16-bit register, two 8-bit registers, one 8-bit and one 16-bit register, and two 16-bit registers. For each method it provides the maximum delay duration possible at a clock frequency of 3MHz, ranging from 1.332 microseconds for NOP to over 9 hours for two 16-bit registers.

Uploaded by

Ramu Kaka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
61 views3 pages

D D D D R R: Elays and Elays and Elay Elay Outines Outines

The document discusses different methods for creating delays in software on the 8085 microprocessor. It describes delays created using NOP instructions, a single 8-bit register, a single 16-bit register, two 8-bit registers, one 8-bit and one 16-bit register, and two 16-bit registers. For each method it provides the maximum delay duration possible at a clock frequency of 3MHz, ranging from 1.332 microseconds for NOP to over 9 hours for two 16-bit registers.

Uploaded by

Ramu Kaka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

8085 M I C R O P R O C E S S O R !"#$#% #'"#$(# )*+'#%,-.

Cell: 98204 08217


BharatSir@hotmail.com

DELAYS AND DELAY R OUTINES


OUTINES
Delays in a computer system can be of two types:
1) Hardware delays
2) Software delays

HARDWARE DELAYS SOFTWARE DELAYS


1 Caused by external hardware (Timer IC Caused by a software delay routine
like 8254) (program)
2 µP is not involved in causing the delay µP is busy as it is executing the delay
and hence is free for other applications. routine so cannot be used otherwise.
3 Multiple delay routines are possible Multiple delay routines are not possible
4 Flexibility is low as h/w is involved. Flexibility is high as delay caused by s/w.
5 External h/w required so ckt. becomes External h/w not required so ckt. is
more complex and expensive simple and less expensive

SOFTWARE DELAYS

Software delays are produced in programs by one of the various software "Delay Routines".
Routines".

As the amount of delay required varies from application to application different types of delay
routines are present, as follows:

1) Using NOP Instruction


2) Using One 8-bit register
3) Using One 16-bit register
(Nested delay routines):
4) Using Two 8-bit registers
5) Using One 8-bit register and One 16-bit register
6) Using Two 16-bit registers

1) Using NOP Instruction

Eg: NOP;

1-byte instruction
Opcode fetch --- 4 T-states.
TD = 4T.
T = 1/(Clk freq)
! assuming 8085 working at 3 MHz, T = 1/(3 MHz) = 0.333 µ sec.
! T D = 4 " 0.333 = 1.332 µ sec.

TD = 1.332 sec.
This is the maximum delay that can be achieved by writing a NOP instruction.

2) Using One 8-bit register

Delay: B, 8-bit count


MVI B, 7T
Loop: DCR B 4T
NT MT
JNZ Loop 10 / 7T
RET 10T
8085 M I C R O P R O C E S S O R !"#$#% #'"#$(# )*+'#%,-.
Cell: 98204 08217
BharatSir@hotmail.com

NT = No of T-states inside the loop {here NT = 10T + 4T = 14T}


MT = No of T-states outside the loop {here MT = 7T + 10T = 17T}
Count max = 255 {8-bit count in decimal}
TD max = 17T + [255 " 14T] – 3T
TD max = 3584T.
assuming 8085 working at 3 MHz i.e. T = 333 n sec.

TD max = 1.18 m sec.

3) Using One 16-bit register

Delay: LXI B, 16-bit count 10T


Loop: DCX B 6T
MOV A, C 4T
NT MT
ORA C 4T
JNZ Loop 10/7T
RET 10T

TD = MT + [(Count) d NT] – 3T


here NT = 6T + 4T + 4T + 10T = 24T
MT = 10T + 10T = 20T
Count max = 65535 {16-bit count in decimal}
TD max = 20T + [65535 " 24T] – 3T
TD max = 1572057T.
assuming 8085 working at 3 MHz i.e. T = 333 n sec.

TD max = 0.525 sec.

4) Using Two 8-bit registers

Delay: MVI C, Count2 7T


Loop2: MVI B, Count1 7T
Loop1: DCR B 4T
NT
JNZ Loop1 10/7T MT PT
DCR C 4T
JNZ Loop2 10/7T
RET 10T

TD = PT + [(Count2) d Tloop1] – 3T


Tloop1 = MT + [(Count1) d NT] – 3T

NT = No of T-states inside loop1 {here NT = 4T + 10T = 14T}.


MT = No of T-states outside loop1 but inside loop2 {MT = 7T + 4T + 10T= 17T}
PT = No of T-states outside loop2 {here PT = 10T + 7T = 17T}.
Count1 max = 255 {8-bit count in decimal}
Count2 max = 255 {8-bit count in decimal}

TD max = 914954T.
assuming 8085 working at 3 MHz i.e. T = 333 n sec.

TD max = 0.304 sec.


8085 M I C R O P R O C E S S O R !"#$#% #'"#$(# )*+'#%,-.
Cell: 98204 08217
BharatSir@hotmail.com

Summary:

Delay Method Max duration


NOP 1.332 µ sec
One 8-bit register 1.18 m sec
One 16-bit register .525 sec
Two 8-bit registers .304 sec
One 8-bit / one 16-bit reg 133.69 sec
Two 16-bit register 9 hrs, 32 min, 24 sec

 Please Note: All these calculations are w.r.t. 8085 operating at 3 MHz.
 In case in the exam, the frequency is different then calculate 1T = 1/(Clk. freq.), and then calculate the
appropriate delay. ! In case of doubts, contact Bharat Sir: - 98204 08217.

You might also like