I/O PORTS S3C8245/P8245/C8249/P8249
9-6
PORT 1
Port 1 is an 8-bit I/O port with individually configurable pins. Port 1 pins are accessed directly by writing or reading
the port 1 data register, P1 at location F7H in set 1, bank 0. P1.0–P1.7 can serve inputs, as outputs
(push pull or open-drain) or you can configure the following alternative functions:
Low-byte pins (P1.0-P1.3): T1CAP, T1CLK, T1OUT, T1PWM
High-byte pins (P1.4-P1.7): SCK, SI, SO and BUZ
Port 1 Control Register
Port 1 has two 8-bit control registers: P1CONH for P1.4–P1.7 and P1CONL for P1.0–P1.3. A reset clears the
P1CONH and P1CONL registers to “00H”, configuring all pins to input mode. You use control registers settings to
select input or output mode (push-pull or open drain) and enable the alternative functions.
When programming the port, please remember that any alternative peripheral I/O function you configure using the
port 1 control registers must also be enabled in the associated peripheral module.
Port 1 Pull-up Resistor Enable Register (P1PUP)
Using the port 1 pull-up resistor enable register, P1PUP (F5H, set 1, bank 0), you can configure pull-up resistors to
individual port 1 pins.
Port 1 Control Register, High Byte (P1CONH)
E4H, Set 1, Bank 0, R/W
.7 .6 .5 .4 .3 .2 .1 .0MSB LSB
P1.7/SI
P1CONH bit-pair pin configuration settings:
00
01
10
11
Alternative function (SCK out, BUZ, SO, P1.7 is push-pull output)
Output mode, push-pull
P1.6/SCK P1.5/SO P1.4/BUZ
Output mode, open-drain
NOTE:
When use this port 1, user must be care of the pull-up resistance status.
Input mode (SI, SCK in)
Figure 9-5. Port 1 High-Byte Control Register (P1CONH)