English
Language : 

MC9S12Q128_10 Datasheet, PDF (103/644 Pages) Freescale Semiconductor, Inc – HCS12 Microcontrollers
Chapter 2 Port Integration Module (PIM9C32) Block Description
2.4 Functional Description
Each pin can act as general purpose I/O. In addition the pin can act as an output from a peripheral module
or an input to a peripheral module.
A set of configuration registers is common to all ports. All registers can be written at any time, however a
specific configuration might not become active.
Example: Selecting a pull-up resistor. This resistor does not become active while the port is used as a push-
pull output.
2.4.1 Registers
2.4.1.1 I/O Register
This register holds the value driven out to the pin if the port is used as a general purpose I/O. Writing to
this register has only an effect on the pin if the port is used as general purpose output. When reading this
address, the value of the pins are returned if the data direction register bits are set to 0.
If the data direction register bits are set to 1, the contents of the I/O register is returned. This is independent
of any other configuration (Figure 2-46).
PTI
0
1
PAD
PT
0
1
DDR
0
1
Module
Data Out
Output Enable
Module Enable
Figure 2-46. Illustration of I/O Pin Functionality
2.4.1.2 Input Register
This is a read-only register and always returns the value of the pin (Figure 2-46).
2.4.1.3 Data Direction Register
This register defines whether the pin is used as an input or an output. If a peripheral module controls the
pin the contents of the data direction register is ignored (Figure 2-46).
Freescale Semiconductor
MC9S12Q128
103
Rev 1.10