Specifications

Software Configuration
3–23
the port to input only; a 0 sets it to output only. Here is a sample of code for dynamically changing the
port direction after it is in Extended Mode.
;----------------------------------------------------------
; Code to change the parallel port direction to input
;----------------------------------------------------------
MOV DX,37Ah ;(27Ah for LPT2)
IN AL,DX
OR AL,20h ;set bit 5
OUT DX,AL
;
;----------------------------------------------------------
; Code to change the parallel port direction to output
;----------------------------------------------------------
MOV DX,37Ah ;(27Ah for LPT2)
IN AL,DX
AND AL,0DFh ;clear bit 5
OUT DX,AL
Besides the eight data lines, you can use the four control lines (-STROBE, -AUTOFD, -INIT, and -SEL
IN) as general purpose output lines. Similarly, you can use the five status lines (-ERROR, SEL OUT,
PAPER EMPTY, -ACK, and BUSY) as general purpose input lines.
You can read the four control lines and use them as input lines. These lines have open collector drivers
with 4.7K ohm pullups. To use a control line as an input line, you must first write to its corresponding bit
in the control register. Refer to Table 3-9. If the line is inverting, write a 0, otherwise write a 1. This will
cause the line to float (pulled up by the 4.7K ohm resistors). When they float, you can use them as inputs.
Table 3-8 is a summary of the uses of the parallel port lines.
Signal
Type
Number
of Lines Function Output Drive
Data
Control
Status
8 lines
4 lines
5 lines
Read/Write
Read/Write*
Read Only
24 mA @ .5V
12 mA @ 2.4V
24 mA @.5V
4.7K PU
--
* Open collector control lines convert to TTL outputs in PS/2 and
EPP/ECP modes. Output under those conditions is 4 mA @
2.4V
Table 3-8 Parallel Port Use
Bit 4 in the control register (Table 3-9) enables the parallel port interrupt. If this bit is high 1, then a
rising edge on the -ACK (IRQ) line will produce an interrupt on the interrupt selected by W24, either
IRQ5 or IRQ7.