Unformatted text preview:

Text Script for “PICmicro® x14 Instruction Set” Topic Slide Number Introduction 1 Instruction Set Overview 2 Instruction Set Summary 3 Byte-Oriented Operations 4 NOP 5 MOVWF 6 MOVF 7 CLRW/CLRW 8 INCF 9 DECF 10 ADDWF 11 Knowledge Check 1 12 SUBWF 13 ANDWF 14 IORWF 15 XORWF 16 COMF 17 RRF/RLF 18 Knowledge Check 2 19 INCFSZ/DECFSZ 20 SWAPF 21 Knowledge Check 3 22 Bit-Oriented Operations 23 Encoding Format 24 BCF/BSF 25 BTFSC/BTFSS 26 Knowledge Check 4 27 Literal and Control Operations 28 Encoding Format 29 MOVLW 30 Knowledge Check 5 31 ADDLW 32 SUBLW 33 ANDLW 34 IORLW/XORLW 35 GOTO 36 Knowledge Check 6 37 CALL/RETURN 38 RETLW 39 RETFIE 40 CLRWDT 41 SLEEP 42 Knowledge Check 7 43 14-Bit Core Instructions 44 Bit Manipulation Example 45 Knowledge Check 8 46 Performance Comparison 47 Closing Slide 48 Slide 1: Title SlidePICmicro® Instruction Set (x14) Thank you for joining the Microchip Technology Inc. PICmicro x14 Instruction set training class. For this presentation, we assume that you have already attended the x14 architecture class or are already somewhat familiar with the PICmicro x14 architecture.Slide 2. PICmicro MCU Instruction Set 12 - bit Core14 - bit Core16 - bit Core16 - bit enh. Core16 - bit Core33 Instructions35 Instructions58 Instructions77 Instructions58 InstructionsPICmicro MCU Instruction Set— Easy to learn— High Compaction— Very powerful single word instructions— All single-cycle except program branches— Upward compatibility of instructions The instruction sets for Microchips different PICmicro architectures range from 33 instructions for the x12 bit core to 7 instructions for the x16 bit enhanced core. The x14 bit PICmicro family as you can see has 35 instructions. When we say “x14”, this indicates that the instruction word is 14 bits wide as opposed to the x12 architecture which is 12 bits wide or the x16 architectures which are 16bits wide. As mentioned before, there are only 35 instructions in the x14 instruction set, so it’s very easy to learn and there is a high level of code compaction. All instructions are single word, single cycle instructions, which makes it very easy to use and to count timing loops. The only exceptions to this rule are instructions that modify the program counter which take two cycles. For example, program branches are two cycle instructions because they disturb the pipe line. On the PICmicro families, one of the more important things to remember is that all of the instructions are upward compatible. This means that the 33 instructions on the 12 bit core are also available as part of the instruction sets in the PICmicro family all the way up to the 16 bit enhanced core. This is important because it makes it very easy for you to migrate your code from one architecture to another.Slide 3. PICmicro MCU Instruction Set Summary BCFBSFBTFSCBTFSSf,bf,bf,bf,bBit clear fBit set fBit test f, skip if clearBit test f, skip if setSLEEPCLRWDTRETLWRETFIERETURNCALLGOTOMOVLWIORLWADDLWSUBLWANDLWXORLW--k--kkkkkkkkGo into standby modeClear watchdog timerReturn, place literal in WReturn from interruptReturn from subroutineCall subroutineGo to address (k is 9-bit)Move literal to WInclusive OR literal with WAdd literal with WSubtract W from literalAND literal with WExclusive OR literal with WByte-Oriented Operations TableBit-Oriented Operations TableLiteral and Control Operationsf = File Register k = literal value (8-bit) b = bit address <0,7> d = destination (0 = f, 1 = W) Swap nibbles of fSWAPF f,dDecrement f, skip if zeroDECFSZ f,dIncrement f, skip if zeroINCFSZ f,dRotate left f through carryf,dRLFRotate right f through carryf,dRRFComplement ff,dCOMFExclusive OR W and ff,dXORWFInclusive OR W and ff,dIORWFAND W and ff,dANDWFSubtract W from ff,dSUBWFAdd W and ff,dADDWFDecrement ff,dDECFIncrement fINCF f,dClear fCLRF fClear WCLRW -Move fMOVF f,dMove W to fMOVWF f,dNo OperationNOP -PICmicro x14 Instruction Set This slide gives us a summary of the 35 instructions in the x14 bit wide instruction set The instruction set is broken up into 3 major groups; Byte oriented operations, Bit-Oriented operations and the Literal and Control operations. We will go through each one of these blocks in more detail in the following slides.Slide 4. Byte-Oriented Operations 013 PICmicro MCU Instruction SetByte-Oriented Operations14-bit Wide InstructionNOP-MOVWFfCLRW-CLRFfSUBWFf,dDECFf,dIORWFf,dANDWFf,dXORWFf,dADDWFf,dMOVFf,dCOMFf,dINCFf,dDECFSZf,dRRFf,dRLFf,dSWAPFf,dINCFSZf,dByte-Oriented OperationsNOP-MOVWFfCLRW-CLRFfSUBWFf,dDECFf,dIORWFf,dANDWFf,dXORWFf,dADDWFf,dMOVFf,dCOMFf,dINCFf,dDECFSZf,dRRFf,dRLFf,dSWAPFf,dINCFSZf,dByte-Oriented OperationsNOP-MOVWFfCLRW-CLRFfSUBWFf,dDECFf,dIORWFf,dANDWFf,dXORWFf,dADDWFf,dMOVFf,dCOMFf,dINCFf,dDECFSZf,dRRFf,dRLFf,dSWAPFf,dINCFSZf,dByte-Oriented OperationsNOP-MOVWFfCLRW-CLRFfSUBWFf,dDECFf,dIORWFf,dANDWFf,dXORWFf,dADDWFf,dMOVFf,dCOMFf,dINCFf,dDECFSZf,dRRFf,dRLFf,dSWAPFf,dINCFSZf,dByte-Oriented OperationsNOP-MOVWFfCLRW-CLRFfSUBWFf,dDECFf,dIORWFf,dANDWFf,dXORWFf,dADDWFf,dMOVFf,dCOMFf,dINCFf,dDECFSZf,dRRFf,dRLFf,dSWAPFf,dINCFSZf,dByte-Oriented OperationsNOP-MOVWFfCLRW-CLRFfSUBWFf,dDECFf,dIORWFf,dANDWFf,dXORWFf,dADDWFf,dMOVFf,dCOMFf,dINCFf,dDECFSZf,dRRFf,dRLFf,dSWAPFf,dINCFSZf,dByte-Oriented OperationsOP CODEd = Destination Bitd = 0 = w =store results in W Registerd = 1 = f = store results in File RegisterFILEdf6f5f4f3f2f1f0File Register to perform Operations on First of all let’s take a look at the byte oriented operations. (As the name implies, these instructions all move or manipulate an entire byte of data.) The encoding format of 14 bit instruction is shown here. Each operation starts with a 6 bit op code which is the Mnemonic that determines which instruction will be executed. As you can see in the table, there are 18 instructions that are considered Byte-Oriented instructions. Most but not all of the instructions have a destination bit which determines where the result of the instruction is stored. If the destination bit is set to a 0, then after the instruction is executed, the result will be stored in the W register and the File


View Full Document

CU-Boulder PHYS 3330 - PICmicro MCU Instruction Set

Download PICmicro MCU Instruction Set
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view PICmicro MCU Instruction Set and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view PICmicro MCU Instruction Set 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?