Sie sind auf Seite 1von 5

Microprocessors & Microcontrollers (CBE/Tr) 9-1 8255 PPI

9.9 Data Transfer Operation through Centronix Parallel


Printer
It is nothing but commonly used 36 pin connector for personal computer to printer
interfacing.   The  parallel   printer   interface   (LPT)  is  located   on  the  rear  of   the  personal
computer, where LPT means line printer. Using this interface, 8 parallel data lines can be
programmed to send or receive data. e.g. sending ASCII character to printer.
The   printers   using   this   36­pin   interface   are   called   Centronics­type   printers.  
e.g. EPSON­FX­100. 
The pins of connector can be broadly divided into 
Data pins  Ground pins Signal pins
Specially of this connector is that;
each   data   line   has   its   own   individual
return   line.   This   reduces   chance   of
picking   up   electrical   noise   in   the   lines.
But   this   also   increases   the   number   of
lines for the connector to 36.
Fig.   9.9.1   and   Fig.   9.9.2   shows
actual   size   CENTRONICS   36   pin
connector and connections made for
parallel port.  m(9.25)Fig. 9.9.1

Signa Return Signal Directio Description


l Pin Pin No. n
No.
1 19 –––––––––– IN STROBE pulse to read data in. Pulse width must be more than 0.5 s at
– receiving terminal. The signal level is normally “high”; read-in of data is
performed at the “low” level of this signal.
2 20 DATA 1 IN
3 21 DATA 2 IN
4 22 DATA 3 IN
5 23 DATA 4 IN These signals represent information of the 1st to 8th bits of parallel data
respectively. Each signal is at “high” level when data is logical “1” and
6 24 DATA 5 IN
“low” when logical “0”.
7 25 DATA 6 IN
8 26 DATA 7 IN
9 27 DATA 8 IN
10 28 –––––––––– OUT Approximately 5 s pulse; “low” indicates that data has been received
– and the printer is ready to accept other data.
11 29 BUSY OUT A “high” signal indicates that the printer cannot receive data. The signal
Microprocessors & Microcontrollers (CBE/Tr) 9-2 8255 PPI

Signa Return Signal Directio Description


l Pin Pin No. n
No.
becomes “high” in the following cases :
1. During data entry 3. In “offline” state
2. During printing operation. 4. During printer error status.
12 30 PE OUT A “high” signal indicates that the printer is out of paper.
13 – SLCT OUT This signal indicates that the printer is in the selected state.
14 – –––––––– IN With this signal being at “low” level, the paper is automatically fed one line
–––––––––– after printing. (The signal level can be fixed to “low” with DIP SW pin 2-3
–– provided on the control circuit board.)

15 – NC Not used.
16 – OV Logic GND level.
17 – CHASISGND – Printer chasis GND. In the printer, the chassis GND and the logic GND
are isolated from each other.
18 – NC – Note used.
19-30 – GND – “Twisted-Pair Return” signal; GND level.
31 – –––––– IN When the level of this signal becomes “low” the printer controller is reset
to its initial state and the print buffer is cleared. This signal is normally at
“high” level, and its pulse width must be more than 50 s at the receiving
terminal.
32 – ––––––––– OUT The level of this signal becomes “low” when the printer is in “Paper End”
state, “Offline” state and “Error” State.
33 – GND – Same as with pin numbers 19 to 30.
34 – NC – Not used.
35 – VCC Pulled up to +5 Vdc through 4.7 k-ohms resistance.
36 – –––––––––– IN Data entry to the printer is possible only when the level of this signal is
– “low”. (Internal fixing can be carried out with DIP SW 1-8. The condition at
the time of shipment is set “low” for this signal.)

Fig. 9.9.2 : Pin connection and discription for centronix-type interfacing

Notes : 1. “Direction” refers to the direction of signal flow as viewed from the printer.
2. “Return” denotes “Twisted-Pair Return” and is to be connected at signal-ground level.
When wiring the interface, be sure to use a twisted-pair cable for each signal and never
fail to complete connection on the return side. To prevent noise effectively, these cables
should be shielded and connected to the chassis of the system unit.
3. All interface conditions are based on TTL level. Both the rise and fall times of each signal
must be less than 0.2 s.
Microprocessors & Microcontrollers (CBE/Tr) 9-3 8255 PPI

4. Data transfer must not be carried out by ignoring the ––––––––––or BUSY signal. (Data
transfer to this printer can be carried out only after confirming the ––––––––––signal or
when the level of the BUSY signal is “low”.
In cable for a parallel printer, all ground return lines are connected together.
Signal pins of the connector are of two types.
Control lines (DC to printer) e.g. –––––– pin 31
Status lines (printer to PC) e.g. ––––––––––– pin 1
–––––––––––  –  (pin 1) if goes low for at least 0.5 s means data is send.
The major status signal from printer (bar indicate active low)
–––––––––––  –  (pin   10)   goes   law   means   previous   character   accepted   and   the
interface is ready  for next character.
BUSY  –  (pin   11)   at   high   state   means,   printer   is   not   ready   to   receive   next
character.
SLCT  –  (pin 13) at high state means, printer is selected
––––––––––  –  (pin 32) goes low means problem condition in printer.
For  communication between the printer  and  computer,  the 8255 PPI  is used  in  
mode 1. The data transfer is controlled by handshaking signals. The handshaking signals
are used to transfer data between devices whose data transfer speeds are not the same.
e.g. a computer can send data to the printer with a large speed, but printer can’t accept
data   and   print   data   at   this   rate.   Such   a   data   transfer   is   achieved   by   using   the
handshaking signals along with the data signals. These signals tell the computer whether
the printer is ready to accept data or not, if printer is ready to accept data then after
sending the data on the data bus, the computer uses another handshaking signal  –––to
tell the printer that valid data is available on the bus. The two ports A and B can function
as 8 bit I/O ports. Each port uses port C signals as handshaking signals. It also supports
interrupt.
The process of communication between the printer and the computer is as follows : 
 The computer sends  the INIT pulse for at least 50 s, to initialise the printer.
 The computer then checks for BUSY signals. If the BUSY signal is low (i.e. printer is
not busy), then the computer sends an ASCII code on eight parallel data lines and
after 0.5 s, it sends ––– signal to indicate that the data is available on the data bus.
 The computer also checks that data is present on the data bus atleast for 0.5  s, after
the ––– signal is disabled.
 The printer on receiving a character, asserts the ––– signal low, to indicate that data
is   received.   The   rising   edge   of  –––  tells   computer   that   it   can   receive   the   next
character. It also resets BUSY signal.
 If the BUSY signal is low, the computer sends the next character along with strobe
and this sequence is continued till the last character is transferred.
Fig. 9.9.3 shows the circuit for interfacing centronix type parallel input printer to
the 8255 and Fig. 9.9.4 shows timing diagram.
Microprocessors & Microcontrollers (CBE/Tr) 9-4 8255 PPI

m(9.26) Fig. 9.9.3 : Interfacing centronix printer to 8255

m(9.27) Fig. 9.9.4 : Timing waveforms for the data transfer

The port A is used as an output port, to send the 8 bit data to the printer. It is used
in mode 1, so the PC 6 (–––) is used as a ––– signal to indicate that data is available on the
data bus. PC7  is used as  –––  signal.  ––––––, PE and BUSY signals are connected to the
PB2, PB1 and PB0 of the 8255.
Microprocessors & Microcontrollers (CBE/Tr) 9-5 8255 PPI

Flowchart for printer interface.

m(9.28) Fig. 9.9.5

Das könnte Ihnen auch gefallen