Chapter 4 Multiplexed External Bus Interface (MEBIV3)
Freescale Semiconductor
MC9S12C-Family / MC9S12GC-Family
149
Rev 01.24
4.3.2.15
Port K Data Register (PORTK)
Read: Anytime
Write: Anytime
This port is associated with the internal memory expansion emulation pins. When the port is not enabled
to emulate the internal memory expansion, the port pins are used as general-purpose I/O. When port K is
operating as a general-purpose I/O port, DDRK determines the primary direction for each port K pin. A 1
causes the associated port pin to be an output and a 0 causes the associated pin to be a high-impedance
input. The value in a DDR bit also affects the source of data for reads of the corresponding PORTK register.
If the DDR bit is 0 (input) the buffered pin input is read. If the DDR bit is 1 (output) the output of the port
data register is read.
This register is not in the map in peripheral or expanded modes while the EMK control bit in MODE
register is set. Therefore, these accesses will be echoed externally.
When inputs, these pins can be selected to be high impedance or pulled up, based upon the state of the
PUPKE bit in the PUCR register.
Module Base + 0x0032
Starting address location affected by INITRG register setting.
7
6
5
4
3
2
1
0
R
Bit 7
6
5
4
3
2
1
Bit 0
W
Reset
0
0
0
0
0
0
0
0
Alternate
Pin Function
ECS
XCS
XAB19
XAB18
XAB17
XAB16
XAB15
XAB14
Figure 4-19. Port K Data Register (PORTK)
Table 4-13. PORTK Field Descriptions
Field
Description
7
Port K, Bit 7
Port K, Bit 7
— This bit is used as an emulation chip select signal for the emulation of the internal memory
expansion, or as general-purpose I/O, depending upon the state of the EMK bit in the MODE register. While
this bit is used as a chip select, the external bit will return to its de-asserted state (V
DD
) for approximately 1/4
cycle just after the negative edge of ECLK, unless the external access is stretched and ECLK is free-running
(ESTR bit in EBICTL = 0). See the MMC block description chapter for additional details on when this signal
will be active.
6
Port K, Bit 6
Port K, Bit 6
— This bit is used as an external chip select signal for most external accesses that are not
selected by ECS (see the MMC block description chapter for more details), depending upon the state the of
the EMK bit in the MODE register. While this bit is used as a chip select, the external pin will return to its de-
asserted state (V
DD
) for approximately 1/4 cycle just after the negative edge of ECLK, unless the external
access is stretched and ECLK is free-running (ESTR bit in EBICTL = 0).
5:0
Port K, Bits 5:0
Port K, Bits 5:0
— These six bits are used to determine which FLASH/ROM or external memory array page
is being accessed. They can be viewed as expanded addresses XAB19–XAB14 of the 20-bit address used to
access up to1M byte internal FLASH/ROM or external memory array. Alternatively, these bits can be used for
general-purpose I/O depending upon the state of the EMK bit in the MODE register.
Summary of Contents for MC9S12C Family
Page 689: ......