|   | ||||||||
![]() |
||||||||
|   | ||||||||
|
||||||||
|
Well, well, well..I finally got to it..my first tutorial that is. The trouble was to find something to write a tutorial on..well..err..frankly I could think of no subject on which I was an expert enough to teach someone. But to keep my promise here is the first one of the lot. I've always been interested in both hardware and software, so my first one contains something of both. 1.Port ProgrammingThis is more on the lines of a data sheet rather than a tutorial. The programs are the only saving grace. Two sorts of ports on a PC that offer a world of experimentation to the casual electronics buff are the parallel port and the game port. The serial port requires some more programming skill but is not that difficult. First I will describe the easier ones and gradually we may even go inside our computer and have fun with the ISA slot (if there are still any left around). i) Parallel portThe parallel port aka printer port is specified on Windows machines usually as LPT1 or LPT2 while on Linux machines it may be usually either /dev/lp0, /dev/lp1. Whatever the name, on PCs its common base address is 0x378 assuming you have only one printer port. Somewhere I read that the addresses 0x3BC and 0x278 are also allotted for printer ports. If in Windows check System Information to find out the address on your machine. For our purpose I will assume it to be 0x378..since that's the one on my machine ;-) The only parallel port that I got to study was the 8255 programmable port. However I could find no relationship between that and the one available on my PC. Frankly, it is the research that followed that has led me to write this. The printer port on your system would more likely be a 25 pin female D-connector. Here is the pin details:
A low state corresponds to 0V and high to 5V. According to IBM specifications pins 1,14,16 and 17 (control pins) have open collector drivers pulled to 5V through 4.7k resistors (sink 20 mA, source 0.55 mA, high-level output 5.0 V minus pullup). The others sink 24 mA, source 15 mA, and their high level output is min. 2.4 V. The max. low state volt for both is 0.5 V. For each port we need to know three addresses
BASE+2 : Control Word   Write only
Now that we have mentioned the basic hardware interface of the parallel port we can move ahead to making some use of all this info. We will try to write some programs utilizing the port in the next tutorial.
|
  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|   | |
|   | |
|   Tested on IE 6.0 , Netscape 4.7, Mozilla 1.0 | Best on 800x600 |
|   mail me | |