Config pio – Remote Processing CAMBASIC User Manual

Page 183

Advertising
background image

CON FIG C ommands - 10

CONFIG PIO

Statement

SYNTAX:

CONFIG PIO init,port A, port B, p ort LC, port UC [,address]

PURPOSE:

T o in it ia l iz e an 8 2C 5 5 pa r a ll e l I / O IC .

REMARK S:

The 82C 55 para llel I/O IC has fou r I/ O por ts. E ach por t can be pr ogram med as inp ut or output.
They ar e defined as follows:

Port A

8 bits

0 to 7

Port B

8 bits

0 to 7

Port LC

4 bits

0 to 3

P o r t U C

4 bits

4 to 7

The init parameter is the value you want output ports to be after the command is executed.

The 82C55 initializes itself to all inputs on power– up. W hen an input port is changed to an output
port, the 82C 55 forces all the bits to a low state. When it drives devices such as opto– isolator
modules, this would be undesirable as all the modules would turn on. Specifying “ 1” will make the
ports go high; specifying “0” will make the outputs go low. The inputs will be unaffected.

Port A - UC are direction parameter s and are specified as “1” for an input port and “0” as an output
port.

The address parameter is the base address of the chip. You normally do not specify an address since
CAM BASIC will use the default of 0.

RELATED:

none

EXAMPLE:

10 CONFIG PIO 1,0,0,1,1

This configures an 82C55 at the address default to have ports A and B as outputs. Ports UC and LC
are inputs. Ports A a nd B will have high outputs.

ERROR:

<

Data negative

>

– for address, init, port directions

<

Data > 65,535

>

– for address

Advertising