PIC17C42 Microchip Technology, PIC17C42 Datasheet - Page 27

no-image

PIC17C42

Manufacturer Part Number
PIC17C42
Description
High-Performance 8-Bit CMOS EPROM/ROM Microcontroller
Manufacturer
Microchip Technology
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC17C42-16/JW
Manufacturer:
AD
Quantity:
12
Part Number:
PIC17C42A-16/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC17C42A-16/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-25/P
Manufacturer:
MICROCLOCK
Quantity:
20 000
5.9
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:
;
; 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
ISR
POP
1996 Microchip Technology Inc.
Context Saving During Interrupts
MOVFP
MOVFP
MOVFP
:
:
MOVFP
MOVFP
MOVFP
RETFIE
WREG, TEMP_W
ALUSTA, TEMP_STATUS
BSR, TEMP_BSR
TEMP_W, WREG
TEMP_STATUS, ALUSTA
TEMP_BSR, BSR
SAVING STATUS AND WREG IN RAM
; Save WREG
; Save ALUSTA
; Save BSR
; This is the interrupt service routine
; Restore WREG
; Restore ALUSTA
; Restore BSR
; Return from Interrupts enabled
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.
PIC17C4X
DS30412C-page 27

Related parts for PIC17C42