F5HLA

http://f4hla.free.fr/

PIC - Datasheet (Electronic)

The purpuse of this little page is just to give basics about PIC 16F84 (or 16C84).

mnemonic

Instructions on registers ( octets )modified bits
ADDWF f,dd:=W+fC,DC,Z
ANDWF f,dd:=W AND fZ
CLRF ff:=0Z
CLRWW:=0Z
COMF f,d d:=NOT(f) Z
DECF f,dd:=f-1Z
DECFSZ f,dd:=f-1 ; Skip if Zero.
INCF f,dd:=f+1Z
INCFSZ f,dd:=f+1 ; Skip if Zero.
IORWF f,dd:=W OR fZ
MOVF f,dd:=f ( good test of f=0 while doing MOVF f,1 )z
MOVWF ff:=W.
NOPno operation.
RLF f,dd=f SHL 1 C
RRF f,dd=f SHR 1 C
SUBWF f,dd:= f-W (2 complement--> d:=f + not (W) +1 )C,DC,Z
SWAPF f,dd:= f[4..7] <--> f[0..3] .
XORWF f,dd:= W XOR fZ


mnemonicInstructions on registers ( bit per bit )modified bits
BCF f,bf[b]:=0 (put the b bit of f to 0).
BSF f,bf[b]:=1 (put the b bit of f to 1).
BTFSC f,btest bit b of f ; Skip if Clear ( 0 ).
BTFSS f,btest bit b of f ; Skip if Set ( 1 ).


mnemonicControl Instructionsmodified bits
ADDLW kW:=W+kC,DC,Z
ANDLW kW:=W AND kZ
CALL kcall a subprogram.
CLRWDTclear watchdog timerTO,PD
GOTO kjump to adress k.
IORLW kW:=W OR kZ
MOVLW kW:=k.
RETFIEreturn of an interruption.
RETLW kw:=k , and return of a sub program.
RETURNand return of a sub program.
SLEEPsleep mode and oscillator in off modeTO,PD
SUBLW kW:=k-WC,DC,Z
XORLW kW:=W XOR kZ

d can be 0 or 1. If d is 0, d is W, else if d is 1, d is f (the register on which we are working on).

I suggest to define W EQU 0 andF EQU 1 at the beggining of the program and to use W or F where to stock the result. If you use include files (P16F84.inc), those constants are already defined there.


The full datasheet of the pic16f84 is available [HERE].