2003 Microchip Technology Inc.
Preliminary
DS40300C-page 101
PIC16F62X
14.6
Interrupts
The PIC16F62X has 10 sources of interrupt:
External Interrupt RB0/INT
TMR0 Overflow Interrupt
PORTB Change Interrupts (pins RB7:RB4)
Comparator Interrupt
USART Interrupt TX
USART Interrupt RX
CCP Interrupt
TMR1 Overflow Interrupt
TMR2 Match Interrupt
EEPROM
The interrupt control register (INTCON) records
individual interrupt requests in flag bits. It also has
individual and global interrupt enable bits.
A global interrupt enable bit, GIE (INTCON<7>)
enables (if set) all un-masked interrupts or disables (if
cleared) all interrupts. Individual interrupts can be
disabled through their corresponding enable bits in
INTCON register. GIE is cleared on RESET.
The “return from interrupt” instruction, RETFIE, exits
interrupt routine as well as sets the GIE bit, which re-
enable RB0/INT interrupts.
The INT pin interrupt, the RB port change interrupt and
the TMR0 overflow interrupt flags are contained in the
INTCON register.
The peripheral interrupt flag is contained in the special
register PIR1. The corresponding interrupt enable bit is
contained in special registers PIE1.
When an interrupt is responded to, the GIE is cleared
to disable any further interrupt, the return address is
pushed into the stack and the PC is loaded with 0004h.
Once in the interrupt service routine the source(s) of
the interrupt can be determined by polling the interrupt
flag bits. The interrupt flag bit(s) must be cleared in soft-
ware before re-enabling interrupts to avoid RB0/INT
recursive interrupts.
For external interrupt events, such as the INT pin or
PORTB change interrupt, the interrupt latency will be
three or four instruction cycles. The exact latency
depends when the interrupt event occurs (Figure 14-
15). The latency is the same for one or two cycle
instructions. Once in the interrupt service routine the
source(s) of the interrupt can be determined by polling
the interrupt flag bits. The interrupt flag bit(s) must be
cleared in software before re-enabling interrupts to
avoid multiple interrupt requests. Individual interrupt
flag bits are set regardless of the status of their
corresponding mask bit or the GIE bit.
FIGURE 14-14:
INTERRUPT LOGIC
Note 1: Individual interrupt flag bits are set
regardless
of
the
status
of
their
corresponding mask bit or the GIE bit.
2: When an instruction that clears the GIE
bit is executed, any interrupts that were
pending for execution in the next cycle
are ignored. The CPU will execute a NOP
in the cycle immediately following the
instruction which clears the GIE bit. The
interrupts which were ignored are still
pending to be serviced when the GIE bit
is set again.
TMR2IF
TMR2IE
CCP1IF
CCP1IE
CMIF
CMIE
TXIF
TXIE
RCIF
RCIE
T0IF
T0IE
INTF
INTE
RBIF
RBIE
GIE
PEIE
Wake-up (If in SLEEP mode)
Interrupt to CPU
EEIE
EEIF
TMR1IF
TMR1IE
相关PDF资料
AT97SC3204-X1A50-1 CRYPTO TPM LPC 3.0-3.6V 28TSSOP
ATA6620N-TAQY TXRX LIN BUS W/VREG SO-8
ATA6661-TAQJ 19 TXRX LIN 2.0 3.3V/5V 8SOIC
ATA6670-FFQW IC TXRX LIN DUAL 14VDFN
ATAM893T-TKSYD IC MCU FLASH 4K MTP 20SSOP
ATF1500ABV-15JI IC CPLD 15NS LOW VOLT PLCC
ATF1500AL-20JI IC CPLD 20NS LOW POW 44PLCC
ATF1502ASV-15JI44 IC CPLD EE HP 15NS 44-PLCC
相关代理商/技术参数
AT91SAM9XE-EK 功能描述:开发板和工具包 - ARM Eval Kit for SAM9XE Series RoHS:否 制造商:Arduino 产品:Development Boards 工具用于评估:ATSAM3X8EA-AU 核心:ARM Cortex M3 接口类型:DAC, ICSP, JTAG, UART, USB 工作电源电压:3.3 V
AT91SAM-ICE 功能描述:仿真器/模拟器 JTAG emulator AT91 ARM7/ARM9 RoHS:否 制造商:Blackhawk 产品:System Trace Emulators 工具用于评估:C6000, C5000, C2000, OMAP, DAVINCI, SITARA, TMS470, TMS570, ARM 7/9, ARM Cortex A8/R4/M3 用于:XDS560v2
AT91SAMS64-AI 制造商:ATMEL 制造商全称:ATMEL Corporation 功能描述:AT91 ARM㈢ Thumb㈢-based Microcontrollers
AT91SC192192CT-USB 制造商:ATMEL 制造商全称:ATMEL Corporation 功能描述:32-bit Secure Microcontrollers
AT91SC25672RC 制造商:ATMEL 制造商全称:ATMEL Corporation 功能描述:32-bit Secure Microcontroller for Smart Cards
AT91SC321RC-MQC-AM2 功能描述:ARM微控制器 - MCU For Secure Trnsactns in Smart Crd/PC Apps RoHS:否 制造商:STMicroelectronics 核心:ARM Cortex M4F 处理器系列:STM32F373xx 数据总线宽度:32 bit 最大时钟频率:72 MHz 程序存储器大小:256 KB 数据 RAM 大小:32 KB 片上 ADC:Yes 工作电源电压:1.65 V to 3.6 V, 2 V to 3.6 V, 2.2 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:LQFP-48 安装风格:SMD/SMT
AT91SC321RC-MQC-AM5 功能描述:ARM微控制器 - MCU For Secure Trnsactns in Smart Crd/PC Apps RoHS:否 制造商:STMicroelectronics 核心:ARM Cortex M4F 处理器系列:STM32F373xx 数据总线宽度:32 bit 最大时钟频率:72 MHz 程序存储器大小:256 KB 数据 RAM 大小:32 KB 片上 ADC:Yes 工作电源电压:1.65 V to 3.6 V, 2 V to 3.6 V, 2.2 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:LQFP-48 安装风格:SMD/SMT
AT91SC321RC-MQC-AM7 功能描述:ARM微控制器 - MCU For Secure Trnsactns in Smart Crd/PC Apps RoHS:否 制造商:STMicroelectronics 核心:ARM Cortex M4F 处理器系列:STM32F373xx 数据总线宽度:32 bit 最大时钟频率:72 MHz 程序存储器大小:256 KB 数据 RAM 大小:32 KB 片上 ADC:Yes 工作电源电压:1.65 V to 3.6 V, 2 V to 3.6 V, 2.2 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:LQFP-48 安装风格:SMD/SMT