参数资料
型号: PIC16LC433E/P
元件分类: 微控制器/微处理器
英文描述: 8-BIT, OTPROM, 4 MHz, RISC MICROCONTROLLER, PDIP18
封装: 0.300 INCH, PLASTIC, DIP-18
文件页数: 82/122页
文件大小: 1862K
代理商: PIC16LC433E/P
PIC16C433
DS41139A-page 60
Advance Information
2001 Microchip Technology Inc.
9.5.1
TMR0 INTERRUPT
An overflow (FFh
→ 00h) in the TMR0 register will set
flag bit T0IF (INTCON<2>). The interrupt can be
enabled/disabled by setting/clearing enable bit T0IE
(INTCON<5>) (see Section 7.0). The flag bit T0IF
(INTCON<2>) will be set, regardless of the state of the
enable bits. If used, this flag must be cleared in software.
9.5.2
INT INTERRUPT
External interrupt on GP2/INT pin is edge triggered;
either rising if bit INTEDG (OPTION<6>) is set, or fall-
ing, if the INTEDG bit is clear. When a valid edge
appears
on
the
GP2/INT
pin,
flag
bit
INTF
(INTCON<1>) is set. This interrupt can be disabled by
clearing enable bit INTE (INTCON<4>). Flag bit INTF
must be cleared in software in the Interrupt Service
Routine before re-enabling this interrupt. The INT inter-
rupt can wake-up the processor from SLEEP, if bit INTE
was set prior to going into SLEEP. The status of global
interrupt enable bit GIE decides whether or not the pro-
cessor branches to the interrupt vector following wake-
up. See Section 9.8 for details on SLEEP mode.
9.5.3
GPIO INTCON CHANGE
An input change on GP3, GP1 or GP0 sets flag bit GPIF
(INTCON<0>). The interrupt can be enabled/disabled by
setting/clearing
enable
bit
GPIE
(INTCON<3>)
(Section 5.1) . This flag bit GPIF (INTCON<0>) will be
set, regardless of the state of the enable bits. If used, this
flag must be cleared in software.
9.6
Context Saving During Interrupts
During an interrupt, only the return PC value is saved
on the stack. Typically, users may wish to save key reg-
isters during an interrupt (i.e., W register and STATUS
register). This will have to be implemented in software.
Example 9-1 shows the storing and restoring of the
STATUS and W registers. The register, W_TEMP, must
be defined in both banks and must be defined at the
same offset from the bank base address (i.e., if
W_TEMP is defined at 0x20 in bank 0, it must also be
defined at 0xA0 in bank 1).
Example 9-2 shows the saving and restoring of
STATUS and W using RAM locations 0x70 - 0x7F.
W_TEMP is defined at 0x70 and STATUS_TEMP is
defined at 0x71.
The example:
a)
Stores the W register.
b)
Stores the STATUS register in bank 0.
c)
Executes the ISR code.
d)
Restores the STATUS register (and bank select
bit).
e)
Restores the W register.
f)
Returns from interrupt.
EXAMPLE 9-1:
SAVING STATUS AND W REGISTERS USING GENERAL PURPOSE RAM
(0x20 - 0x6F)
MOVWF
W_TEMP
;Copy W to TEMP register, could be bank one or zero
SWAPF
STATUS,W
;Swap status to be saved into W
BCF
STATUS,RP0
;Change to bank zero, regardless of current bank
MOVWF
STATUS_TEMP
;Save status to bank zero STATUS_TEMP register
:
:(ISR)
:
SWAPF
STATUS_TEMP,W
;Swap STATUS_TEMP register into W
;(sets bank to original state)
MOVWF
STATUS
;Move W into STATUS register
SWAPF
W_TEMP,F
;Swap W_TEMP
SWAPF
W_TEMP,W
;Swap W_TEMP into W
RETFIE
;Return from interrupt
EXAMPLE 9-2:
SAVING STATUS AND W REGISTERS USING SHARED RAM (0x70 - 0x7F)
MOVWF
W_TEMP
;Copy W to TEMP register (bank independent)
MOVF
STATUS,W
;Move STATUS register into W
MOVWF
STATUS_TEMP
;Save contents of STATUS register
:
:(ISR)
:
MOVF
STATUS_TEMP,W
;Retrieve copy of STATUS register
MOVWF
STATUS
;Restore pre-isr STATUS register contents
SWAPF
W_TEMP,F
;
SWAPF
W_TEMP,W
;Restore pre-isr W register contents
RETFIE
;Return from interrupt
相关PDF资料
PDF描述
PIC16LC556-04/SS 8-BIT, OTPROM, 4 MHz, RISC MICROCONTROLLER, PDSO20
PIC16LC662T-04/L 8-BIT, OTPROM, 4 MHz, RISC MICROCONTROLLER, PQCC44
PIC16C662T-20I/P 8-BIT, OTPROM, 20 MHz, RISC MICROCONTROLLER, PDIP40
PIC16C662T-20I/L 8-BIT, OTPROM, 20 MHz, RISC MICROCONTROLLER, PQCC44
PIC16C662T-04E/TQ 8-BIT, OTPROM, 4 MHz, RISC MICROCONTROLLER, PQFP44
相关代理商/技术参数
参数描述
PIC16LC433-I/P 功能描述:8位微控制器 -MCU 10MHz 2K EPROM RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC16LC433-I/SO 功能描述:8位微控制器 -MCU 10MHz 2K EPROM RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC16LC433T-I/SO 功能描述:8位微控制器 -MCU 10MHz 2K EPROM RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC16LC505-04/P 功能描述:8位微控制器 -MCU 1.5KB 72 RAM 12 I/O 4MHz PDIP14 RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC16LC505-04/SL 功能描述:8位微控制器 -MCU 1.5KB 72 RAM 12 I/O 4MHz SOIC14 RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT