beautypg.com

Measurement Computing CIO-DAS16 User Manual

Page 30

background image

Port C may be used as one 8-bit port of either input or output, or it may be split into two 4-bit ports which can be
independently input or output. The notation for the upper 4-bit port is CH3 to CH0, and for the lower, CL3 to CL0.

Although it may be split, every read and write to port C carries eight bits of data so unwanted information must be
ANDed out of reads, and writes must be ORed with the current status of the other port.

OUTPUT PORTS:

In 8255 mode 0 configuration, ports configured for output, hold the output data written to them. The output byte may be
read back by reading a port configured for output.

INPUT PORTS:

In 8255 mode 0 configuration, ports configured for input, read the state of the input lines at the moment, transitions are
not latched.

8255 CONTROL REGISTER

BASE ADDRESS +19

Group B

Group A

CL

B

M1

CH

A

M2

M3

MS

0

1

2

3

4

5

6

7

The 8255 can be programmed to operate in Input/Output (mode 0), Strobed Input/Output (mode 1) or Bi-Directional Bus
(mode 2).

When the PC is powered up or RESET, the 8255 is reset. This places all 24 lines in Input mode and no further
programming is needed to use the 24 lines as TTL inputs.

To program the 8255 for other modes, the following control code byte must be assembled into an 8-bit byte.

Bi-Directional Bus

Mode 2

X

1

Strobed Input/Output

Mode 1

1

0

Input/Output

Mode 0

1

0

GROUP A FUNCTION

M2

M3

MS = Mode Set. 1 = mode set active. M1 = 0 is mode 0 for group B. Input / Output. M1 = 1 is mode 1 for group B.
Strobed Input / Output

Output

0

0

0

0

Input

1

1

1

1

INDEPENDENT

FUNCTION

CH

CL

B

A

The Ports A, B, C High, and C Low may be independently programmed for input or output.

26

This manual is related to the following products: