loading

Parallel Port

The Parallel Port module allows you to use RoboRealm to control the parallel port pins based on RoboRealm variables. The following is a brief discussion on the parallel port pins and its potential use.

The Parallel Port is an inexpensive way to communicate to external TTL 0-5V devices using your PC's parallel port. NOTE that if you are experimenting with new circuits you may want to purchase an external parallel port in case your wiring may not be correct. An external parallel port is much cheaper to replace than your motherboard!

The Parallel Port pins are divided into three groups of pins mean for difference purposes. The three sets are DATA (in/out), CONTROL (out) and STATUS(in). The DATA pins are meant for input and output of data (typically this was to send the printer the information to be printed). The CONTROL port was mean to output control information to the printer and the STATUS pins were inputs back from the printer to the PC meant to communicate things like 'out of paper', etc.

Each pin is used to literally communicate 1 bit of information. A pin is either a '0' or '1'. All pins can transmit information simultaneously in parallel as apposed to serially (one by one) as is done through a serial port. The standard parallel port is capable of sending 50 to 100 kilobytes of data per second.

The voltage level of an on pin is about 5volts and can be used to directly drive an LED. To test out your parallel port with RoboRealm you can configure you Parallel Port module as shown in the interface below, connect one end of an LED to pin3 (data2) and the other to pin25 (ground). As the image count increases the LED should blink on and off.

The parallel port can output/send 8 bits at a time and input 5 bits. On the more modern Standard Parallel Port (SPP) ports the 8 data pins can become input pins if the DIRECTION bit on the CONTROL port is set high. See below as to how to change this bit.

There are several versions of parallel ports beyond the original design. The Enhanced Parallel Port (EPP) was created by Intel, Xircom and Zenith in 1991. EPP allows for much more data, 500 kilobytes to 2 megabytes, to be transferred each second. The Standard Parallel Port (SPP) and has completely replaced the original design. Bidirectional communication allows each device to receive data as well as transmit it. Pins 18 through 25, originally just used as grounds, can be used as data pins also. This allows for full-duplex (both directions at the same time) communication. The Extended Capabilities Port (ECP) allows for bidirectional

Pin # Name Input/Output Bit Inverted
1
nStrobe
Out
Control-0
Yes
2
Data0
In/Out
Data-0
No
3
Data1
In/Out
Data-1
No
4
Data2
In/Out
Data-2
No
5
Data3
In/Out
Data-3
No
6
Data4
In/Out
Data-4
No
7
Data5
In/Out
Data-5
No
8
Data6
In/Out
Data-6
No
9
Data7
In/Out
Data-7
No
10
nAck
In
Status-6
No
11
Busy
In
Status-7
Yes
12
Paper-Out
In
Status-5
No
13
Select
In
Status-4
No
14
Linefeed
Out
Control-1
Yes
15
nError
In
Status-3
No
16
nInitialize
Out
Control-2
No
17
nSelect-Printer
Out
Control-3
Yes
18
Ground
Out
(Control-4)
No
19
Enable Bi-Directional Port
Out
(Control-5)
No
20-25
Ground
-
-
-

Keep in mind that the initial purpose of the parallel port was to interface the PC with a computer. So the pin name's will reflect that specific purpose. If you are using the parallel port to connect with your own devices the main quality of the pins that will be important to you will be whether they are input or output pins. I.e. if you using Pin 11 the "Busy" pin to input a bit of data from your circuit it does not have to reflect that your circuit is 'busy'.

Most of the bit values are logically on when the voltage level is high but 4 of the bits are swapped.

Note that interfacing directly with the Parallel Port using WinXP, Win2000, etc is not permitted by the OS. You need to have a system device driver to interface with the parallel port. RoboRealm uses the popular inpout32.dll from LOGIX4U to achieve this.

Interface

Instructions

1. Specify which variables should match to which bits on the parallel port. If no variable is selected you can toggle the checkbox for each pin manually. Changing the checkbox should change the appropriate pin on the parallel port. If a variable is selected you will need to select which bit within the variables value would represent the pin value. For example if your variable value is 2 and your selected bit is 1 then the appropriate pin would be 0. If the selected bit is 2 then the appropriate pin would be 1. Thus to send an 8 bit number across the parallel port you would select the bits as seen in the interface shot above.
2. Select the parallel port number. The default is LPT1

Note on some machines the parallel port address space is different. In RoboRealm the following address' are used in correlation to the LPTx dropdown. If your machine configuration is different you may have to specify a different parallel port in the dropdown menu than what you believe to be true in order to specify the correct address space. Note that RoboRealm assumes a default configuration. Virtual parallel ports and such will change that base configuration.

lpt1Data = 0x378
lpt1Status = 0x379
lpt1Control = 0x37a

lpt2Data = 0x278
lpt2Status = 0x279
lpt2Control = 0x27a

lpt3Data = 0x3bc
lpt3Status = 0x3bd
lpt3Control = 0x3be

You can check the LPT1 address used by your computer by right clicking on "My Computer", select "Manage", click on "Device Manager" subtree, then expand "Ports (COM & LPT), right click on the printer port (LPT1) and select "Properties". The I/O address is in the "Resources" tab. Note the first address only. Match that address with one above and select the appropriate LPT1-3 from the dropdown.

For more information


CodeProject - Controlling LEDs with Parallel Port
BeyondLogic - Interfacing the Standard Parallel Port
How Stuff Works - How Parallel Ports Work
CodeProject - Controlling LEDs

 New Post 

Parallel_Port Related Forum PostsLast postPostsViews
parallel port
Hi, I am a new user for this software. I really like ROBOREALM I am very happy and satisfied to see these many fea...
10 year 3 2691
motor speed or tracking speed.
Dear STeven, Many thanks for your earlier help i have one more thing here, i did suc...
10 year 15 3160
parallel port
I want to "read" the status of the parallel port pin #13 and based on it's status initiate an action. Can someo...
11 year 6 2968
Dir. & Step. Pin #
Hi All, How can I set the Dir. & Step. Pin # for the stepper motor drive Connected to the brake boa...
11 year 2 2639
VB script..
Can anybody guide me thru how or what should i write on my VB Script source program so that i could make an output to my buzzer...
13 year 2 3390
Controlling LED through parallel port
This is my first experiment with Roborealm. It is very simple i just want to control LED from from parallel port using Parallel_...
13 year 4 5507
Robot Soccer
m Having a single robot , a ball and a goal post in an arena. Camera is mounted on the top which gives the live fe...
14 year 5 3468
Newbie question
Hello all, I am currently trying to build a led pick and place machine, but in order to place the...
14 year 11 4416
running 3 unipolar stepper motor using parallel porting..
we are doing our special project.. and we are facing some problems in programming and how to interface the 3 unipolar stepper mo...
14 year 6 4004
parallel port motor control
i wanted to know how can u control motors using the parallel port using roborealm..plz help me.....
15 year 5 6964
Parallel port interface with multiple instance of roborealm
My objective is to create a robot........which travels in a black road with white background........and if there is a turn then...
15 year 3 4070