English
Language : 

MC9S12HZ256 Datasheet, PDF (160/692 Pages) Freescale Semiconductor, Inc – HCS12 Microcontrollers
Chapter 4 Port Integration Module (PIM9HZ256V2)
4.4 Functional Description
Each pin associated with ports AD, L, P, S, T, U and V 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.
4.4.1 I/O Register
The I/O Register holds the value driven out to the pin if the port is used as a general-purpose I/O. Writing
to the I/O Register only has an effect on the pin if the port is used as general-purpose output.
When reading the I/O Register, the value of each pin is returned if the corresponding Data Direction
Register bit is set to 0 (pin configured as input). If the data direction register bits is set to 1, the content of
the I/O Register bit is returned. This is independent of any other configuration (Figure 4-55).
Due to internal synchronization circuits, it can take up to 2 bus cycles until the correct value is read on the
I/O Register when changing the data direction register.
4.4.2 Input Register
The Input Register is a read-only register and generally returns the value of the pin (Figure 4-55). It can
be used to detect overload or short circuit conditions.
Due to internal synchronization circuits, it can take up to 2 bus cycles until the correct value is read on the
Input Register when changing the Data Direction Register.
4.4.3 Data Direction Register
The Data Direction Register defines whether the pin is used as an input or an output. A Data Direction
Register bit set to 0 configures the pin as an input. A Data Direction Register bit set to 0 configures the pin
as an output. If a peripheral module controls the pin the contents of the data direction register is ignored
(Figure 4-55).
MC9S12HZ256 Data Sheet, Rev. 2.04
160
Freescale Semiconductor