IBM Parallel port Pin Descriptions (Wire name) for each pin number.

wheatauditorSoftware and s/w Development

Oct 30, 2013 (3 years and 11 months ago)

66 views

1.

IBM Parallel port Pin Descriptions (Wire name) for each pin number.

2.

25
-
way Female D
-
Type Connector and Port Configurations

3.

IBM
-
PC Parallel Printer Port Registers

4.

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

5.

8255A BASIC OPERATION

6.

8255A Pin Configuration


IBM
Parallel port Pin Descriptions (Wire name) for each pin number.

Data transmissions via Parallel Port

Pin Assignments of Parallel Port (LPT1)

Female DB25 on PC


<= In

or

=> Out

DB25 Pin

Centronics
Pin

Signal

Registry Bit

Function Notes

=> out

1

1

-
Strobe

C0
-

Set Low p1ulse >0.5 us to send

=> out

2

2

Data 0

D0

Set to least significant data

=> out

3

3

Data 1

D1

...

=> out

4

4

Data 2

D2

...

=> out

5

5

Data 3

D3

...

=> out

6

6

Data 4

D4

...

=> out

7

7

Data 5

D5

...

=> out

8

8

Data 6

D6

...

=> out

9

9

D
ata 7

D7

Set to most significant data

<= in

10

10

-
Ack

S6+

IRQ; Low Pulse ~ 5 uSeconds, after
accept

<= in

11

11

+Busy

S7
-

High for Busy/Offline/Error

<= in

12

12

+Paper
End

S5+

High for out of paper

<= in

13

13

+Select In

S4+

High for printer selected

=> out

14

14

-
Auto Fd

C1
-

Set Low to auto feed one line

<= in

15

32

-
Error

S3+

Low for Error/Offline/Paper End

=> out

16

31

-
Init

C2+

Set Low pulse > 50uS to init

=> out

17

36

-
Select

C3
-

Set Low to select printer

==

18
-
25

19
-
30,33,17,16

Ground

-

Do
not connect any of these
grounds to a shield

Note:


Some cables, ports, or connectors may not connect all grounds. Centronics pins 19
-
30 and 33
are "twisted pair return" grounds, while 17 is "chassis ground" and 16 is "logic ground"


"<= In" and "=> Out"
are defined from the viewpoint of the PC, not the printer. The IRQ line (
-
Ack/S6+) is positive edge triggered, but only enabled if C4 is 1.

Interfacing to the

IBM
-
PC Parallel Printer Port


The original IBM
-
PC's Parallel Printer Port had a total of
12

digi
tal

outputs

and
5

digital

inputs

accessed via 3 consecutive 8
-
bit ports in the processor's I/O space.



8 output pins accessed via the
DATA Port




5 input pins (one inverted) accessed via the
STATUS Port




4 output pins (three inverted) accessed via the
CONTR
OL Port




The remaining 8 pins are grounded



25
-
way Female D
-
Type Connector


-------------------------------------------------------------------------------------------
----------------


IBM
-
PC Parallel Printer Port

Registers & Pinouts

Registers (
-

unavailable)




Pinouts




Register DB
-
25 I/O

Signal Name Bit Pin Direction

=========== ======== ===== =========

-
Strobe ¬C0 1 Output

+Data Bit 0 D0 2 Output

+Data Bit 1 D1

3 Output

+Data Bit 2 D2 4 Output

+Data Bit 3 D3 5 Output

+Data Bit 4 D4 6 Output

+Data Bit 5 D5 7 Output

+Data Bit 6 D6 8 Output

+Data Bit 7 D7 9 Output

-
Acknowledge S6 10 Input

+Busy ¬S7 11 Input

+Paper End S5 12 Input

+Select In S4 13 Input

-
Auto Feed ¬C1 14 Output

-
Error S3 15 Input

-
Initialize

C2 16 Output

-
Select ¬C3 17 Output


Ground
-

18
-
25
-


(Note again that the S7, C0, C1 & C3 signals are inverted)








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

*/



#include <stdi
o.h>

#include <dos.h>


#define Data 0x378

#define Status 0x379

#define Control 0x37a


unsigned char Bits;


outportb(Data,Bits); /* output data */


Bits = inportb(Status); /* input data */



8255A BASIC OPERATION

A
1

A
0

___
RD

___
WR

___
CS

INPUT OPE
RATION
(READ)

0

0

0

1

0

PORT A


DATA BUS











PORT B


DATA BUS











PORT C


DATA BUS
















OUTPUT OPERATION
(WRITE)

0

0

1

0

0

DATA BUS


PORT A











DATA BUS


PORT⁂











DATA BUS



PORT C











DATA BUS


CONTROL
















DISABLE FUNCTION

X

X

X

X

1

DATA BUS


㌠3TATE











ILLEGAL CONDITION











DATA BUS


㌠3TATE








8255A Pin Configuration



+
--------
\
/
--------
+


1
-
|pa3

pa4|
-

40


2
-
|pa2 pa5|
-

39


3
-
|pa1 pa6|
-

38


4
-
|pa0 pa7|
-

37


5
-
|/rd /wr|
-

36


6
-
|/cs reset|
-

35


7
-
|gnd d0|
-

34


8
-
|a1 d1|
-

33


9
-
|a0 d2|
-

32

10
-
|pc7 8255A d3|
-

31

11
-
|pc6 d4|
-

30

12
-
|pc5 d5|
-

29

13
-
|pc4 d6|
-

28

14
-
|pc0 d7|
-

27

15
-
|pc1 vcc|
-

26

16
-
|pc2 pb7|
-

25

17
-
|pc3 pb6|
-

24

18
-
|pb0 pb5|
-

23

19
-
|pb1 pb4|
-

22

20
-
|pb2 pb3|
-

21


+
------------------
+