Write an assembly language program to interfacing 8253 Timer with 8086 in mode 0.
Theory:The Intel 8253 is a Programmable Interval Timers (PITs), which perform timing and counting functions.
The 8253/54 solves one of most common problem in any microcomputer system, the generation of accurate time delays under software control. Instead of setting up timing loops in system software, the programmer configures the 8253 to match his requirements, initializes one of the counters of the 8253 with the desired quantity, then upon command the 8253 will count out the delay and interrupt the CPU when it has completed its tasks. 8253/54 can be operated in 6 different modes with the use of Control word Register
Procedure:



Apparatus:Dyna 8086 microprocessor kit and PPI card (8253).
| Address | Opcode | Mnemonics Operand | Comments |
| 1000 | B0 7F | MOV AL, 07FH | Unmask IRQ 7 |
| 1002 | E6 02 | OUT 02 (OCW1) ,AL | Send OCW1 |
| 1004 | FB | STI | Enable Interrupts |
| 1005 | B0 30 | MOV AL,30H | Binary counter_0 selected, mode 0 read / load LSB first & then MSB |
| 1007 | E6 33 | OUT 33 (CMD_PORT_53), AL | Out the content of AL to CMD_PORT_53 |
| 1009 | B0 05 | MOV AL, 05H | Load 05 to 16 bit counter |
| 100B | E6 30 | OUT 30 (COUNTER_0), AL | Counter_0 LBS |
| 100D | B0 00 | MOV AL, 00H | Load control word 00H |
| 100F | E6 30 | OUT 30 (COUNTER_0), AL | Counter_0 MSB |
| 1011 | E4 30 | IN AL, 30 (Counter_0) | Read_LSB |
| 1013 | 8A D0 | MOV DL, AL | Move AL to DL |
| 1015 | E4 30 | IN AL, 30 (Counter_0) | Read MSB |
| 1017 | 8A F0 | MOV DH, AL | Move AL to DH |
| 1019 | EB 0D 10 | JMP 1101 | JMP 1101 Jump to address 1011 |
Result: LED1will glow after 5 pulser compression key as shown in figure below.

Viva Questions:
Procedure for writing and compiling program through μ vision keil :
Software environment and microcontroller description:
Procedure to write the program in μ Vision Keil:
Right click on “Source Group1” to add the file as: (Add file to group “Source Group 1”)
Get all latest content delivered to your email a few times a month.