www
.mcu.com.cn
66
/
239
Rev.
1.00
CMS80F731x Reference Manual
7.2.2
Port Multiplexing Feature Configuration Register
The PORTx function configuration register PxnCFG
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
PxnCFG
--
--
--
--
--
PxnCFG2
PxnCFG1
PxnCFG0
R/W
--
--
--
--
--
R/W
R/W
R/W
Reset value
0
0
0
0
0
0
0
1
Bit7~Bit3
--
Reserved, must be 0.
Bit2~Bit0
PxnCFG<2:0>:
Feature configuration bit, the default simulation is a function. For details, see port
function configuration instructions;
000=
GPIO function;
001=
Analog Function (ANA);
Other =
Multiplexing function;
PxnCFG x=0/1/2/5,n=0-7
Each port has a function configuration register, PxnCFG, through which
each port can be set to the corresponding digital
function. For example: to set P16 as BEEP buzzer function, configure it as:
P16CFG = 0x04;
When the port is multiplexed, there is no need to configure the port direction register PxTRIS. And except the SCL and SDA
functions, other multiplexing functions are hardware forced to close the pull-up resistor, turn off the open-drain output, that is,
the pull-up resistor PxUP or the open-drain output PxOD is invalid through the software.
When the port is multiplexed to SCL and SDA functions, the hardware forces the port to be an open-drain output, and the
pull-up resistor PxUP can be set by software.
7.2.3
The Port Input Function Allocation Registers
Inside the chip there are digital functions with only the input state, such as INT0/INT1... etc., this type of digital input
function is independent of the port multiplexing state. As long as the assigned port supports digital input (such as RXD0 as a
digital input and GPIO as an input function), the port supports this function.
The input function port assignment registers are as follows:
register
address
function
Feature description
PS_INT0
F0C0H
INT0
External interrupt 0 input port allocation register
PS_INT1
F0C1H
INT1
External interrupt 1 input port allocation register
PS_T0
F0C2H
T0
Timer0 external clock input port assignment register
PS_T0G
F0C3H
T0G
Timer0 gated input port assignment register
PS_T1
F0C4H
T1
Timer1 external clock input port assignment register
PS_T1G
F0C5H
T1G
Timer1 gated input port assignment register
PS_T2
F0C6H
T2
Timer2 external event or gated input port assignment register
PS_T2EX
F0C7H
T2EX
Timer2 drops along the autoreload input port allocation
register
PS_CAP0
F0C8H
CAP0
The Timer2 input captures channel 0 port assignment
registers
PS_CAP1
F0C9H
CAP1
The Timer2 input captures the channel 1 port assignment
register
PS_CAP2
F0CAH
CAP2
The Timer2 input captures the channel 2 port assignment
register
PS_CAP3
F0CBH
CAP3
The Timer2 input captures the channel 3 port assignment
register
PS_ADET
F0CCH
CUSTOM
The ADC's external trigger input port allocates registers