Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Basic Microprocessor UCCE2043 Laboratory Experiment 4

Experiment 4
Basic I/O Interfacing I – Racing Light
Name of Student: _____________________________ Date: _____________

ID of Student: _______________________________

Objectives
• Become familiar with BGC-8088 board and its connection to a personal computer (PC).
• Learn to use the Microenginner program on the PC for communications via the serial port.
• To understand the principle of 8255 mode 0.
• To understand the control of racing light.
• To understand the program design of racing light

Material Requirements

BGC 8088 MICROENGINEER V3.5


No. EDS 8806 basic I/O experiment board.
50 pins IDC flat-cable
RS232- cable
8088/86 instruction set
Microengineer communication software
MASM

Reference Textbook

Introduction To BGC-8088 MICROENGINEER User’s Guide.


Triebel W. A., Singh A., The 8088 and 8086 Microprocessors: Programming, Interfacing,
Software, Hardware, and Applications (4th Edition), Prentice Hall (2002).
Ytha Yu, Charles Marut, Assembly Language Programming and Organization Of the IBM PC.

Theory

Refer to lecture note Chapter 6 titled “I/O Interfacing for Microprocessor”

You can execute the experiment boards in BGC-8088 MICROENGINEER V3.4 by connecting from 50
pins PCI connector with a 50 pins IDC flat cable. The Pin’s definition of 25*2 (50 pins) connector of
experiment boards is shown in Figure 4.1
Basic Microprocessor UCCE2043 Laboratory Experiment 4

Figure 4.1

Procedure

1. The related circuit is shown in Figure 4.2.


2. Type the following program (Program 4.1) using notepad or other text editor.
3. Save the file as “run.asm”.
4. Go to DOS mode.
5. Run the program “MASM”, to create the “run.lst”, “run.obj” and “run.exe”.
a. Go to the directory where you have saved the file “run.asm”.
b. Type c:\masm\irvine\masm.
c. Follow steps 10 to 13 in Experiment 2 to obtain the file “run.exe”.
6. Exit from the Irvine-MASM IDE.
7. Make sure you are in the directory where your files “run.asm” and “run.exe” reside.
8. To create a binary file type:
C:\8806\exe2bin run.exe run.bin

2
Basic Microprocessor UCCE2043 Laboratory Experiment 4

; file name : run.asm


CODE SEGMENT
ASSUME CS:CODE
MOV DX,0FF13H
MOV AL,89H
OUT DX,AL
MOV DX,0FF10H
BEGIN: MOV AL,01H
MOV_L: OUT DX,AL
MOV CX,4FFFH
LOOP $
ROL AL,1
TEST AL,80H
JZ MOV_L
MOV AL,80H
MOV_R: OUT DX,AL
MOV CX,4FFFH
LOOP $
ROR AL,1
TEST AL,01H
JZ MOV_R
JMP BEGIN
CODE ENDS
END
Program 4.1

Figure 4.2

3
Basic Microprocessor UCCE2043 Laboratory Experiment 4

9. A file called run.bin will be created. To download the binary file to the target board, follow
the following steps:
i. Make sure the BGC-8088 power is switched off.
ii. Connect the BGC-8088 board to COM1 of the PC using RS232 cable.
iii. Connect the 50 pins IDC flat-cable to EDS 8806 basic I/O experiment board.
iv. Switch BGC8088 power on and press ‘L’.
information
Syntax: l [<Address>]
- used to store the data transmitted from PC into BGC-8088
MICROENGINEER with memory addressed in <Address>. In
case <Address> is omitted, the default address is 0100:0000.
The following will display on the LCD screen

Figure 4.3
v. Click “Microengineer’s Data Transfer System” to execute the software

Figure 4.4
vi. Select “BGC=8088 to communicate with BGC-8088.
vii. Select the adequate serial port form “Serial port Selection”
viii. Click OK to continue
ix. Click the following <...> button to select the files to be downloaded.

4
Basic Microprocessor UCCE2043 Laboratory Experiment 4

Figure 4.5

x. Click <Download> button to start the data transmission (Download).


xi. The following dialog box appears once the transmission is finished.

Figure 4.6

xii. At the BGC-8088 board, the byte number of transmitted data is displayed on LCD :
TRANSFER 00027H BYTES

8. Press G command. Identify the function of G command and what is happening after the G
command executed?
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________

(5 marks)

[Total: 5 marks]

5
Basic Microprocessor UCCE2043 Laboratory Experiment 4

9. Refer to Figure 4.2, answer the following questions.


i. What is the function of 74LS244?
__________________________________ (5 marks)

ii. How to enable this IC?


__________________________________ (5 marks)

iii. What is the function of 74LS04?


___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
__________________________________ (5 marks)

11. What is the operation mode of 8255 in this experiment?


__________________________________ (5 marks)

12. Why is the purpose of the following instructions?

LOOP $ __________________________________ (5 marks)

ROL AL,1 Shift __________________________________ (5 marks)

TEST AL,80H to
_________________________________________________________________________
____________________________________________ (5 marks)

13. The design of the program in Program 4.1 is not very efficient. Do you agree? Comment.

_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
__________________________________ (5 marks)

_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
__________________________________ (5 marks)

[Total: 45 marks]

6
Basic Microprocessor UCCE2043 Laboratory Experiment 4

14. If you agree with the statement in question 10, rewrite the program in Program 4.1.

(25 marks)

[Total: 25 marks]
7
Basic Microprocessor UCCE2043 Laboratory Experiment 4

15. Redesign the Program 4.1 so that the LED1 (LD1) blinks for 10 times follow by LED2
(LD2) and so on in rotating sequence. Print out the list file
For the purposes of submission, print out the list file and demo to your lecturer.

___________________________________________________________________________

(25 marks)

[Total: 25 marks]
8

You might also like