44-Pin Demo Board User’s Guide
Data Memory is held in file registers . Instructions referring to file registers use 7 bits,
so only 128 file registers can be addressed. Multiple file registers are arranged into
“banks”. Two bits in the STATUS register, RP0 and RP1, allow accessing different
banks. These two bits effectively become the top two bits of the file register address.
The additional banks may or may not be implemented, depending on the device.
Mid-range devices reserve the first 32 addresses of each bank for Special Function
Registers (SFRs). SFRs are how the program interacts with the peripherals and some
core features. The controls and data registers are memory mapped into the SFR space.
Addresses above 0x20 to the end of each bank are General Purpose Registers
(GPRs), where program variables may be stored.
Some frequently used registers may be accessed from any bank. For example, the
STATUS register is always available no matter which bank is selected via the RP bits.
The last 16 bytes (0x70-0x7F) of the GPRs may also be accessed from any bank.
Program Memory is accessed via a 13-bit Program Counter (PC). The lower 8 bits are
accessible via SFR (PCL), and the upper 5 are at a PCLATH. See the PIC16F88X Data
Sheet’s (DS41291) section on PCL and PCLATH for more details on the PC. PCLATH
becomes important when program memory size exceeds 1k instructions, and also for
the table look-up in Lesson 12.
Mid-range PIC ? MCUs may be clocked by a number of different devices. Unless oth-
erwise noted, the lessons in this manual use the Internal Oscillator running at 4 MHz.
2.3
INSTRUCTION FORMATS
Most instructions follow one of three formats: Byte oriented instructions, Bit oriented
instructions and Literal instructions.
Byte instructions contain a 7-bit data address, a destination bit, and a 6-bit op code.
The data address plus the RP0 and RP1 bits create a 9-bit data memory address for
one operand. The other operand is the Working register (called W or WREG). After the
instruction executes, the destination bit (d) specifies whether the result will be stored in
the WREG (‘w’) or back in the original file register (‘f’). For example:
ADDWF
data,f
adds the contents of WREG and file register data , with the result going back into data .
Bit instructions operate on a specific bit within a file register. They contain 7 bits of data
address, a 3-bit number and the remaining 4 bits are op code. These instructions may
set or clear a specific bit within a file register. They may also be used to test a specific
bit within a file register. For example:
BSF
STATUS,RP0
set the RP0 bit in the STATUS register.
Literal instructions contain the data operand within the instruction. The WREG
becomes the other operand. Calls and GOTO ’s use 11 bits as a literal address.
MOVLW
'A'
Moves the ASCII value of ‘A’ (0x41) into the WREG.
DS41296B-page 10
? 2007 Microchip Technology Inc.
相关PDF资料
DM240011 KIT STARTER MPLAB FOR PIC24F MCU
DM240021 KIT STARTER MPLAB FOR PIC24H
DM240311 BOARD DEV PIC24F16KA102 XLP
DM300018 BOARD DEMO DSPICDEM 2
DM300019 BOARD DEMO DSPICDEM 80L STARTER
DM300024 KIT DEMO DSPICDEM 1.1
DM330012 KIT USB STARTER FOR DSPIC33E
DM330013 MICROSTICK DSPIC33F/PIC24H BOARD
相关代理商/技术参数
DM240002 制造商:Microchip Technology Inc 功能描述:Explorer 16 kit(44-PIN) w/ PIC24FJ64GA00
DM240011 功能描述:开发板和工具包 - PIC / DSPIC MPLAB Starter Kit for PIC24F MCU RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240012 功能描述:开发板和工具包 - PIC / DSPIC PIC24E USB Starter Kit RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240013-1 功能描述:开发板和工具包 - PIC / DSPIC Microstick for 3V PIC24F K-series RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240013-2 功能描述:开发板和工具包 - PIC / DSPIC RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240014 制造商:Microchip Technology Inc 功能描述:MICROSTICK FOR USB PIC24F - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:ACCY MICROSTICK USB PIC24F 制造商:Microchip Technology Inc 功能描述:MICROSTICK USB PIC24F
DM240015 制造商:Microchip Technology Inc 功能描述:MPLAB STARTER KIT FOR PIC24F INTELLIGENT INTEGRATED ANALOG - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:KIT MPLAB STARTER FOR PIC24F ANL 制造商:Microchip Technology Inc 功能描述:PIC24F GC INTELLIGENT ANALOG DEV KIT 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT 制造商:Microchip Technology Inc 功能描述:Starter Kit for PIC24F Intelligent Integrated Analog Series 制造商:Microchip Technology Inc 功能描述:Development Boards & Kits - PIC / DSPIC 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT, Silicon Manufacturer:Microchip, Core Arc 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT, Silicon Manufacturer:Microchip, Core Architecture:PIC, Core Sub-Architecture:PIC24, Silicon Core Number:PIC24FJ128GC010, Silicon Family Name:PIC24FJxxxGCxxx, Kit Contents:Starter Board 制造商:Microchip Technology Inc 功能描述:MPLAB Starter Kit for PIC24F Intelligent Integrated Analog, Starter Kits
DM240021 功能描述:开发板和工具包 - PIC / DSPIC MPLAB STARTER KIT FOR PIC24H RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: