PIC16LC642-04/SO Microchip Technology, PIC16LC642-04/SO Datasheet - Page 68
![IC MCU OTP 4KX14 COMP 28SOIC](/photos/6/59/65909/150-28-soic_sml.jpg)
PIC16LC642-04/SO
Manufacturer Part Number
PIC16LC642-04/SO
Description
IC MCU OTP 4KX14 COMP 28SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Cr
Datasheet
1.PIC16C642-04SO.pdf
(137 pages)
Specifications of PIC16LC642-04/SO
Core Processor
PIC
Core Size
8-Bit
Speed
4MHz
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)
3 V ~ 6 V
Oscillator Type
External
Operating Temperature
0°C ~ 70°C
Package / Case
28-SOIC (7.5mm Width)
Processor Series
PIC16LC
Core
PIC
Data Bus Width
8 bit
Data Ram Size
176 B
Interface Type
RS- 232
Maximum Clock Frequency
4 MHz
Number Of Programmable I/os
22
Number Of Timers
8
Operating Supply Voltage
3 V to 6 V
Maximum Operating Temperature
+ 70 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734
Development Tools By Supplier
ICE2000, DM163022
Minimum Operating Temperature
0 C
On-chip Adc
10 bit
Data Rom Size
176 B
Height
2.31 mm
Length
17.87 mm
Supply Voltage (max)
6 V
Supply Voltage (min)
3 V
Width
7.49 mm
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Data Converters
-
Connectivity
-
Lead Free Status / Rohs Status
Details
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.