Modes of Operation
MOTOROLA
General Purpose Input/Output (GPIO)
15-7
Preliminary
15
15.5 Functional Description
Each GPIO pin can be configured as either an input (with or without pull-up) or an output.
pull-ups are configured by writing to the Pull-Up Enable (PUE) Registers and are
automatically disabled when the pin is being used as an output in either the Normal mode
or the GPIO mode.
15.5.1 Normal Mode
The peripheral module supplies the output enable to the I/O pad to control its direction in
the Normal mode.
The peripheral also supplies the output data if output enable is asserted. The peripheral can
read the value of the data on the I/O pad if it is using the pin as an input. When the pin is
an input, the pull-up resistor can be enabled by writing to the PUR register. The pull-up
resistor will be disabled as long as the output enable from the peripheral is asserted.
15.5.2 GPIO Mode
In the GPIO mode, the Data Direction Register (DDR) supplies the output enable to the
I/O pad to control its direction. The DR supplies the output data if DDR is asserted. The
value of the data on the I/O pad can be read by reading Data Register (DR) when DDR is
zero. When in GPIO mode the output data from the GPIO to the peripheral module will be
driven high and the output data and enable from the peripheral are ignored. The pull-up
resistor can be enabled by writing to the PUR register. The pull-up resistor will be
disabled as long as the DDR is set to the Output mode.
15.6 Modes of Operation
The GPIO module design contains two major modes of operation:
1. Normal Mode
This can also be thought of as Peripheral Controlled mode. The peripheral module
controls the output enable and any output data to the pad and any input data from
the pad is passed to the peripheral. Pull up enables are controlled by a GPIO
register.
2. GPIO mode
In this mode the GPIO module controls the output enable to the pad and supplies
any data to be output. Also, any input data can be read from a GPIO memory
mapped register. Pull up enables are controlled by a GPIO register.