Professional Documents
Culture Documents
Exp 5 - 201101
Exp 5 - 201101
Exp 5 - 201101
Experiment 5
Basic I/O Interfacing II – 0 – 9 to 7-segment LED
Name of Student: _____________________________ Date: _____________
ID of Student: _______________________________
Objectives
• Become familiar with BGC-8088 board and its connection to a personal computer (PC).
• To understand the I/O operation and the principle of 7-segment LED.
• To understand the calculation of delay routine.
• To understand the I/O operation of 8255 mode 0 and the techniques of key counter .
Material Requirements
Reference Textbook
Theory
You can execute the experiment boards in BGC-8088 MICROENGINEER V3.4 by connecting from
50 pins PCI connector with a 50 pins IDC flatcable The Pin’s definition of 25*2 (50 pins) connector
of experiment boards is shown in Figure 4.1 in Experiment 4.
Procedure
Figure 5.1
2. Type the following program (Program 5.1) using notepad or other text editor.
3. Save the file as “display1.asm”.
4. Go to DOS mode.
5. Run the program “MASM”, to create the “display1.lst”, “display1.obj” and
“display1.exe”.
a. Go to the directory where you have saved the file “display1.asm”.
b. Type c:\masm\irvine\masm.
c. Follow steps 10 to 13 in Experiment 2 to obtain the file “display1.exe”.
6. To create a binary file type:
C:\MASM\8806\exe2bin display1.exe display1.bin
Program 5.1
7. A file called display1.bin will be created. Download the binary file to the target board.
(Follow step 9 as shown in Experiment 4).
2
Basic Microprocessor UCEC2054 Laboratory Experiment
8. You need to put mini-jumper to the position of right 3. The function of the jumper
in each position is as follow:
JP2-2
To enable the DIP switch
JP2-3
To enable the 7-segment display
JP2-4
To enable the matrix LED
JP2-5
To enable Switch 4
JP2-6
To enable Switch 1
JP2-7
To enable Switch 2
(14 marks)
____________________________________________________ (5 marks)
10. Refer to Figure 5.1 and Program 5.1, answer the following questions.
i. What is the function of 4511?
____________________________________ (3 marks)
[Total: 22 marks]
3
Basic Microprocessor UCEC2054 Laboratory Experiment
ii. Is the seven segment common cathode or common anode? What is the different
between these two?
__________________________________________________________________
__________________________________________________________________
(3 marks)
iii. Sketch the schematic diagram and build the truth table.
* Answers given.
(3 marks) (3 marks)
[Total: 9 marks]
4
Basic Microprocessor UCEC2054 Laboratory Experiment
a b c d e f g Display Data in
value hexadecimal
1 1 1 1 1 1 0 0 3F
0 1 1 0 0 0 0 1 06
1 1 0 1 1 0 1 2 5B
1 1 1 1 0 0 1 3 2F
0 1 1 0 0 1 1 4 66
1 0 1 1 0 1 1 5 6D
0 0 1 1 1 1 1 6 7C
1 1 1 0 0 0 0 7 07C
1 1 1 1 1 1 1 8 7F
1 1 1 0 0 1 1 9 67
1 1 1 0 1 1 1 A 77
1 1 1 1 1 1 1 B 7F
1 0 0 1 1 1 0 C 39
1 1 1 1 1 1 1 D 7F
1 0 0 1 1 1 1 E 79
1 0 0 0 1 1 1 F 71
[Total: 16 marks]
5
Basic Microprocessor UCEC2054 Laboratory Experiment
iv. If the IC 4511 is not use in this experiment, redraw the circuit design in Figure
5.1.what modification need to be done in the Program 5.1?
(3 marks)
__________________________________________________________________
__________________________________________________________________
(3 marks)
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
(3 marks)
[Total: 9 marks]
6
Basic Microprocessor UCEC2054 Laboratory Experiment
12. Type and load the BIN file of Program 5.2 to BGC-8088 board.
a. You may refer to step 2 to step 7 in this experiment.
b. Note: You need to put mini-jumpers, JP2-3, JP2-6 and JP2-7. (Refer to step 8).
c. The new circuit layout is shown in Figure 5.2
7
Basic Microprocessor UCEC2054 Laboratory Experiment
8
Basic Microprocessor UCEC2054 Laboratory Experiment
Figure 5.2
13. Press G command and try to understand Program 5.2. Explain the purpose of this
program.
________________________________________________________________________
________________________________________________________________________
(6 marks)
[Total: 6 marks]
9
Basic Microprocessor UCEC2054 Laboratory Experiment
14. Program 5.3 below was modified from Program 5.2 so that the 7-segment will display a
continuous count up when the SW1 is hold and count down when the SW2 is hold.
10