PIC16C642-10E/SO Microchip Technology, PIC16C642-10E/SO Datasheet - Page 68

IC MCU OTP 4KX14 COMP 28SOIC

PIC16C642-10E/SO

Manufacturer Part Number
PIC16C642-10E/SO
Description
IC MCU OTP 4KX14 COMP 28SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Cr
Datasheets

Specifications of PIC16C642-10E/SO

Core Processor
PIC
Core Size
8-Bit
Speed
10MHz
Peripherals
Brown-out Detect/Reset, LED, POR, WDT
Number Of I /o
22
Program Memory Size
7KB (4K x 14)
Program Memory Type
OTP
Ram Size
176 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 6 V
Oscillator Type
External
Operating Temperature
-40°C ~ 125°C
Package / Case
28-SOIC (7.5mm Width)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Data Converters
-
Connectivity
-
PIC16C64X & PIC16C66X
9.6
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:
MOVWF
SWAPF
BCF
MOVWF
SWAPF
MOVWF
SWAPF
SWAPF
DS30559A-page 68
:
: (Interrupt Service Routine)
:
Context Saving During Interrupts
W_TEMP
STATUS,W
STATUS,RP0
STATUS_TEMP
STATUS_TEMP,W
STATUS
W_TEMP,F
W_TEMP,W
SAVING THE STATUS AND W REGISTERS IN RAM
; Copy W to a Temporary Register regardless of current bank
; Swap STATUS nibbles and place into W register
; Change to Bank 0 regardless of current bank
; Save STATUS to a Temporary register in Bank 0
; Swap original STATUS register value into W (restores original bank)
; Restore STATUS register from W register
; Swap W_Temp nibbles and return value to W_Temp
; Swap W_Temp to W to restore original W value without affecting STATUS
Preliminary
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
• Restores the W register
register)
1996 Microchip Technology Inc.

Related parts for PIC16C642-10E/SO