EasyManua.ls Logo

Cmsemicon SC8F577 Series - Page 48

Default Icon
181 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
V1.8
SC8F577x
48 / 181
www.mcu.com.cn
6.2.4 PORTA Pull Down Resistance
Each PORTA pin has an internal weak pull down that can be individually configured. The control bits
WPDA<7:0> enable or disable each weak pull down.
PORTA pull down resistance register WPDA (97H)
97H
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
WPDA
WPDA7
WPDA6
WPDA5
WPDA4
WPDA3
WPDA2
WPDA1
WPDA0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Reset value
0
0
0
0
0
0
0
0
Bit7~Bit0
WPDA<7:0>:
Weak pull down register bit
1=
Enable pull down
0=
Disable pull down
Note: If pin is configured as output, weak pull down will be automatically disabled.
6.2.5 PORTA Level Change Interrupt
All PORTA pins can be individually configured as level change interrupt pins. The control bit IOCA<7:0>
allows or disables the interrupt function of each pin. Disable pin level change interrupt function when power
on reset.
For the pin that has allowed level change interrupt, compare the value on the pin with the old value
latched when PORTA was read last time. Perform a logical OR operation with the output "mismatch" of the
last read operation to set the PORTA level change interrupt flag (RACIF) in the PIR2 register as 1.
This interrupt can wake up the device from sleep mode, and the user can clear the interrupt in the interrupt
service program in the following ways:
-Read or write to PORTA. This will end the mismatch state of the pin level.
-Clear the flag bit RACIF.
The mismatch status will continuously set the RACIF flag bit as 1. Reading or writing PORTA will end the
mismatch state and allow the RACIF flag to be cleared. The latch will keep the last read value from the under
voltage reset. After reset, if the mismatch still exists, the RACIF flag will continue to be set as 1.
Note: If the level of the I/O pin changes during the read operation (beginning of the Q2 cycle), the
RACIF interrupt flag bit will not be set as 1. In addition, since reading or writing to a port affects
all bits of the port, special care must be taken when using multiple pins in interrupt-on-change
mode. When dealing with the level change of one pin, you may not notice the level change on
the other pin.

Related product manuals