
Parallel Ports
7-10
MC68328 USER’S MANUAL 12/9/97
MOTOROLA
PARALLEL
PORTS
7
PRELIMINARY
DIR—Direction 0–7
These bits control the direction of the corresponding port pin. When a bit is high, the
corresponding port pin is an output pin and when it is low the corresponding port pin is an
input pin. These bits reset to 0 and have no effect on the pins while the SEL bits are low.
D—Data 0–7
These bits control or report the data on the pins while the associated SEL bits are high. If
the DIR bits are high (pins configured as output), D[7:0] control the data to the pins. When
the DIR bits are low (pins configured as input), D[7:0] report the actual signal level on the
pins. The data bits may be read or written at any time. If a pin is configured as input-only, a
write to the corresponding bit in this register does not effect the pin. These bits reset to 0.
SEL—Select 0–7
The select register allows you to individually select the function for each port pin. When you
set a bit in this register, the corresponding port pin is configured as a general-purpose I/O.
When a bit is clear, the corresponding port pin is configured as a bus control signal. At reset,
all bits in the select register are cleared.
7.5.4 Port D Registers
Port D has special features that allow it to be used as a keyboard input port. You can also
use port D as a general-purpose I/O port or a general-purpose interrupt port. As with the
other ports, each pin can be configured as an input or output on a bit-by-bit basis. When
configured as an input, each pin can generate a CPU interrupt. These individual interrupt
signals are presented to the interrupt controller module as INT[7:0]. In addition, a group
interrupt can be generated. This interrupt is the OR (negative logic) of all pins on the port
and it is presented to the interrupt controller as a keyboard (KB) interrupt.
Each interrupt can be configured either as a level-sensitive interrupt or an edge-triggered
interrupt. The polarity of each interrupt can also be selected. Each pin is equipped with a
switchable pull-up resistor.
BIT
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
FIELD
DIR7 DIR6 DIR5 DIR4 DIR3 DIR2 DIR1 DIR0
D7
D6
D5
D4
D3
D2
D1
D0
RESET
0x0000
ADDR
0xFFFFF418
BIT
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
FIELD
PU7
PU6
PU5
PU4
PU3
PU2
PU1
PU0
00000000
RESET
0xFF00
ADDR
0xFFFFF41A