Appendix B
Register-Level Programming — Port C Status-Word Bit Definitions for Bidirectional Data Path (Port A Only)
PCI-DIO-96/PXI-6508/PCI-6503 User Manual
B-28
ni.com
Figure B-11 shows the port C pin assignments on the digital I/O connector when port C is
configured for mode 2. Notice that the port C status word does not include the status of
STBA* or the status of ACKA*.
Figure B-11.
Port C Pin Assignments on I/O Connector when Port C is Configured for Mode 2
Mode 2 Bidirectional Bus Programming Example
The following example shows how to configure PPI A for mode 2 input and output.
Write (8255Cnfg, 0xC0)
Set mode 2—port A is bidirectional
Write (8255Cnfg, 0x09)
Set PC4 to enable the INTRA status
flag for input
Write (8255Cnfg, 0x0D)
Set PC6 to enable the INTRA status
flag for output
Loop until the INTRA (PC3) status flag is set, indicating the 82C55
is ready for a transfer
If IBFA (PC5) is set, read (PortA)If input buffer is full, read data
If OBFA* (PC7) is set,
write (PortA, data)
If output buffer is not full, write
data
PC7 OBFA*
PC6 ACKA*
PC5 IBFA
PC4 STBA*
PC3 INTRA
PC2 #
PC1 #
PC0 #
Group A
Group B
# The three port C lines associated with group B function based on the
mode selected for group B; that is, if group B is configured for mode 0,
PC<2..0> function as general-purpose I/O, but if group B is configured
for mode 1 input or output, PC<2..0> function as handshaking lines as
shown in the preceding mode 1 sections.