Parallel Port Interfacing Part1

download Parallel Port Interfacing Part1

of 14

Transcript of Parallel Port Interfacing Part1

  • 8/6/2019 Parallel Port Interfacing Part1

    1/14

    PARALLEL PORT INTERFACING

    BY:LAXMAN BHAIA

  • 8/6/2019 Parallel Port Interfacing Part1

    2/14

    Parallel port is same as the printer port at the back side of your computer. It looks like asshown below:

    Interfacing through parallel port is very simple but very interesting also because of somemouth watering applications. But there are limitations in using the parallel port. And it is

    the limited data rates up to 1Mbps. As the name suggests, it is called parallel port becausedata transfer through it take place parallelly rather than serially. You will find parallel

    port at the back side of your CPU which looks like as shown above. Technically it isnamed as DB25 female connector. It consists in all 25 pins out of which there are 17 pins

    for input and 12 pins for output and 8 pins are grounded. There are three registersinternally that control the printer or parallel port. These are:

    1. Control register (4-bits)2. Status register (5-bits)3. Data register (8-bits)

    We can input through all three registers and output through only data and control

    registers. Each register have its own address and can be accessed using these addresses.First, I will explain the pin configuration of printer port. It is shown below:

  • 8/6/2019 Parallel Port Interfacing Part1

    3/14

    DATA PORT:

    ADDRESS PIN NUMBER PIN NAME BIT NAME

    Base + 0

    (e.g. 0x378)

    PIN 2 Data 0 0

    PIN 3 Data 1 1

    PIN 4 Data 2 2

    PIN 5 Data 3 3

    PIN 6 Data 4 4

    PIN 7 Data 5 5

    PIN 8 Data 6 6

    PIN 9 Data 7 7

    Base address : 0x378 or 0x278 (In hexadecimals)Generally it is 0x378. I will tell you the method of finding out this address.

    Data output pins are driven by 74LS374 octal latch, which capable of sourcing 2.6mAcurrent and sink24mA current. There is 2.2nF capacitor between each pin and the ground

    to reduce transients.Note : It is essential that any device does not try to pull the pins directly to ground. As

    this will cause 74LS374 to source more current than it could handle.

    S7

    10111213 123456789

    15 1416171819202122232425

    D7 D6 D5 D4 D3 D2 D1 D0

    S6 S5 S4 S3

    C3 C2 C1 C0

    Internal input/output

    Data register

    Control register

    Status register

    Control pins

    Data pins

    Status pins

    Grounded pins

    NOT of control NOT of status

  • 8/6/2019 Parallel Port Interfacing Part1

    4/14

    The input pins for the data registers are driven by 74LS244 tri-stated buffer. It isuninverted. The internal diagram of the parallel port is shown as follows:

  • 8/6/2019 Parallel Port Interfacing Part1

    5/14

    D0

    D1

    D2

    D3

    D4

    D5

    D6

    D7

    Q0

    Q1

    Q2

    Q3

    Q4

    Q5

    Q6

    Q7

    OUTPUT

    FILP FLOP

    74LS374

    D0 (2)

    D1 (3)

    D2 (4)

    D3 (5)

    D4 (6)

    D5 (7)

    D6 (8)

    D7 (9)

    S

    Y

    ST

    E

    M

    B

    U

    S E

    E

    INTERNAL DIAGRAM OF PARALLEL PORT

    Q0

    Q1

    Q2

    Q3

    Q4

    Q5

    Q6

    Q7

    D0

    D1

    D2

    D3

    D4

    D5

    D6

    D7

    OUTPUTFILP FLOP

    74LS244

  • 8/6/2019 Parallel Port Interfacing Part1

    6/14

    Now find out the address of the parallel port:

    Step 1: Go to My Computer icon on your desktop and right click over it using your

    mouse. Scroll down, go to properties and left click over it as shown below.

  • 8/6/2019 Parallel Port Interfacing Part1

    7/14

    Step 2: A window of system properties like shown below will appear. Now left click onthe hardware option.

  • 8/6/2019 Parallel Port Interfacing Part1

    8/14

    Step 3: A window like shown below will appear which shows three options, devicemanager, drivers and hardware profile. Now we have to left click on Device Manager.

  • 8/6/2019 Parallel Port Interfacing Part1

    9/14

    Step 4: now device manager window will open which shows all the devices that makes

    your computer. You will see an icon like this is present in front of which

    Ports (COM&LPT) is written. On clicking the respective options you can see all itsdetails. So, you have to just click on the plus sign.

  • 8/6/2019 Parallel Port Interfacing Part1

    10/14

    Step 5: As click on the plus sign, you will find some options according to yourcomputer as shown below:

    Now double click on Printer Port (LPT1).

  • 8/6/2019 Parallel Port Interfacing Part1

    11/14

    Step 6: You will find Printer Port (LPT1) window as shown below. Click on theResources option.

  • 8/6/2019 Parallel Port Interfacing Part1

    12/14

    Step 7: Here is your parallel ports address.Note: 0378 is the address in hexadecimal and it the address of the data port of the parallel

    port. Next three addresses i.e.; 0379, 037A and 037B are the addresses of the control port(037A) and status port (0379).

    Once you find it click OK.

  • 8/6/2019 Parallel Port Interfacing Part1

    13/14

    So, far the things are going so simple. Now lets move on to programming part. We are

    using Turbo C++ compiler to control our parallel port. Using this we can build

    programs to send data to parallel port and take input data from parallel port using

    commands outportb and inportb. Before moving ahead takes a small break andyes bring the multimeter as you come back from the break.If you dont have a multimeter then make a test device like the one shown below. this test

    device is very simple and made of very little number of components which are easilyavailable everywhere i.e. some LEDs and a parallel port connector and some resistances.

    10111213 123456789

    15 1416171819202122232425

    1K 1K 1K 1K 1K 1K 1K 1K

  • 8/6/2019 Parallel Port Interfacing Part1

    14/14

    Now you can attach this device to the parallel port. What you see is that all the LEDs areglowing.

    You can see that the two LEDs in the middle are glowing at low intensity. This isbecause the LEDs that I used to make this circuit were not of very good quality. So theintensity may vary even if all the conditions like applied voltage and series resistance etc.

    These LEDs shows that the voltage at all the pins is high. This voltage must be near to5V.

    We should use multimeter to measure the voltages at the port pins. If you use multimeter,notice the reading of voltage of each pin. When you apply the red probe of multimeter to

    data pins and black probe to grounds of parallel port while the multimeter is on dcvoltage measurement configuration, you will see a value at multimeter display.

    You know what this value is, yes 5V and on all ports. Why because by default when it isdisabled by windows it shows high on all ports. If you try to read values of this port fromTC, then the value you get is 255, which is equivalent to high on each pin.