PIC16C9XX
CLRWDT
Clear Watchdog Timer
Syntax:
[ label ] CLRWDT
Operands:
None
Operation:
00h → WDT
0 → WDT prescaler,
1 → TO
1 → PD
Status Affected: TO, PD
Encoding:
00 0000 0110 0100
Description:
CLRWDT instruction resets the Watch-
dog Timer. It also resets the prescaler
of the WDT. Status bits TO and PD are
set.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
No-
Process
Operation data
Clear
WDT
Counter
Example
CLRWDT
Before Instruction
WDT counter =
After Instruction
WDT counter =
WDT prescaler=
TO
=
PD
=
?
0x00
0
1
1
COMF
Complement f
Syntax:
[ label ] COMF f,d
Operands:
0 ≤ f ≤ 127
d ∈ [0,1]
Operation:
(f) → (destination)
Status Affected: Z
Encoding:
00 1001 dfff ffff
Description:
The contents of register 'f' are comple-
mented. If 'd' is 0 the result is stored in
W. If 'd' is 1 the result is stored back in
register 'f'.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1 Q2 Q3
Q4
Decode
Read
register
'f'
Process Write to
data destination
Example
COMF
REG1,0
Before Instruction
REG1 =
After Instruction
REG1 =
W
=
0x13
0x13
0xEC
DECF
Decrement f
Syntax:
[label] DECF f,d
Operands:
0 ≤ f ≤ 127
d ∈ [0,1]
Operation:
(f) - 1 → (destination)
Status Affected: Z
Encoding:
00 0011 dfff ffff
Description:
Decrement register 'f'. If 'd' is 0 the
result is stored in the W register. If 'd' is
1 the result is stored back in register 'f'.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1 Q2 Q3
Q4
Decode
Read
register
'f'
Process Write to
data destination
Example
DECF CNT, 1
Before Instruction
CNT =
Z
=
After Instruction
CNT =
Z
=
0x01
0
0x00
1
DS30444E - page 126
© 1997 Microchip Technology Inc.