Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

PIC16C641-04/SP Datasheet(PDF) 68 Page - Microchip Technology

Part # PIC16C641-04/SP
Description  8-Bit EPROM Microcontrollers with Analog Comparators
PDF  136 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16C641-04/SP Datasheet(HTML) 68 Page - Microchip Technology

Back Button PIC16C641-04/SP Datasheet HTML 64Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 65Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 66Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 67Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 68Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 69Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 70Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 71Page - Microchip Technology PIC16C641-04/SP Datasheet HTML 72Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 68 / 136 page
background image
PIC16C64X & PIC16C66X
DS30559A-page 68
Preliminary
© 1996 Microchip Technology Inc.
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 e.g. W register and STATUS
register. This will have to be implemented in software.
Example 9-1 stores and restores the STATUS and W
registers. The user register, W_TEMP, must be defined
in both banks and must be defined at the same offset
from the bank base address (i.e., W_TEMP is defined
at 0x70 - 0x7F in Bank 0). The user register,
STATUS_TEMP, must be defined in Bank 0.
Example 9-1:
• Stores the W register regardless of current bank
• Stores the STATUS register in Bank 0
• Executes the ISR code
• Restores the STATUS (and bank select bit
register)
• Restores the W register
EXAMPLE 9-1:
SAVING THE STATUS AND W REGISTERS IN RAM
MOVWF
W_TEMP
; Copy W to a Temporary Register regardless of current bank
SWAPF
STATUS,W
; Swap STATUS nibbles and place into W register
BCF
STATUS,RP0
; Change to Bank 0 regardless of current bank
MOVWF
STATUS_TEMP
; Save STATUS to a Temporary register in Bank 0
:
: (Interrupt Service Routine)
:
SWAPF
STATUS_TEMP,W
; Swap original STATUS register value into W (restores original bank)
MOVWF
STATUS
; Restore STATUS register from W register
SWAPF
W_TEMP,F
; Swap W_Temp nibbles and return value to W_Temp
SWAPF
W_TEMP,W
; Swap W_Temp to W to restore original W value without affecting STATUS



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com