Specifications
CONFIG Commands - 9
CONFIG PIO
Statement
SYNTAX: CONFIG PIO init,port A,port B, port LC, port UC [,address]
PURPOSE: To initialize an 82C55 parallel I/O IC.
REMARKS: The 82C55 parallel I/O IC has four I/O ports. Each port can be programmed as input or output.
They are defined as follows:
Port A 8 bits 0 to 7
Port B 8 bits 0 to 7
Port LC 4 bits 0 to 3
Port UC 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. When an input port is changed to an output
port, the 82C55 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 parameters 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
CAMBASIC 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 and B will have high outputs.
ERROR: <Data negative> – for address, init, port directions
<Data > 65,535> – for address