Datasheet
Registers
MC68HC812A4 Data Sheet, Rev. 7
Freescale Semiconductor 67
6.3.7 Port D Data Register
Read: Anytime, if register is in the map
Write: Anytime, if register is in the map
Bits PD7–PD0 correspond to data lines DATA7–DATA0. When port D is not used for external data, such
as in single-chip mode, these pins can be used as general-purpose I/O or key wakeup signals. DDRD
determines the primary direction of each port D pin.
In special expanded narrow mode, the external data bus is normally limited to eight bits on port C, but the
emulate port D bit (EMD) in the MODE register can be set to allow port C and port D to be used together
to provide single-cycle visibility of internal 16-bit accesses for debugging purposes. If the mode is special
narrow expanded and EMD is set, port D is configured for DATA7–DATA0 of visible internal accesses
and normal 16-bit external accesses are split into two adjacent 8-bit accesses through port C. This allows
connection of a single 8-bit external program memory.
This register is not in the on-chip map in wide expanded and peripheral modes. Also, in special narrow
expanded mode, the function of this port is determined by the EMD control bit. If EMD is set, this register
is not in the on-chip map and port D is used for DATA7–DATA0 of visible internal accesses. If EMD is
clear, this port serves as general-purpose I/O or key wakeup signals.
6.3.8 Port D Data Direction Register
Read: Anytime, if register is in the map
Write: Anytime, if register is in the map
When port D is operating as a general-purpose I/O port, this register determines the primary direction for
each port D pin.
1 = Associated pin is an output.
0 = Associated pin is a high-impedance input.
This register is not in the map in wide expanded and peripheral modes. Also, in special narrow expanded
mode, the function of this port is determined by the EMD control bit. If EMD is set, this register is not in
the on-chip map and port D is used for DATA7–DATA0 of visible internal accesses. If EMD is clear, this
port serves as general-purpose I/O or key wakeup signals.
Address: $0005
Bit 7654321Bit 0
Read:
PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0
Write:
Reset:00000000
Expanded wide and peripheral: DATA7 DATA6 DATA5 DATA4 DATA3 DATA2 DATA1 DATA0
Alternate pin function:KWD7KWD6KWD5KWD4KWD3KWD2KWD1KWD0
Figure 6-7. Port D Data Register (PORTD)
Address: $0007
Bit 7654321Bit 0
Read:
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Write:
Reset:00000000
Figure 6-8. Port D Data Direction Register (DDRD)
