Clock / Instruction Cycle Q1 Instruction Fetch Q2 Instruction Decode Q3 Execute Q4 Write Back Pipelining: each instruction is executed in one cycle. Two cycles for JUMP and CALL instructions.
PIC16F84 Register File
PIC16F84 Status Register
Instruction Set Summary Byte Oriented Bit Oriented Literal Control Operations Only 35 instructions!! Impressive!!!
Byte Oriented CLRF DECF INCF ADDWF
Bit Oriented BCF BSF
Literal MOVLW ADDLW ANDLW IORLW XORLW
Control Operations CALL RETURN GOTO SLEEP
Programming Example Setting PORTB as Output 1. Set RP0 in Status Register to switch to BANK1. This allows access to TRISB. 2. Write 0x00 into TRISB. 3. Clear RP0 in Status Register to switch to BANK0. This allows access to PORTB.
Assembly Programming Steps to write some code 1. Tell the assembler which MPU you are using. 2. Include the header file. 3. Set PC to 0 4. Write some code 5. Keep an endless loop. 6. Use the end directive.