beautypg.com

Mode 1 strobed input programming example, Mode 1–strobed output, Figure 6-3. port c pin assignments on i/o connecto – National Instruments 6508 PCI-DIO-96 User Manual

Page 59: Mode 1 strobed input programming example -13, Mode 1–strobed output -13, Figure 6-3

background image

Chapter 6

Programming

© National Instruments Corporation

6-13

PCI-DIO-96 User Manual

At the digital I/O connector, port C has the pin assignments shown in
Figure 6-3 when in mode 1 input. Notice that the status of STBA* and
the status of STBB* are not included in the port C status word.

Figure 6-3. Port C Pin Assignments on I/O Connector when Port C Configured

for Mode 1 Input

Mode 1 Strobed Input Programming Example

The following example shows how to configure PPI A for mode 1
input.

Write (8255Cnfg, 0xB0)

Set mode 1—port A is an input.

Loop until IBFA (PC5) is set, indicating that data is

available in port A to be read

Read (PortA)

Now, read the data from port A

Mode 1–Strobed Output

Note:

For mode 1 examples, you must configure the don’t care bits appropriately
in the control word if you want to use the other ports in combination with
the example.

The control word written to the Configuration Register to configure
port A for output in mode 1 is shown in Figure 6-4. You can use bits
PC4 and PC5 of port C as extra input or output lines.

PC7

I/O

PC6

I/O

PC5

IBFA

PC4

STBA*

PC3

INTRA

PC2

STBB*

PC1

IBFB

PC0

INTRB

Group A

Group B