www
.mcu.com.cn
69
/
239
Rev.
1.00
CMS80F731x Reference Manual
7.2.5
Port External Interrupt Control Registers
When using an external interrupt, the port needs to be configured as GPIO function and the direction is set to the input port.
Alternatively, the multiplexing function is the input port (e.g. RXD0, RXD1), each port can be configured as a GPIO interrupt
function.
PORTx external interrupt control register Px
N
EICFG
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
Px
N
EICFG
--
--
--
--
--
--
Px1EICFG1
Px0EICFG0
R/W
--
--
--
--
--
--
R/W
R/W
Reset value
0
0
0
0
0
0
0
0
Bit7~Bit2
--
Reserved, must be 0.
Bit1~Bit0
Px
N
EICFG<1:0>:
Px
N
external interrupt control bit;
00=
No external interrupts;
01=
Rising edge triggers interrupts;
10=
Falling edge triggers interrupt;
11=
Both the rising or falling edge trigger an interrupt.
Px has 8 external interrupt control registers, including Px0EICFG~Px7EICFG, which control the external interrupts of
Px0~Px7, x=0,1,2,5.
If you configure the P00 falling edge to trigger an interrupt, configure it as follows:
P00CFG =0x00; Configure P00 for GPIO functionality
P0TRIS =0x00; Configure P00 as input
P00EICFG = 0x02; Configure P00 to trigger interrupts on the falling edge
EA = 1; Global interrupt enablement
P0EXTIE = 0x01; Enables P00 external interrupt function
7.2.6
Multiplexing Features Application Notes
1)
The multiplexing function configuration register defaults to an analog function (0x01), and if you use the digital function,
you need to set the value of the register to 0x00.
2)
The input of the multiplexing function is relatively independent of the structure of the port's external interrupt (GPIO
interrupt) and port input function.
For example, the P20 port is configured as RXD1, and the GPIO interrupt trigger mode of the P20 is to trigger the
rising edge, interrupt enable, and when the P20 input changes from low to high, the GPIO interrupt of P20 will be
triggered.
3)
The input structure of the digital signal is not affected by the configuration state of the system.
For example, if the P50 port is powered on as an external reset port, the port input module is turned on. If the P50 is
also configured as RXD1 in the program and the interrupt enable is turned on, the interrupt service program is executed
before the reset signal sampling time is valid, and then the reset operation is generated.
4)
It should be noted that in debug mode, such as the multiplexing function is configured to the DSDA port, its input
function is also valid, it is recommended that in the debugging mode, do not configure the relevant reuse function to
the DSDA port.
5)
When the port is used as an analog function, when the function configuration register is set to 0x01, the hardware
turns off the digital circuit to reduce power consumption, and the GPIO function-related register setting is invalid.
6)
The port input/communication input function has priority restrictions, if two or more ports are configured with the same
input function at the same time, the selection is configured according to the priority order of P00, P01,......, P54, P55