DM164120-1 Microchip Technology, DM164120-1 Datasheet - Page 34

BOARD DEMO PICKIT 2 LP COUNT

DM164120-1

Manufacturer Part Number
DM164120-1
Description
BOARD DEMO PICKIT 2 LP COUNT
Manufacturer
Microchip Technology
Type
MCUr
Datasheet

Specifications of DM164120-1

Contents
3 Boards (1 Populated, 2 Bare)
Processor To Be Evaluated
PIC16F690
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC16
Silicon Core Number
PIC16F
Silicon Family Name
PIC16F6xxx
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
28-pin PIC16C, 16F, 18C, 18F
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM164120-1
Manufacturer:
Microchip Technology
Quantity:
135
Low Pin Count Demo Board User’s Guide
DS51556A-page 30
Restore Context
Once the peripheral is serviced, it needs to restore the context and resume the main
program. Restoring the context is a little harder than it might seem at first. The obvious
method doesn’t work because the MOVF W_Temp,w may affect the Z flag, which was
restored in the previous instruction. Instead, a pair of SWAPF instructions can restore
Wreg without affecting the flags in the Status register. SWAPF exchanges the high and
low nibbles. The first SWAPF switches the nibbles in the file register and the second one
switches them back and puts the result in Wreg.
EXAMPLE 3-9:
Finally, RETFIE transfers control back to the original program and sets the GIE bit,
re-enabling interrupts.
FIGURE 3-10:
;incorrect context restore
MOVF
MOVWF STATUS
MOVF
;good context restore
MOVF
MOVWF STATUS
SWAPF W_Temp,f
SWAPF W_Temp,w
STATUS_Temp,w
W_Temp
STATUS_Temp,w
Before
SWAPF INSTRUCTION
CONTEXT RESTORE
After
1 0 1 0
0 0 1 1
;this may change the Z bit
;in the Status register
;swap in place
;swap with Wreg destination
0 0 1 1
1 0 1 0
© 2005 Microchip Technology Inc.

Related parts for DM164120-1