News |
Coming soon! 9060 Blade. |
|
CLRF |
Command:
Syntax:
Status Flags Effected: |
CLRF CLRF f Z
|
CLRF clears the register (sets all bits to zero) specified by 'f'.
Code Example 1: Clear a register named TEMP. |
CLRF TEMP
|
Clear the register labeled TEMP.
|
CLRW |
Command:
Syntax:
Status Flags Effected: |
CLRW CLRW Z
|
CLRW clears the working register (sets all bits to zero).
CLRW is equivalent to the command MOVLW 0x00, though the MOVLW command
does not effect any flags.
CLRWDT |
Command:
Syntax:
Status Flags Effected: |
CLRWDT CLRWDT TO, PD
|
CLRWDT clears the watchdog timer. If you have the watchdog timer enabled,
it's important to toss this command into your code frequently and most
certainly in all loops. If the watchdog timers expires, the
microcontroller will reset and begin executing code as if it had just
been powered up.
Testing
the TO and PD bits in the status register will help determin if the
watchdog timer has expired and if the microcontroller has reset.
The
specific of the embedded design will determine if the watchdog timer is
needed or not. If the design is such where the application will be
unattended for long period of time and data logging is required, then
using the watchdog timer is advised.
|
|