EXPERIMENT 6 : Timers, Interrupts and Built-in Services

OBJECT:

The object of this experiment is to investigate timers, interrupts and built-in services.

REFERENCE:

Gaonkar, R.S., Microprocessor Architecture, Programming and Applications with the

8085/8080A. Chapter 12, Chapter 14.

PRELIMINARY WORK :

a) Write a subroutine called DECSHOW that decrements E register by 1 in BCD and display DE register pair on 7-segment display using
MVI C,12H
CALL 1000H

b)Write a main program and interrupt service routine to implement traffic lights demonstration using the experiment kits,
* Assign D0 bit of the LEDs (address 11H) to green, D1 to yellow and D2 to red light,
* Light sequence is as follows:
- green for 60 seconds, if the time left is less than 10 seconds make D0(green light) blinking, i.e. OFF for a second and ON for a second (state 1)
- yellow for 3 seconds (state 2)
- red for 30 seconds (state 3)
- red+yellow for 3 seconds (state 4)
- return to state 1 and continue in the same way
* Display the time left on the seven-segment display at each state.
* Obtain 1 second time duration using 8155 timer and INT 7,5 interrupt.
* Information about timer as an interrupt source:
- 8155 timer generates INT 7,5 when both timer high and timer low registers are zero.
- Timer low addresses : 14H
- Timer high addresses : 15H
- Control word address: 10H
- Timer in (clock of timer): 307,2 KHz
- Use timer in mode 1 described in reference book on pp426.
- Control word definition for this experiment:
D7 D6 D5 D4 D3 D2 D1 D0
1    1    0    0    0     0    0    1   (To use timer in reloading mode, i.e. load timer with the initial value when counter reaches zero and make this operation continuously)
- INT 7,5 properties: Service routine address written to FFE9H and FFEAH addresses,
To get service routine address you can use following code segment in your program:
LXI H, [Label of the service routine]
SHDL 0FFE9H

- Examine the following examples in the reference book:

12.1 (pp 374), 12.2 (pp 374), 12.23 (pp 377), 14.24 (pp 425)

and the example given in this link

Note: Reference book pages are given according to 4th edition.

EXPERIMENTAL WORK :

Execute the main program written in preliminary work.