English
Language : 

MC9S08RC8 Datasheet, PDF (76/234 Pages) Freescale Semiconductor, Inc – Microcontrollers
Parallel Input/Output
The TPM can be configured to use PTD6 as either an input capture, output compare, PWM, or external
clock input pin. Refer to the Chapter 6, “Parallel Input/Output,” for more information about using PTD6
as a timer pin.
6.3.5 Port E
Port E
Bit 7
MCU Pin: PTE7
6
5
4
3
PTE6 PTE5 PTE4 PTE3
Figure 6-5. Port E Pin Names
2
PTE2
1
PTE1
Bit 0
PTE0
Port E is an 8-bit general-purpose I/O port.
Port E pins are available as general-purpose I/O pins controlled by the port E data (PTED), data direction
(PTEDD), and pullup enable (PTEPE) registers. Refer to Section 6.4, “Parallel I/O Controls,” for more
information about general-purpose I/O control.
6.4 Parallel I/O Controls
Provided no on-chip peripheral is controlling a port pin, the pins operate as general-purpose I/O pins that
are accessed and controlled by a data register (PTxD), a data direction register (PTxDD), and a pullup
enable register (PTxPE) where x is A, B, C, D, or E.
Reads of the data register return the pin value (if PTxDDn = 0) or the contents of the port data register (if
PTxDDn = 1). Writes to the port data register are latched into the port register whether the pin is controlled
by an on-chip peripheral or the pin is configured as an input. If the corresponding pin is not controlled by
a peripheral and is configured as an output, this level will be driven out the port pin.
6.4.1 Data Direction Control
The data direction control bits determine whether the pin output driver is enabled, and they control what
is read for port data register reads. Each port pin has a data direction control bit. When PTxDDn = 0, the
corresponding pin is an input and reads of PTxD return the pin value. When PTxDDn = 1, the
corresponding pin is an output and reads of PTxD return the last value written to the port data register.
When a peripheral module or system function is in control of a port pin, the data direction control still
controls what is returned for reads of the port data register, even though the peripheral system has
overriding control of the actual pin direction.
For the MC9S08RC/RD/RE/RG MCU, reads of PTD0/BKGD/MS and PTD1/RESET will return the value
on the output pin.
It is a good programming practice to write to the port data register before changing the direction of a port
pin to become an output. This ensures that the pin will not be driven with an old data value that happened
to be in the port data register.
MC9S08RC/RD/RE/RG Data Sheet, Rev. 1.11
76
Freescale Semiconductor