9.7.3 Pin Functions in Each Mode
The usage of port 6 depends on the MCU operating mode. Separate descriptions are given below.
Pin Functions in Mode 3:
In mode 3 (the expanded maximum mode in which the on-chip ROM
is not used), P6DDR is automatically set for output, and the pins of port 6 carry the page address
bits (A
19
– A
16
) of the address bus. Figure 9-16 shows the pin functions for mode 3.
Pin Functions in Mode 4:
In mode 4, (the expanded maximum mode in which the on-chip ROM
is used), software can select whether to use port 6 for general-purpose input, IRQ
2
to IRQ
5
input,
or output of page address bits.
If a bit in P6DDR is set to 1, the corresponding pin is used for page address output. If the P6DDR
bit is cleared to 0 and the corresponding IRQnE bit is cleared to 0, the pin is used for general-
purpose input. If the P6DDR bit is cleared to 0 and the corresponding IRQnE bit is set to 1, the
pin is used for IRQ
2
to IRQ
5
input. A reset initializes these pins to the general-purpose input
function, so when the address bus is used, all necessary bits in P6DDR must first be set to 1.
Figure 9-17 shows the pin functions in mode 4.
Pin Functions in Single-Chip Mode and Expanded Minimum Modes:
In the single-chip mode
(mode 7) and expanded minimum modes (modes 1 and 2), the port 6 pins can be designated
individually as input or output pins.
Port 6 can be used for general-purpose input/output, IRQ input, or PWM output, depending on the
combination of settings of the IRQE and P6PWME bits in system control register 2 and the OE
A
19
A
18
A
17
A
16
(output)
(output)
(output)
(output)
Port
6
Figure 9-16 Port 6 Pin Functions in Mode 3
When P6DDR Bit
is Set to 1
A
19
(output)
A
18
(output)
A
17
(output)
A
16
(output)
When P6DDR Bit is Cleared to 0
IRQnE = 0
P6
3
(input)
IRQ
5
P6
2
(input)
IRQ
4
P6
1
(input)
IRQ
3
P6
0
(input)
IRQ
2
IRQnE = 1
Port
6
Figure 9-17 Port 6 Pin Functions in Mode 4
170