Human Factors of XR: Using Human Factors to Design XR Systems
Report 2 microp.(microprocessor)
1. Date: 29/10/2013
Al-Azhar University-Gaza
Faculty of Engineering & Information Technology
Microprocessors & Interfacing
(ITCE 3306)
Experiment no. 2
LEDs with parallel port
Prepared By:
Ronza sameer Abu jayyab
No. 20111511
Submitted To:
Eng. Mahmoud Hasanain
First semester
2013/2014
Introduction :
In this lab we will talk about who can connect any device in our personal
computer and controls by using visual basic program.
2. Objective :
Understand how 7-segment display works by generating read out
screen.
Understand and utilize the concept of multiplexing.
Background:
software programs
Visual Basic is a third-generation event-driven programming language and integrated
development environment (IDE) from Microsoft for its COMprogramming model
first released in 1991. Microsoft intends Visual Basic to be relatively easy to learn and
use. Visual Basic was derived fromBASIC and enables the rapid application
development (RAD) of graphical user interface (GUI) applications, access
to databases using Data Access Objects, Remote Data Objects, or ActiveX Data
Objects, and creation of ActiveX controls and objects. The scripting
language VBScript is a subset of Visual Basic.
A programmer can create an application using the components provided by the Visual
Basic program itself. Programs written in Visual Basic can also use the Windows
API, but doing so requires external function declarations. Though the program has
received criticism for its perceived faults, version 3 of Visual Basic was a runaway
commercial success, and many companies offered third party controls greatly
extending its functionality.
1. ParallelPrinterportbasic:
A. Which is the parallel port of my computer?
See the Figure1 below, parallel port of computer.
Figure(1):
ParallelPrinterPortDB25FemaleConnector
B. Connectors and Cables:
The parallel port of the computer uses a DB-25S female connector with 25 pincontacts, located on the rear panel of the computer. Of the 25 contacts, 17 are used for
3. the signal lines, and 8 as ground lines [1].The signal lines are divided into three
groups:
1. Control (4 lines).
2. Status (5 lines).
3. Data (8 lines).
C. Port assignment:
Each printer port consists of three port addresses; data, status and control port.
These addresses arein sequential order. That is, if the data port is at address
0x0378,
the
corresponding
statusportisat0x0379andthecontrolportisat0x037a.Thefollowingis typical in table 1.
LPT (line print terminal) is the usual designation for a parallel port connection to a
printer or other device on a personal computer. Most PCs come with one or two
LPT connections designated as LPT1 and LPT2. Some systems support a third,
LPT3. Whatever the number, LPT1 is the usual default. You can add a parallel port
for a second printer or other device by buying and adding a parallel port
adapter card to your computer.
Printer
LPT1
LPT2
LPT3
DataPort
03bch
0378h
0278h
Status
03bdh
0379h
0279h
Control
03beh
037ah
027ah
Table1 : LPT (line print terminal)
Using debug disply the activated port:
Fig_1.1
Fig_1.1 , shows that the data port is activated
Data port [0378]
Breadboard :_
A breadboard is a reusable, solderless device that allows building a
prototype circuit,
4. Fig_2
Requirements:
Hardware:
1- Computer .
2- Wires .
3- Breadboard .
4- Switches .
Software:
Visual basic program.
Experiment steps :
• At first we Connect the LEDs circuit then we will connect it with parallel port .
• Connect the Breadboard we have with the computer with power supply.
• Create a visual basic program that do a specific task which we have by it order the
device what to do.
• Adding NTPORT to your Visual Basic program so you can connect your circuit
with parallel port in your PC.
• After the installation of NTPOT.OCX , In order to use NTPORT control in your
Visual Basic project it must be added to the tool box. To do this, select Project from
the Visual Basic main menu. From the Project drop-down menu select Components.
A similar Components dialog box will appear as shown below.
Load NTPORT
5. The 1st experiment ( lighting 8- LEDs with pp):
This experiment light all LEDs by using our visual basic program
A. The control circuit:
We'll connect LEDs with resister and decoder in Breadboard
by wires then connect this circuit with PP to connect it in
PC.
B. The Code:
Private sub form_load(1)
Ntport1.address= 888
End sub
Private sub command1_click()
Ntport.value = 225
End sub
Private sub command2_click()
Ntport.value = 0
End sub
6. The 2nd experiment (lighting LEDs with pp):
Light LDEs which turn off by using timer order in visual basic to do it in
sequence.
The Code:
Dim i as integer
Private sub form_load(1)
Ntport1.address= 888
End sub
Private Sub Timer1_Timer()
Timer1.Value = i
If i = 0 Then
i = 255
Else
i=0
End If
End Sub
Private sub command1_click()
Ntport.value = 225
End sub
Private sub command2_click()
Ntport.value = 0
End sub
7. The 3rd experiment (light LEDs with pp):
In this experiment we have 8 LEDs we want to light it one after the other by using
timer order in visual basic.
The Code:
Dim i as integer
Private sub form_load(1)
Ntport1.address= 888
End sub
Private Sub Timer1_Timer()
ntport1.Value = 2^i
i=i+1
if i=8 then
i=0
End If
End Sub
Referances:
[1]http://en.wikipedia.org/wiki/Visual_Basic