Datasheet
1996 Microchip Technology Inc. DS30412C-page 135
PIC17C4X
SLEEP
Enter SLEEP mode
Syntax: [
label
] SLEEP
Operands: None
Operation: 00h → WDT;
0 → WDT postscaler;
1 → T
O;
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 prescaler
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 Read
register
PCLATH
Execute NOP
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'
Execute 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=1