![](http://datasheet.mmic.net.cn/130000/ML66Q517-NGA_datasheet_5009273/ML66Q517-NGA_371.png)
ML66517 Family User’s Manual
Chapter 17
Bus Port Functions
17 – 2
Table 17-1
P0, P1, P2, P3_0 and P3_1 Operation During Program Memory Access
Memory to be
accessed
Address
P0 operation
P1, P2
operation
P3_1 operation
P3_0 operation
Internal
program
When
EA = H,
0H to FFFFH
I/O port
When
EA = H,
10000H to 1FFFFH
After set as
secondary
function output,
address output/
program data input
After set as
secondary
function output,
address output
After set as
secondary
function output,
PSEN output
After set as
secondary
function output,
ALE output
External
program
When
EA = L,
0H to 1FFFFH
Address output/
program data input
Address output
PSEN output
ALE output
17.2.2 Port Operation When Accessing Data Memory
When accessing internal data memory (addresses 0H to 9FFH), P0, P1, P3_0, P3_2, and P3_3 operate as I/O
ports.
When accessing external data memory (addresses A00H to FFFFH), set ports P0, P1, P3_0, P3_2 and P3_3 to
their secondary functions so that P0 operates as an address output and data I/O pin, P1 operates as an address
output pin, and P3_0, P3_2, and P3_3 operate as ALE,
RD and WR output pins.
If the
EA pin is at a low level, P0, P1 and P3_0 are automatically set as bus ports (secondary function control
registers and mode registers are set) when reset (
RES signal input, execution of a BRK instruction, overflow of
the watchdog timer, opcode trap). Because P3_2 and P3_3 are automatically set as input ports instead of
RD and
WR output pins, before external data memory is accessed, they must be set as secondary function outputs.
Of the ports that are automatically set as bus port functions when the
EA pin is at a low level, if upper address or
other output is unnecessary, then after reset, those ports can be operated as I/O ports by resetting their secondary
function control register.
Table 17-2 lists the operation of P0, P1, P3_0, P3_2, and P3_3 during a data memory access.
Table 17-2
P0, P1, P3_0, P3_2 and P3_3 Operation During Data Memory Access
Data to be
accessed
Address
P0 operation
P1 operation
P3_0, P3_2, P3_3
operation
Internal data
0H to 9FFH
I/O port
External data
A00H to FFFFH
After set as
secondary
function output,
*1
address output/
data I/O
After set as
secondary
function output,
*1
address output
After set as
secondary
function output,
*1
ALE,
RD and
WR output
*1
If the
EA pin is at a low level, P0, P1, and P3_0 are automatically set as secondary function outputs when
reset.