DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

PIC16C715-10E/P View Datasheet(PDF) - Microchip Technology

Part Name
Description
Manufacturer
PIC16C715-10E/P
Microchip
Microchip Technology 
PIC16C715-10E/P Datasheet PDF : 176 Pages
First Prev 61 62 63 64 65 66 67 68 69 70 Next Last
PIC16C71X
8.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 8-1 stores and restores the STATUS and W
registers. The user register, STATUS_TEMP, must be
defined in bank 0.
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.
EXAMPLE 8-1: SAVING STATUS AND W REGISTERS IN RAM
MOVWF W_TEMP
;Copy W to TEMP register, could be bank one or zero
SWAPF STATUS,W
;Swap status to be saved into W
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
DS30272A-page 64
© 1997 Microchip Technology Inc.

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]