Instruction manual

Table Of Contents
PC215E Page 22
4.2.12 8-Bit Bi-Directional Bus
In mode 2 it is possible for an 82C55 PPI device to transfer data in two directions through a
single 8-bit port. In this mode, Port C handles the necessary control signals, Port A becomes
the 8-bit bi-directional port, and Port B is free to be programmed (with Group B) for basic input
or basic output operation. Please refer to the manufacturer's 82C55 data sheet included in the
appendices of this manual for a full description of the bi-directional bus operation mode of the
82C55 device.
Section 6.6.12 describes function DIOsetBiDirectionalBus which programs a given PPI chip for
this mode of operation. The PPI's Port C bit 3 interrupt source is used to generate PC215E
interrupts, which will occur when either
a) the device's Output Buffer is empty and ready for another data byte to write to
the Port A bus, or
b) the device's Input Buffer contains a data byte received from the Port A bus.
Two data buffers are required by the function: one which contains output data to be sent to Port
A (byte by byte) whenever a 'write' interrupt occurs, and another empty buffer into which in-
coming data will be stored (byte by byte) whenever a 'read' interrupt occurs. Please note that
functions enableInterrupts and disableInterrupts must be called to enable and disable these
interrupts.
Care must also be taken when connecting the Port C control signals to other devices on the bi-
directional bus.