Mode 0 Basic I/O Programming Example
The following example shows how to configure PPI A for mode 0 input and output.
Write (8255Cnfg,0x80)
Write (PortA, Data)
Write (PortB, Data)
Write (PortC, Data)
Write (8255Cnfg,0x90)
Write (PortB, Data)
Read (PortA)
Mode 1—Strobed Input
For mode 1 examples, you must configure the don't care bits appropriately in the
Note
control word if you want to use the other ports in combination with the example.
In mode 1, the digital I/O bits are divided into two groups: group A and group B. Each of
these groups contains one 8-bit port and one 3-bit control/data port. The 8-bit port can be
either an input or an output port, and the 3-bit port is used for control and status information
for the 8-bit port. Handshaking signals in the 3-bit port synchronize the transfer of data.
Figure B-4 shows the control word written to the Configuration Register to configure port A
for input in mode 1. You can use bits PC6 and PC7 of port C as extra input or output lines.
© National Instruments Corporation
Set mode 0—ports A, B, and C are outputs
Write data to port A
Write data to port B
Write data to port C
Set mode 0—port A is Input;ports B and
C are outputs
Write data to port B
Read data from port A
D7
D6
D5
D4
1
0
1
1
Figure B-4. Control Word to Configure Port A for Mode 1 Input
Appendix B
Register-Level Programming — Programming
D3
D2
D1
1/0
X
X
Port C bits PC6 and PC7
1 = Input
0 = Output
B-19
PCI-DIO-96/PXI-6508/PCI-6503 User Manual
D0
X