English
Language : 

MC3S12RG128 Datasheet, PDF (108/546 Pages) Freescale Semiconductor, Inc – Microcontrollers
Chapter 2 Port Integration Module (PIM3RG128V1) 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 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 is 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-48).
2.4.2 Input Register
This is a read-only register and always returns the value of the pin (Figure 2-48).
2.4.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-48).
PTI
0
1
PT
0
PAD
1
DDR
0
1
MODULE
DATA OUT
OUTPUT ENABLE
MODULE ENABLE
Figure 2-48. Illustration of I/O Pin Functionality
MC3S12RG128 Data Sheet, Rev. 1.05
108
Freescale Semiconductor