
EXTERNAL INTERFACE
S3C821A/P821A
16-2
EXTERNAL INTERFACE CONTROL REGISTERS
This subsection presents an overview of the S3C821A system registers which are used to configure and control
the external peripheral interface:
— System mode register (SYM, R222, DEH, set 1)
— Port 0 control register (P0CON, R224, E0H, set 1, bank 1)
— Port 1 control register (P1CON, R226, E2H, set 1, bank 1)
— Port 2 low-byte control register (P2CONL, R229, E5H, set 1, bank 1)
Detailed descriptions of each of these registers can be found in Part I, Chapter 4, "Control Registers."
PORT 0 CONTROL REGISTER (P0CON)
The port 0 control register P0CON (E0H, set 1, bank 1) controls the upper and lower nibble configuration for port
0 pins. When P0CON bit 7 = "1", the upper nibble pins P0.7–P0.4 are configured as lines for the external
memory interface. When P0CON bit 3 = "1", the lower nibble pins P0.3–P0.0 are configured for external memory.
After a reset, P0CON is cleared to 00H. Bits 7 and/or 3 must then be set to "1" by program software to enable the
external memory interface function for port 0.
PORT 1 CONTROL REGISTER (P1CON)
The port 1 control register P1CON (E2H, set 1, bank 1) functions identically to the P0CON register, except that it
controls the upper and lower nibble configuration for port 1 pins: P1.7–P1.4 and P1.3–P1.0, respectively. P1CON
is also cleared to 00H by a reset.
PORT 2 CONTROL REGISTER (P2CONL)
The pins of I/O port 2, P2.3–P2.0, can alternately be used as lines for the signal outputs that are required to
control the activity of the multiplexed external memory interface bus. You manipulate the bit-pairs in the control
register, P2CONL (E5H, set 1, bank 1) to configure the pins individually for general-purpose use or as external
memory bus control lines. If the external memory interface is implemented, you must configure all four pins as
memory lines. When bit pairs 7/6, 5/4, 3/2, and 1/0 are set to "11B", the corresponding memory signal outputs
are activated:
Bit-pair
Pin
Symbol
Function
7/6
P2.3
DM
Data memory pin
5/4
P2.2
DW
Data write pin
3/2
P2.1
DR
Data read pin
1/0
P2.0
AS
Address strobe pin
In normal operating mode, a reset operation clears P2CONL to 00H, configuring P2.3–P2.0 as normal input pins.