
#)
User
’
s Manual
18-7
1999-08
Ports and External Bus Configuration during Reset
During the internal reset sequence all of the C161PI
’
s port pins are configured as inputs
by clearing the associated direction registers, and their pin drivers are switched to the
high impedance state. This ensures that the C161PI and external devices will not try to
drive the same pin to different levels. Pin ALE is held low through an internal pulldown,
and pins RD, WR and READY are held high through internal pullups. Also the pins that
can be configured for CS output will be pulled high.
The registers SYSCON and BUSCON0 are initialized according to the configuration
selected via PORT0.
When an external start is selected (pin EA=
’
0
’
):
the Bus Type field (BTYP) in register BUSCON0 is initialized according to
P0L.7 and P0L.6
bit BUSACT0 in register BUSCON0 is set to
‘
1
’
bit ALECTL0 in register BUSCON0 is set to
‘
1
’
bit ROMEN in register SYSCON will be cleared to
‘
0
’
bit BYTDIS in register SYSCON is set according to the data bus width (set if 8-bit)
bit WRCFG in register SYSCON is set according to pin P0H.0 (WRC)
When an internal start is selected (pin EA=
’
1
’
):
register BUSCON0 is cleared to 0000
H
bit ROMEN in register SYSCON will be set to
‘
1
’
bit BYTDIS in register SYSCON is set, i.e. BHE/WRH is disabled
bit WRCFG in register SYSCON is set according to pin P0H.0 (WRC)
The other bits of register BUSCON0, and the other BUSCON registers are cleared.
This default initialization selects the slowest possible external accesses using the
configured bus type.
When the internal reset has completed, the configuration of PORT0, PORT1, Port 4
Port 6 and of the BHE signal (High Byte Enable, alternate function of P3.12) depends
on the bus type which was selected during reset. When any of the external bus modes
was selected during reset, PORT0 will operate in the selected bus mode. Port 4 will
output the selected number of segment address lines (all zero after reset) and Port 6
will drive the selected number of CS lines (CS0 will be
‘
0
’
, while the other active CS
lines will be
‘
1
’
). When no memory accesses above 64 K are to be performed,
segmentation may be disabled.
When the on-chip bootstrap loader was activated during reset, pin TxD0 (alternate port
function) will be switched to output mode after the reception of the zero byte.
All other pins remain in the high-impedance state until they are changed by software or
peripheral operation.