Datasheet
1998-2013 Microchip Technology Inc. DS30289C-page 225
PIC17C7XX
SLEEP
Enter SLEEP mode
Syntax: [ label ] SLEEP
Operands: None
Operation: 00h WDT;
0 WDT postscaler;
1 TO
;
0 PD
Status Affected: TO, PD
Encoding:
0000 0000 0000 0011
Description:
The power-down status bit (PD) is
cleared. The time-out status bit (TO
) is
set. Watchdog Timer and its post-
scaler are cleared.
The processor is put into SLEEP
mode with the oscillator stopped.
Words: 1
Cycles: 1
Q Cycle Activity:
Q1 Q2 Q3 Q4
Decode No
operation
Process
Data
Go to
sleep
Example:
SLEEP
Before Instruction
TO =?
PD
=?
After Instruction
TO =1 †
PD
=0
† If WDT causes wake-up, this bit is cleared
SUBLW Subtract WREG from Literal
Syntax: [ label ]SUBLW k
Operands: 0 k 255
Operation: k – (WREG) WREG)
Status Affected: OV, C, DC, Z
Encoding:
1011 0010 kkkk kkkk
Description:
WREG is subtracted from the eight-bit
literal 'k'. The result is placed in
WREG.
Words: 1
Cycles: 1
Q Cycle Activity:
Q1 Q2 Q3 Q4
Decode Read
literal 'k'
Process
Data
Write to
WREG
Example 1:
SUBLW 0x02
Before Instruction
WREG = 1
C=?
After Instruction
WREG = 1
C = 1 ; result is positive
Z=0
Example 2:
Before Instruction
WREG = 2
C=?
After Instruction
WREG = 0
C = 1 ; result is zero
Z=1
Example 3:
Before Instruction
WREG = 3
C=?
After Instruction
WREG = FF ; (2’s complement)
C = 0 ; result is negative
Z=0