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)
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.