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

PIC17LC42-16I/JW 参数 Datasheet PDF下载

PIC17LC42-16I/JW图片预览
型号: PIC17LC42-16I/JW
PDF下载: 下载PDF文件 查看货源
内容描述: 高性能8位CMOS EPROM / ROM微控制器 [High-Performance 8-Bit CMOS EPROM/ROM Microcontroller]
分类和应用: 微控制器可编程只读存储器电动程控只读存储器
文件页数/大小: 240 页 / 1141 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第23页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第24页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第25页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第26页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第28页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第29页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第30页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第31页  
PIC17C4X  
Example 5-1 shows the saving and restoring of infor-  
mation for an interrupt service routine. The PUSH and  
POP routines could either be in each interrupt service  
routine or could be subroutines that were called.  
Depending on the application, other registers may also  
need to be saved, such as PCLATH.  
5.9  
Context Saving During Interrupts  
During an interrupt, only the returned PC value is saved  
on the stack. Typically, users may wish to save key reg-  
isters during an interrupt; e.g. WREG, ALUSTA and the  
BSR registers. This requires implementation in soft-  
ware.  
EXAMPLE 5-1: SAVING STATUS AND WREG IN RAM  
;
; The addresses that are used to store the CPUSTA and WREG values  
; must be in the data memory address range of 18h - 1Fh. Up to  
; 8 locations can be saved and restored using  
; the MOVFP instruction. This instruction neither affects the status  
; bits, nor corrupts the WREG register.  
;
;
PUSH  
MOVFP  
MOVFP  
MOVFP  
WREG, TEMP_W  
ALUSTA, TEMP_STATUS ; Save ALUSTA  
; Save WREG  
BSR, TEMP_BSR  
TEMP_W, WREG  
; Save BSR  
ISR  
POP  
:
:
; This is the interrupt service routine  
; Restore WREG  
MOVFP  
MOVFP  
MOVFP  
RETFIE  
TEMP_STATUS, ALUSTA ; Restore ALUSTA  
TEMP_BSR, BSR  
; Restore BSR  
; Return from Interrupts enabled  
1996 Microchip Technology Inc.  
DS30412C-page 27  
 复制成功!