Parallel port programming

3,046 views
2,869 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,046
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
111
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Parallel port programming

  1. 1. Parallel port programming <br />Problems and solution<br />
  2. 2. Parallel port physical appearance<br />FEMALE<br />PARALLEL PORT<br />MALE PARALLEL PORT<br />SERIAL PORT<br />(MALE)<br />
  3. 3. PARALLEL PORT TECHNICAL DISCRIPTION<br />
  4. 4. PROBLEM IN PARALLEL PORT PROGRAMMING<br />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.<br />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. <br />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.<br />
  5. 5. 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).<br />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.<br /> <br />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).<br />To read and write to the parallel port is needed driver (*. sys file) to communicate with hardware device software. <br />
  6. 6. solution<br />There are many programs and hacks are used for this. I am telling about two of them and describe <br /> one of them which was used by me in my project.<br />1. Parallel Port Debug Tool<br />http://www.beyondlogic.org/pardebug/pdebug.htm<br />2. User port <br />http://www.brothersoft.com/userport-download-122645.html<br /> **MANGAL.EXE(this program can used to test the parallel port o/p.<br />www.thoughtcrackers.blogspot.com<br />
  7. 7. The most important file is to use for parallel port is to know the port no.!! <br />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. <br />
  8. 8. 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, <br /> 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). <br />
  9. 9. Pin description & base address<br />
  10. 10. 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. <br />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. <br />
  11. 11. How to use user port<br /> if you want to use except default address . Write port address.<br />For example to use data pins in parallel port write (378h-37fh)<br />1<br />2<br /> press add button <br />3<br />Click update <br />Press start <br />4<br />
  12. 12. After this user port will open the desired ports for you so that communication will become possible.<br />Now to test it you can download “MANGAL .EXE” just click the file it will generate o/p through parallel port.<br />This utility is very useful for making computer controlled (robots etc.)projects.<br />For example to you programmed your robot that when bit sequence “ 00110010” it moves forward.<br />Here you can use this utility how??<br />
  13. 13. “00110010”<br /> why I said “2” for understanding this you should refer to ASCII code table.<br />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.<br />For right & technical information do a bit googling on this topic.<br />Use 25 pin parallel port cable for o/p .<br />Choose or find digital equivalent which works for your<br /> projects.<br />decimal<br />50<br /> press “2” at your computer key board<br />
  14. 14. Uninstalling user port<br />
  15. 15. Thank you MANGAL DASwww.thoughtcrackers.blogspot.com<br />SHARE THE KNOWLEDEGE<br />

×