Omega Engineering IOP-241 用户手册

下载
页码 36
4.  Theory of Operation
4.1
I/O Port Description
The 24 digital I/O channels provided by the IOP-241 are grouped into three different ports
with each port containing eight digital I/O channels. These three ports are controlled via the
Data Port A Control Register, Data Port B Control Register and Data Port C Control Register.
In all three registers, each bit corresponds to one data line.  The Data Port A Control Register
is used to access data lines DATA7 - DATA0. The Data Port B Control Register is used to
access data lines DATA15 - DATA8. The Data Port C Control Register is used to access data
lines DATA23 - DATA16.  
All of the 24 I/O channels (DATA23 - DATA0) may be individually programmed for either
input or output.  Each data port is latched on a write to that particular port. Each I/O channel
may be programmed for input by writing a '1' to the appropriate bit in the corresponding data
port control register. The I/O channels are driven by an open-collector driver, therefore
writing a '1' will turn the open-collector output driver 'off'. When 'off', the open-collector
output driver is tri-stated.  Tri-stating the output driver of an I/O channel will allow that I/O
channel to be driven by another device.  An I/O channel which is configured for input may be
accessed by reading the appropriate data port control register. If a '0' is written to the
appropriate bit in the corresponding data port control register,  the channel may not be used
as input. The channel will be 'masked' and a '0' will always be read on the channel.
If an I/O channel is to be used as output, the appropriate data port control register should be
written. When a write operation is performed, the data is latched.  If a bit is written with a '0',
the open-collector output driver will be turned 'on' and the I/O channel will be driven to a
low voltage state. Writing a '1' to the appropriate bit will turn the open-collector driver 'off',
but a pull-up resistor will pull the particular I/O channel to a TTL high voltage level.
Upon reset of the IOP-241, the three data port control registers are all latched with a value of
FFh. This forces all 24 open-collector output drivers 'off' upon a system power-up or upon an
IOP-241 card insertion. Thus, all 24 I/O channels are configured as input by default. Care
should be taken prior to programming any of these I/O channels for output. The
open-collector drivers should not be turned 'on' (by writing a '0' to the appropriate bit of a
data port control register) if the I/O channel is driven by another device.  Driving the channel
low by latching a '0' into a bit of the data port control register may cause damage to the
peripheral, the host system or the IOP-241 card if the channel is also being driven by a
peripheral.
 IOP-241 Users Manual                                                                                                                       23