Custom Search

Parallel Port- Robotics







Parallel Port :

What is Parallel Port ? Why is it needed ?


Parallel port is used for short distance communication since no. of wires are required and many no.of bits are send at a time.

(Just turn ur C.P.U.and u will see a 25 pin female port. This is the parallel port.)We use parallel port(printer port) because other than monitor we don’t have any output devices.


That’s why we remove the printer and moreover the pins in this port generates pulses which help in the functioning of stepper motor and we have to use them for short range communication.



How to access parallel port pins in the software.


Parallel port is assigned a unique I/O address which is generally among the following:


i) 378h (mostly the case)


ii) 278h (normally found when there are more than one parallel ports)


iii)3BCh (Rare case)

The original IBM-PC's Parallel Printer Port had a total of 12 digital outputs and 5 digital inputs accessed via 3 consecutive 8-bit ports in the processor's I/O space.


See fig. on top





S- Status pins,
C- Control pins,
D- Data pins

I/O Port Access in Turbo C, Borland C/C++

Turbo C and Borland C/C++ provide access to the I/O ports on the 80x86 CPU via the predefined functions inportb / inport and outportb / outport.

int inportb(int portid); /* returns a byte read from the I/O port portid */


int inport(int portid); /* returns a word read from the I/O port portid */


void outportb(int portid, unsigned char value); /* writes the byte value to the I/O port portid */


void outport(int portid, int value); /* writes the word value to the I/O port portid */

Free Domains Hosting at .co.nr