Documente Academic
Documente Profesional
Documente Cultură
Microprocessor Interfacing
Fall 2007 Semester
Final
Total Time: 3 Hours
Total Marks: 120
Course Instructor: Dr. Waseem Ikram, Engr. Umair Ahsan,
Engr. Naveed Ul Mustafa
3. Exam is closed books, closed notes. Please see that the area in your threshold is
clean. You will be charged for any material which can be classified as ‘helping in
the paper’ found near you.
5. The invigilator present is not supposed to answer any questions. If there is any
missing parameter, write down your assumption and continue.
1 2 3 4 5 6 7 8 Total
10 15 13 17 15 15 15 20 120
Figure 1
Q.2. Latches (74LS373) are used for buffering and de-multiplexing the 8088 processor
address-data bus. The 373 chip and the pin function table are shown in fig 2.
An 8 MHz processor with a single Wait state supports a memory with access time
of 440 nsec.
c. The 8 Mhz processor is replaced by a slower 5 Mhz processor. Will the processor
be able to access the RAM? Briefly explain with the help of calculations. [5]
Q.4. A small 8088 based system is designed to control the operation of a washing
machine. The specifications are as follows.
The washing machine control program is permanently burned into a 4 KB
ROM chip
A 2 KB RAM chip is used to support the 1 KB Interrupt Vector table and for
storing variables such as water temperature, wash load, amount of detergent
and some other program variables
Two PPI chips are also interfaced through which the processor controls the
operation of the washing machine and senses the wash cycle variables
Future enhancements in the control program have been allowed for by
increasing the size of RAM and ROM chips.
b. Write down the address decoding table for the four devices. The two PPI’s are
memory mapped. Address decoding allows for doubling the size of RAM and
ROM for future enhancements. [6]
Mark Distribution
The ID of the device doesn’t relate to its priority. Any of the two devices could
have the highest priority. The priority depends on the external hardware priority
circuit which allow the INTA* signal to activate the highest priority device first.
Q.6.
a. Write an assembly language program that sets the rightmost four bits of AX; clears
the leftmost three bits of AX and invert bits 7,8 and 9 of AX. [5]
or ax, 000F h
and ax, 1FFF h
xor ax, 0380 h
.code
mov dx, offset file [1]
mov al, 0
mov ah, 3d h [1]
int 21 h [1]
jc error [1]
mov fpointer, ax [1]
jmp exit [1]
error: mov errcode, ax [1]
exit:
Q.7. 82C55 is the common PPI IC used when interfacing devices with 8086. Assume a
device attached to 8086 via 82C55 in bidirectional bus mode. Programming and
hardware details of the 82C55 are given below.
b. Write assembly code that reads data from the device, adds FFH and transmits the
data back to the device. The processor uses the programmed IO method to access
the device and transfer data. [10]
Q.8. Two remotely placed 8051 microcontrollers are connected to each other through a
serial link. A hex keypad connected to one 8051 is used to key in a number which
a. Draw a block diagram showing the connections of the first 8051 to the hex
keypad and the second 8051 to the 7-segment display. Ports should be clearly
mentioned and the correct number of bits used for connecting the devices should
be clearly drawn and labeled. [8]
b. Write 8051 assembly code which initializes the 8051 to transmit and receive at
9600 baud. FD is the count value for 9600 bauds. Timer 1 is used as a baud rate
generator. [6]
Used to program the start bit, stop bit and data bits
SM0 & SM1 Serial Mode bits set to 01
o Serial Mode 1, 8-bit data, 1 Start bit, 1 Stop bit
SM2 Enables multiprocessor capability SM2 = 0
REN Receive Enable set to 1 to enable receiving of data
TI, Transmit Interrupt raised to 1 to indicate it is ready to transmit more data
RI, Receive Interrupt raised to 1 to indicate byte received