You are on page 1of 7

STUDENT DATE PERFORMED

SECTION/ GROUP RATING

Activity No. 12
Testing the Parallel and the Serial Port

Purpose
The purpose of this activity is to test the parallel port and the serial port using a
wrap plug (or a loop back) connector and a diagnostic software (i.e. fx.exe). During the
activity, the students will be familiarized with the functions of the pins in a parallel or
serial port. They will also be able to write a code in Turbo C++ to send data to the
parallel port.

Recommended Readings/ References


Upgrading and Repairing PC’s, 8th ed. Chapter 11- Communications and
Networking

Materials
• 1 Windows 98 startup disk • 1 unit PC System
• Diagnostic software • 8 pcs. LED’s
(i.e. fx.exe) • 1 wraplug or loopback connector
• Turbo C++ Compiler • 8 pcs. connecting wires

Procedures:
A. Testing the Parallel Port
1. Using a Loopback Connector
a. Connect the Loopback connector at the system’s parallel port.
b. Turn on the system and boot from the Windows 98 startup disk.
c. At A prompt, type fx and press <Enter> to run the diagnostic
software.
d. Choose “Diagnostic” option on the main menu and press <Enter>.
On the “Diagnostic Menu”, select the “Parallel Wire Test” and then
press <Enter>.

NOTE: You can make your own Loopback Connector by connecting


jumper wires to the following pins of a DB25-male connector.
Loopback Connector Pin
Connection
Pin 1 to pin 15
Pin 2 to pin 13
Pin 3 to pin 12
Pin 4 to pin 10
Pin 5 to pin 11
2. Writing a code to send data to the parallel port.
a. Connect the LED’s in the parallel port data pins (i.e. pins no. 2, 3, 4,
5, 6, 7, 8, 9) as shown in the figure below.

Parallel Port

b. Type and compile the code, test.cpp, listed below on a Turbo C++
Compiler. The code sends data to the parallel port making all LED’s
turned on and off after a key is pressed.

Test.cpp Source Code:


#include<stdio.h>
#include<conio.h>
#include<dos.h>
#define PORT 0x378
void main(void)
{
while(!kbhit())
{
clrscr();
printf("Sending the data to the Parallel's Port");
printf("Press any key to terminate!");
printf("All LED's on:\n");
outportb(PORT,0xff);
delay(1000);
printf("All LED's off:\n");
outport(PORT,0x00);
}
}
c. Edit the program test.cpp to follow the sequence in the table below.
Write your source code on the space provided below.

Pins
9 8 7 6 5 4 3 2 HEX
Sequence
1 1 1 1 1 1 1 1 1
2 0 0 0 0 0 0 0 1
3 0 0 0 0 0 0 1 0
4 0 0 0 0 0 1 0 0
5 0 0 0 0 1 0 0 0
6 0 0 0 1 0 0 0 0
7 0 0 1 0 0 0 0 0
8 0 1 0 0 0 0 0 0
9 1 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0

Source Code:
A. Testing the Serial port
1. Using a Loopback Connector
a. Connect the loopback connector at the system’s serial port (DB9-
male).

Loopback Connector
b. Insert the Windows 98 startup disk with fx.exe in the FDD and turn
on the computer.
c. At A prompt, type fx and press <Enter> to run the diagnostic
software.
d. Choose “Diagnostic” option on the main menu and press <Enter>.
On the “Diagnostic Menu”, select the “Serial Port Loop- Back Test”
and then press <Enter>.

NOTE: You can make your own Loopback Connector by connecting


jumper wires to the following pins of a DB9-female connector.
Loopback Connector Pin
Connection
Pin 2 to pin 3
Pin 7 to pin 8
Pin 1 to pin 4
Pin 4 to pin 6
Pin 6 to pin 9
Review Questions
1. What are the functions of the pins used in parallel port’s loopback connector?
How does the system read and write a byte on the parallel port?

2. What is the I/O Port Address? What addresses are used in the parallel port and
serial port?

3. Compare the parallel and serial port. Enumerate their characteristics/


differences. Which port have higher data rate?

4. What is the type of parallel port used in the system? Compare it with the other
standards.

5. Explain the concept behind the operation of a wrap plug or loopback


connector.
Observation

Conclusion

You might also like