English
Language : 

MC68HC901 Datasheet, PDF (36/73 Pages) Motorola, Inc – Multi-Function Peripheral
SECTION 5
GENERAL PURPOSE INPUT/OUTPUT PORT
The general purpose input/output (I/O) port (GPIP) provides eight I/O lines (I0 through I7)
that may be operated as either inputs or outputs under software control. In addition, these
lines may optionally generate an interrupt on either a positive transition or a negative
transition of the input signal. The flexibility of the GPIP allows it to be configured as an 8-bit
I/O port or for bit I/O. Since interrupts are enabled on a bit-by-bit basis, a subset of the GPIP
could be programmed as handshake lines or the port could be connected to as many as
eight external interrupt sources, which would be prioritized by the MFP interrupt controller
for the interrupt service.
5.1 GPIP CONTROL REGISTERS
The GPIP is programmed via three control registers. These registers control the data
direction, provide user access to the port, and specify the active edge for each bit of the
GPIP which will produce an interrupt. These registers are described in detail in the following
paragraphs.
5.1.1 General Purpose I/O Data Register (GPDR)
The general purpose I/O data register is used to input data from or output data to the port.
When data is written to the GPDR, those pins which are defined as inputs will remain in the
high-impedance state. Pins which are defined as outputs will assume the state (high or low)
of their corresponding bit in the data register. When the GPDR is read, data will be passed
directly from the bits of the data register for pins which are defined as outputs. Data from
pins defined as inputs will come from the input buffers.
GPDR REGISTER
BIT
7
FIELD
GPIP7
RESET
0
ADDR
6
GPIP6
0
5
GPIP5
0
4
3
GPIP4
GPIP3
0
0
$01
2
GPIP2
0
1
GPIP1
0
0
GPIP0
0
GPIP7-GPIP0 – General Purpose I/O Port
0 = Cleared.
1 = Set.
5.1.2 Active Edge Register (AER)
The active edge register (AER) allows each of the GPIP lines to produce an interrupt on
either a one-to-zero or a zero-to-one transition. Writing a zero to the appropriate edge bit of
MOTOROLA
MC68HC901 USER’S MANUAL
5-1