0% found this document useful (0 votes)
107 views10 pages

Week 4 Peripheral Interfacing - 8254

The document discusses interfacing an 8085 microprocessor with an 8254 Programmable Interval Timer/Counter chip to generate a 1 KHz square waveform using Counter 1. It provides the port addresses and control word values needed to configure the 8254 in Mode 3 for square wave generation with a count value of 2000 (07D0H) and clock frequency of 2MHz.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views10 pages

Week 4 Peripheral Interfacing - 8254

The document discusses interfacing an 8085 microprocessor with an 8254 Programmable Interval Timer/Counter chip to generate a 1 KHz square waveform using Counter 1. It provides the port addresses and control word values needed to configure the 8254 in Mode 3 for square wave generation with a count value of 2000 (07D0H) and clock frequency of 2MHz.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Peripheral interfacing: Programmable Interval Timer/Counter (8254)

Time delay program


8254 Pin diagram Block diagram
Interfacing 8085 with 8254
Control register/Control word
Write an assembly language program in 8085 microprocessor which generates
1 KHz square waveform by using counter 1 as a binary counter if clock
frequency of 8254 is 2 MHz.

 Assume the port addresses are Control Register (CR):


C0(Counter 0): 80 H,
C1(Counter 1): 81 H,
C2(Counter 2): 82 H,
CR(Control Register): 83 H
 8254 must work in Mode 3 which is the square wave generator.
 Count for register = Clock frequency / square wave frequency count
= 2 MHz / 1 KHz
= 2000 = 07D0 H
 the data is 16 bit so value of RW1 = 1 and RW0 = 1
 For C1 (Counter 1) the value of SC1 = 0 and SC0 = 1
 For Mode 3, M2 = 0, M1 = 1 and M2 = 1
 For binary counter value of LSB in CR is 0
Assembly language program:

MVI A 76 : content of CR(Control Register) to register A.


OUT 83 : load CW to 83H/Control Register.
MVI A D0 : load lower byte of data of Counter 1 to register A.
OUT 81 : assign the value of A to port 81/Counter 1.
MVI A 07 : load higher byte of data of Counter 1 to register A.
OUT 81 : assign the value of A to port 81/Counter 1.
HLT : end the program.

You might also like