Parallel port tutorial Male Connector Æ D0 – D7 Data pins (8) S3 – S7 Status pins (5) C0 – C4 control pins (4) Rest all pins are grounded Female connector Æ (on computer) Copyright ® IIT Guwahati Robotics Club
Sending Commands to the Port:
Sending commands involves only the data pins [D0 to D7 ] #include <dos.h> void main(){ outportb(0x378,0xFF);}
(FF)16 = (1111 1111)2
Copyright ® IIT Guwahati Robotics Club
Sending Commands to the Port:
Copyright ® IIT Guwahati Robotics Club
Connect to motor: H bridge circuit 5V (for IC)
12V (for motor)
Copyright ® IIT Guwahati Robotics Club
L293D
Driving the DC motor:
outportb(0x378,0x00);--------outportb(0x378,0x03);--------outportb(0x378,0x01);--------outportb(0x378,0x02);--------Copyright ® IIT Guwahati Robotics Club
STOP STOP MOVE MOVE
MOTOR MOTOR Break! MOTOR(CCW) MOTOR(CW) .
Some tips
Windows XP doesn’t allow to directly access the parallel port so we have to use third party drivers which opens the specific ports. One such software is Userport. http://www.embeddedtronics.com/public/Electronics/minidaq/userport/UserPort.zip
Generally the address of the parallel port is 0x378-0x37F. If not the check its address in the specific port properties in device manager.
Copyright ® IIT Guwahati Robotics Club