![Ampro Little Board P6d Reference Manual Download Page 41](http://html1.mh-extra.com/html/ampro/little-board-p6d/little-board-p6d_reference-manual_2935324041.webp)
Little Board P6d Module
2-23
To change the port between input and output states, write a 1 to bit five of the control register to
set the port to its input state; or a 0 to set it to its output state. Here is a code sample for
dynamically changing the port direction (after it is in Extended Mode).
;----------------------------------------------------------
; Code to change the parallel port direction to input
;----------------------------------------------------------
MOV
DX,37A
IN AL,DX
OR AL,20h
;set bit 5 (input)
OUT
DX,AL
;
;----------------------------------------------------------
; Code to change the parallel port direction to output
;----------------------------------------------------------
MOV
DX,37Ah
IN AL,DX
AND
AL,0DFh
;clear bit 5
OUT
DX,AL
Using the Control Lines for Additional I/O
Besides the eight data lines, you can use the four control lines (STB*, AUTOFD*, INIT*, and
SELIN*) as general purpose output lines. Similarly, you can use the five status lines (ERROR*,
SLCT, PE, 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 pull-ups. To use a control line as an input line, you must first write to its
corresponding bit in the control register. 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 a line floats, you can
use it as an input.
Enabling the Parallel Port Interrupt
Bit 4 in the Control Register 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 parallel port interrupt, IRQ7. Table
2-22 lists the parallel port register bits. Parallel port register bit definitions are described in Table
2-23.
Summary of Contents for Little Board P6d
Page 6: ...vi...
Page 8: ...viii...
Page 18: ...1 10...
Page 90: ...3 10...
Page 92: ...A 2...
Page 94: ...B 2...
Page 98: ...Index Index 4...