Part 1: Introduction to PIC16F18875 Instruction Set
Overview of PIC16F18875 Architecture
The PIC16F18875 is part of Microchip’s mid-range core devices, featuring a 14-bit wide instruction word. This architecture provides a balance between code density, performance, and flexibility, making it suitable for a wide range of embedded applications.Key features of the PIC16F18875 instruction set:
- 14-bit instruction word
- 49 instructions (in the enhanced mid-range core)
- Harvard architecture (separate program and data memory)
- 8-bit data path
- 16-bit wide program memory
2. Instruction Formats
The PIC16F18875 uses several instruction formats:
- Byte-oriented operations
- Bit-oriented operations
- Literal operations
- Control operations
Each format is designed to efficiently handle different types of operations, from data manipulation to program flow control.
3. Special Function Registers (SFRs)
The PIC16F18875 uses Special Function Registers for controlling various peripheral functions and device operations. These registers can often be used as source or destination operands in instructions, allowing direct manipulation of device settings and status.
4. Basic Instruction Categories
- Arithmetic and Logic Instructions
- ADD, SUB, AND, OR, XOR, etc.
- Data Movement Instructions
- MOV, MOVF, MOVWF, etc.
- Bit Manipulation Instructions
- BSF, BCF, BTFSS, BTFSC, etc.
- Program Control Instructions
- GOTO, CALL, RETURN, etc.
- Special Instructions
- SLEEP, CLRWDT, NOP, etc.
5. Addressing Modes
The PIC16F18875 supports several addressing modes:
- Direct Addressing: The operator’s address is part of the instruction
- Indirect Addressing: Address is specified by a pointer register
- Immediate Addressing: The operator value is part of the instruction
Below are the lecture videos to support the reading and lab assignments.