Microchip Technology DM164130-9 User Manual
PICkit™ 3 Starter Kit User’s Guide
DS41628B-page 76
2012 Microchip Technology Inc.
3.11.4
New Registers
3.11.4.1
BOTH
This enables the individual internal pull-up circuitry for each pin on PORTA.
3.11.4.2
ENHANCED MID-RANGE
3.11.4.2.1 IOCAN/IOCAF
The PIC16F1829 can detect rising and falling edge interrupts. IOCAN contains the neg-
ative edge detection enable bits and IOCAF contains the interrupt flags. This lesson
enables the switch input as an interrupt-on-change pin through IOCAN and clears all
the flags in IOCAF inside the ISR.
This lesson uses the interrupt-on-change peripheral, which causes the PIC MCU to go
to address 0x0004 (interrupt vector), when RA2 changes from a high-to-low state.
The PIC16F1829 can detect rising and falling edge interrupts. IOCAN contains the neg-
ative edge detection enable bits and IOCAF contains the interrupt flags. This lesson
enables the switch input as an interrupt-on-change pin through IOCAN and clears all
the flags in IOCAF inside the ISR.
This lesson uses the interrupt-on-change peripheral, which causes the PIC MCU to go
to address 0x0004 (interrupt vector), when RA2 changes from a high-to-low state.
FIGURE 3-13:
RISING/FALLING EDGES
3.11.4.3
PIC18
3.11.4.3.1 IOCA
The PIC18F14K22 does not have a negative and positive edge trigger, but rather just
one that detects both. More software is needed to determine which edge occurred.
The PIC18F14K22 does not have a negative and positive edge trigger, but rather just
one that detects both. More software is needed to determine which edge occurred.
3.11.4.3.2 RCON
The RCON register is used to detect what caused the PIC MCU to reset as well as
enable/disable priority interrupts. This lesson shows how to use this register to disable
priority interrupts.
The RCON register is used to detect what caused the PIC MCU to reset as well as
enable/disable priority interrupts. This lesson shows how to use this register to disable
priority interrupts.
TABLE 3-32:
NEW REGISTERS FOR BOTH DEVICES
Register
Purpose
WPUA
Weak pull-up enable
TABLE 3-33:
NEW REGISTERS FOR ENHANCED MID-RANGE
Register
Purpose
IOCAN
Interrupt-on-change PORTA negative edge
IOCAF
Interrupt-on-change PORTA flags
TABLE 3-34:
NEW REGISTERS FOR PIC18
Register
Purpose
IOCA
Interrupt-on-change PORTA (both edges)
RCON
Detects what caused the interrupt
Rising Edge
Falling Edge