Parallel port programming

15
PARALLEL PORT PROGRAMMING Problems and solution

description

 

Transcript of Parallel port programming

Page 1: Parallel port programming

PARALLEL PORT PROGRAMMING

Problems and solution

Page 2: Parallel port programming

PARALLEL PORT PHYSICAL APPEARANCE

MALE PARALLEL PORT

FEMALEPARALLEL PORT

SERIAL PORT(MALE)

Page 3: Parallel port programming

PARALLEL PORT TECHNICAL DISCRIPTION

Page 4: Parallel port programming

PROBLEM IN PARALLEL PORT PROGRAMMING

The N2PK VNA connects to the computer via a printer port. When a printer port is used for purposes other than talking to a printer, it's a common convention to call the printer port a parallel port. It's a parallel I/O (input/output) port, where software running on the computer can change output port signals, and can read the data values present on input port signals. For many applications and devices, this is a simple, functional, and complete interface.

From the early days of DOS and then leading up through Windows ME, the home versions of Windows platforms allowed all programs to freely access the parallel ports. In fact, each program could freely run wild over other programs and the devices present on the computer.

Folks who work with operating system software usually do not like this wide open approach, since a single bug in a single program can crash the whole system, and there is no security (privacy) between applications. The traditional solution, employed for decades, is to use computer CPU hardware that supports two or more modes of operation, based upon a privilege model. The core operating system (kernel) is allowed full privileges, and individual application programs have a set of restrictions on what they are allowed to do. The typical minimum restrictions are that the program can only access memory which is part of the program itself, and that the program communicates to the outside world through a set of calls made to the operating system. The enforcement of privileges is not voluntary or on the honor system. As each instruction is executed by the computer, the hardware checks to make sure that the instruction is allowed for the current privilege level. Software cannot escape or ignore the mechanism.

Page 5: Parallel port programming

When a program does something wrong, something it does not have permission to do, the operating system is handed control of the matter. At this point, there are many possible alternatives. The simplest is that the program is abruptly terminated. No doubt you have seen that behavior from time to time. In some cases, the program is informed that it has committed some sort of violation. The program may be able to work around the problem, probably expecting that this might happen (it planned ahead).

In order to have a higher degree of protection/security, and less chance of endless crash and reboot cycles, the Windows platforms targeted for business users, Windows NT, Windows 2000, and now Windows XP, have always used a hardware protection mechanism. The actual CPU chips, whether Intel, or AMD, or some other brand, have had support for privilege levels for many years. Some versions of Windows simply chose to not use them. Thankfully, the home and business product lines merged with Windows 2000, so the number of alternatives and approaches has gone down.

  The good news is that our computers crash less. The bad news is that for the more

recent operating systems, a normal application program can no longer directly access the hardware devices on the computer. This includes the printer port(s).

To read and write to the parallel port is needed driver (*. sys file) to communicate with hardware device software.

Page 6: Parallel port programming

SOLUTION

There are many programs and hacks are used for this. I am telling about two of them and describe

one of them which was used by me in my project.

1. Parallel Port Debug Tool

http://www.beyondlogic.org/pardebug/pdebug.htm

2. User port

http://www.brothersoft.com/userport-download-122645.html

**MANGAL.EXE(this program can used to test the parallel port o/p.

www.thoughtcrackers.blogspot.com

Page 7: Parallel port programming

The most important file is to use for parallel port is to know the port no.!!

The Parallel Port is the most commonly used port for interfacing home made projects. This port will allow the input of up to 9 bits or the output of 12 bits at any one given time, thus requiring minimal external circuitry to implement many simpler tasks. The port is composed of 4 control lines, 5 status lines and 8 data lines. It's found commonly on the back of your PC as a D-Type 25 Pin female connector. There may also be a D-Type 25 pin male connector. This will be a serial RS-232 port and thus, is a totally incompatible port.

Page 8: Parallel port programming

Newer Parallel Port’s are standardized under the IEEE 1284 standard first released in 1994. This standard defines 5 modes of operation which are as follows,

1. Compatibility Mode. 2. Nibble Mode. (Protocol not Described in this Document) 3. Byte Mode. (Protocol not Described in this Document) 4. EPP Mode (Enhanced Parallel Port). 5. ECP Mode (Extended Capabilities Mode).

Page 9: Parallel port programming

PIN DESCRIPTION & BASE ADDRESS

Page 10: Parallel port programming

The Parallel Port has three commonly used base addresses. These are listed in table 2, below. The 3BCh base address was originally introduced used for Parallel Ports on early Video Cards. This address then disappeared for a while, when Parallel Ports were later removed from Video Cards. They has now reappeared as an option for Parallel Ports integrated onto motherboards, upon which their configuration can be changed using BIOS.

LPT1 is normally assigned base address 378h, while LPT2 is assigned 278h. However this may not always be the case as explained later. 378h & 278h have always been commonly used for Parallel Ports. The lower case h denotes that it is in hexadecimal. These addresses may change from machine to machine.

Page 11: Parallel port programming

HOW TO USE USER PORT

press add button 2

if you want to use except default address . Write port address.For example to use data pins in parallel port write (378h-37fh)

1

3Click update

Press start 4

Page 12: Parallel port programming

After this user port will open the desired ports for you so that communication will become possible.

Now to test it you can download “MANGAL .EXE” just click the file it will generate o/p through parallel port.

This utility is very useful for making computer controlled (robots etc.)projects.

For example to you programmed your robot that when bit sequence “ 00110010” it moves forward.

Here you can use this utility how??

Page 13: Parallel port programming

“00110010” why I said “2” for understanding this you should

refer to ASCII code table. What are ACII codes?? well in simple language by

using ASCII code table ( strictly in the context of our “mangal.exe”) you will come to know the digital equivalents of keyboard keys.

For right & technical information do a bit googling on this topic.

Use 25 pin parallel port cable for o/p . Choose or find digital equivalent which works for

your projects.

decimal 50 press “2” at your computer key board

Page 14: Parallel port programming

UNINSTALLING USER PORT

Page 15: Parallel port programming

THANK YOU MANGAL DAS

WWW.THOUGHTCRACKERS.BLOGSPOT.COM

SHARE THE KNOWLEDEGE