欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC16F916-I/SO 参数 Datasheet PDF下载

PIC16F916-I/SO图片预览
型号: PIC16F916-I/SO
PDF下载: 下载PDF文件 查看货源
内容描述: 40分之28 / 44/ 64引脚基于闪存的8位CMOS微控制器与LCD驱动器和纳瓦技术 [28/40/44/64-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology]
分类和应用: 驱动器闪存微控制器和处理器外围集成电路光电二极管PC时钟
文件页数/大小: 330 页 / 6045 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC16F916-I/SO的Datasheet PDF文件第231页浏览型号PIC16F916-I/SO的Datasheet PDF文件第232页浏览型号PIC16F916-I/SO的Datasheet PDF文件第233页浏览型号PIC16F916-I/SO的Datasheet PDF文件第234页浏览型号PIC16F916-I/SO的Datasheet PDF文件第236页浏览型号PIC16F916-I/SO的Datasheet PDF文件第237页浏览型号PIC16F916-I/SO的Datasheet PDF文件第238页浏览型号PIC16F916-I/SO的Datasheet PDF文件第239页  
PIC16F913/914/916/917/946  
16.3.4  
CONTEXT SAVING DURING  
INTERRUPTS  
During an interrupt, only the return PC value is saved  
on the stack. Typically, users may wish to save key  
registers during an interrupt (e.g., W and STATUS  
registers). This must be implemented in software.  
Since the lower 16 bytes of all banks are common in the  
PIC16F91X/946 (see Figure 2-3), temporary holding  
registers, W_TEMP and STATUS_TEMP, should be  
placed in here. These 16 locations do not require  
banking and therefore, make it easier to context save  
and restore. The same code shown in Example 16-1  
can be used to:  
• Store the W register  
• Store the STATUS register  
• Execute the ISR code  
• Restore the STATUS register (Bank Select bits)  
• Restore the W register  
Note:  
The microcontroller does not normally  
require saving the PCLATH register  
unless it is modified in code either directly  
or via the pagesel macro. Then, the  
PCLATH register must be saved at the  
beginning of the ISR, managed for CALLs  
and GOTOs in the ISR and restored when  
the ISR is complete to ensure correct  
program flow.  
EXAMPLE 16-1:  
SAVING STATUS AND W REGISTERS IN RAM  
MOVWF  
SWAPF  
CLRF  
MOVWF  
:
W_TEMP  
STATUS,W  
STATUS  
;Copy W to TEMP register  
;Swap status to be saved into W  
;bank 0, regardless of current bank, Clears IRP,RP1,RP0  
;Save status to bank zero STATUS_TEMP register  
STATUS_TEMP  
:(ISR)  
:
;Insert user code here  
SWAPF  
STATUS_TEMP,W  
;Swap STATUS_TEMP register into W  
;(sets bank to original state)  
;Move W into STATUS register  
;Swap W_TEMP  
MOVWF  
SWAPF  
SWAPF  
STATUS  
W_TEMP,F  
W_TEMP,W  
;Swap W_TEMP into W  
© 2007 Microchip Technology Inc.  
DS41250F-page 233  
 复制成功!