![](http://datasheet.mmic.net.cn/90000/ML66Q525-NTB_datasheet_3507944/ML66Q525-NTB_347.png)
ML66525 Family User’s Manual
Chapter 16
Bus Port Functions
16 - 2
Table 16-1
P0, P1, P2, P3_1 and P4 Operation During Program Memory Access
Memory to be
accessed
Address
P0 operation
P1, P2, P4
operation
P3_1 operation
Internal program
When EAn = H,
0H to 1FFFFH
I/O port
When EAn = H,
20000H to FFFFFH
After set as
secondary function
output, program
data input
After set as
secondary function
output, address
output
After set as
secondary function
output, PSENn
output
External program
When EAn = L,
0H to FFFFFH
Program data input
Address output
PSENn output
[Note]
When P0, P1, P2 and P4 are set as secondary function outputs, each of these
ports enters a pulled-up state while external program memory is not accessed.
16.2.2 Port Operation When Accessing Data Memory
When accessing internal data memory (addresses 0H to 1FFFH), P0, P1, P2, P3_2, P3_3 and
P4 operate as I/O ports.
When accessing external data memory (addresses 2000H to FFFFFH), set ports P0, P1, P2,
P3_2, P3_3 and P4 to their secondary functions so that P0 operates as a data I/O pin, P1, P2,
and P4 operate as address output pins, and P3_2 and P3_3 operate as RDn and WRn output
pins.
If the EAn pin is at a low level, P0, P1, P2 and P4 are automatically set as bus ports (secondary
function control registers and mode registers are set) when reset (RESn 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 RDn and WRn 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 EAn 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 16-2 lists the operation of P0, P1, P2, P3_2, P3_3 and P4 during a data memory access.
Table 16-2
P0, P1, P2, P3_2, P3_3 and P4 Operation During Data Memory Access
Data to be
accessed
Address
P0 operation
P1, P2, P4
operation
P3_2, P3_3
operation
Internal data
0H to 1FFFH
I/O port
External data
2000H to FFFFFH
After set as
secondary
function output*,
data I/O
After set as
secondary
function output*,
address output
After set as
secondary
function output*,
RDn and WRn output
*
If the EAn pin is at a low level, P0, P1, P2 and P4 are automatically set as secondary function outputs
when reset.
[Note]
When P0, P1, P2 and P4 are set as secondary function outputs, each of these
ports enters a pulled-up state while external data memory is not accessed.