SlideShare a Scribd company logo
2
Most read
6
Most read
7
Most read
Register File Structure in PIC
16F877a or16F8XX
Presented By
Nirbhay Kumar Singh
nirbhaykumar2008@gmail.com
Roll No. 151607
ME – ECE – 2015 Batch
NITTTR Chandigarh
27-Dec-16 1
27-Dec-16 2
Register File Structure in PIC 16F8xx
The Registers
A register is a place inside the PIC that can be written to, read from or
both. Think of a register as a piece of paper where you can look at and
write information on.
Register File Structure
• Register file → locations that an instruction can access via an address.
• Register file consists of two component:-
1. General purpose register file (same as RAM)
2. Special purpose register file
27-Dec-16 Nirbhay Kr Singh, Roll No. 151607, ME-MOD-ECE-2015 3
RAM
(96 bytes)
Special purpose
Register
(32 bytes)
27-Dec-16 Nirbhay Kr Singh, Roll No. 151607, ME-MOD-ECE-2015 4
Extra 64
bytes of RAM
in
PIC 16 C63
16 C65A
16 C73A
16 C74A
RAM
(32 bytes)
Special purpose
Register
(32 bytes)
Bank 0
128 bytes
Bank 1
128 bytes
7F
20
1F
00
FF
C0
BF
A0
9F
80
27-Dec-16 5
Register File Structure in PIC 16F8xx
Registers in PIC
16F8XX
W or working
register (8 bit)
Status Register
(8 bits)
SFR (Special
Function
Registers)
GPR (General
Purpose
Registers)
27-Dec-16 6
Register File Structure in PIC 16F8xx
• 8 bits wide
• Contains one of the source
operands during the execution of
instructions.
• Serve as the destination for the
result of the operation.
• Only used for ALU operations..
W or
Working
Register
27-Dec-16 7
Register File Structure in PIC 16F8xx
Status Register (8 bits)
• 1 - Banks 0 and 1 are active (memory location 00h-FFh)
• 0 - Banks 2 and 3 are active (memory location 100h-1FFh)
IRP - Bit selects register bank. It is
used for indirect addressing.
• Bits select register bank. They are used for direct addressing.RP1,RP0
• 1 - After power-on or after executing CLRWDT instruction which resets watch-dog timer or SLEEP
instruction which sets the microcontroller into low-consumption mode.
• 0 - After watch-dog timer time-out has occurred.
TO - Time-out bit.
• 1 - After power-on or after executing CLRWDT instruction which resets watch-dog timer.
• 0 - After executing SLEEP instruction which sets the microcontroller into low-consumption
mode.
PD - Power-down bit.
• 1 - The result of an arithmetic or logic operation is zero.
• 0 - The result of an arithmetic or logic operation is different from zero.Z - Zero bit
• 1 - A carry-out from the 4th low-order bit of the result has occurred.
• 0 - No carry-out from the 4th low-order bit of the result has occurred.
DC - Digit carry/borrow bit is changed during addition
and subtraction if an “overflow” or a “borrow” of the
result occurs.
• 1 - A carry-out from the most significant bit of the result has occurred.
• 0 - No carry-out from the most significant bit of the result has occurred.
C - Carry/Borrow bit is changed during addition and
subtraction if an “overflow” or a “borrow” of the result
occurs, i.e. if the result is greater than 255 or less than 0.
27-Dec-16 8
Register File Structure in PIC 16F8xx
 Microchip has provided only direct addressing mode
for the register file with 7-bits address plus
remaining 8th and 9th bits frozen in the STATUS
REGISTER bits RP1:RP0.
11 = Bank 3 (180h-1FFh)
10 = Bank 2 (100h-17Fh)
01 = Bank 1 (80h-FFh)
00 = Bank 0 (00h-7Fh)
As shown in figure
27-Dec-16 9
Register File Structure in PIC 16F8xx
Use of IPR bit in indirect addressing mode
27-Dec-16 10
Register File Structure in PIC 16F8xx
Indirect addressing mode
 IRP bit is used for indirect addressing.
 The IRP bit allows selecting either
1= Bank 2 & bank 3
0= Bank 0 & bank 1
 The IPR bit and FSR decide the effective 9 bit address.
As shown in figure
27-Dec-16 11
Register File Structure in PIC 16F8xx
Use of IPR bit in indirect addressing mode
27-Dec-16 12
Register File Structure in PIC 16F8xx
Special Function Register
 PCL and PCLATH Registers: The size of the program memory of the
PIC16F887 is 8K. Therefore, it has 8192 locations for program
storing. For this reason the program counter must be 13-bits wide
(2^13 = 8192). In order that the contents of some location may be
changed in software during operation, its address must be
accessible through some SFR. Since all SFRs are 8-bits wide, this
register is “artificially” created by dividing its 13 bits into two
independent registers: PCLATH and PCL.
27-Dec-16 13
Register File Structure in PIC 16F8xx
 Eight lower bits (the low byte) come from the PCL register which is
readable and writable, whereas five upper bits coming from the
PCLATH register are writable only.
 The PCLATH register is cleared on any reset.
27-Dec-16 14
Register File Structure in PIC 16F8xx
PCL
 Program Counter byte.
 PCL is the lower byte of the PC.
 Cause PCLATH contents to be transferred to the PC higher bit
locations.
 PC of PIC is associated with an 8-level stack.
 PC always points to the next instruction to be executed.
 In case of call to subroutines, the returned address is pushed onto
the stack.
 After the return from called subroutine, this return address is
retrieved.
 Stack width and PC width should be same.
27-Dec-16 15
Register File Structure in PIC 16F8xx
Power control register
 Contains the flags which can differentiate between the type of reset
occurred namely
o Power on reset
o Brown out reset
27-Dec-16 16
Register File Structure in PIC 16F8xx
Stack
 The entire PIC chip has an area for storing the return addresses.
 This area or unit called Stack is used in some Peripheral interface
controllers.
27-Dec-16 17
Register File Structure in PIC 16F8xx
PIC16F87XA Data Memory Organization
 Data memory is divided in two four banks, Each bank holds 128
bytes of addressable memory.
 Contain GPR and SPR.
 The banked arrangement is necessary because there are only 7 bits
are available in the instruction word for the addressing of a register,
which gives only 128 addresses.
 The selection of the banks are determined by control bits RP1, RP0
in the STATUS registers
 Together the RP1, RP0 and the specified 7 bits effectively form a 9
bit address.
27-Dec-16 18
Register File Structure in PIC 16F8xx
27-Dec-16 19
Register File Structure in PIC 16F8xx
Thanks

More Related Content

PDF
Microcontroller pic 16 f877 registers memory ports
PPTX
Architecture of 16C6X
PPT
The Intel 8086 microprocessor
PPTX
x86 architecture
 
PPT
Interrupts for PIC18
PPTX
Addressing sequencing
PPS
Block diagram-of-8085
Microcontroller pic 16 f877 registers memory ports
Architecture of 16C6X
The Intel 8086 microprocessor
x86 architecture
 
Interrupts for PIC18
Addressing sequencing
Block diagram-of-8085

What's hot (20)

PPTX
Pic16cxx instruction set
PDF
Microcontroller pic 16f877 addressing modes instructions and programming
PPT
Memory organization of 8051
PDF
8051 assembly programming
PPTX
Relay interfacing with 8051
PPT
Decimation in time and frequency
PPT
PIC 16F877A by PARTHIBAN. S.
PPTX
Serial Communication in 8051
PPT
Adc interfacing
PPTX
PIC-18 Microcontroller
PDF
Question paper with solution the 8051 microcontroller based embedded systems...
PPTX
Stacks & subroutines 1
PPTX
Architecture of 8051
PPTX
I/O port programming in 8051
DOC
PIC MICROCONTROLLERS -CLASS NOTES
PPTX
Interrupts of microprocessor 8085
PPTX
8051 memory
PPTX
Pic microcontroller architecture
PPTX
Pic 18 microcontroller
Pic16cxx instruction set
Microcontroller pic 16f877 addressing modes instructions and programming
Memory organization of 8051
8051 assembly programming
Relay interfacing with 8051
Decimation in time and frequency
PIC 16F877A by PARTHIBAN. S.
Serial Communication in 8051
Adc interfacing
PIC-18 Microcontroller
Question paper with solution the 8051 microcontroller based embedded systems...
Stacks & subroutines 1
Architecture of 8051
I/O port programming in 8051
PIC MICROCONTROLLERS -CLASS NOTES
Interrupts of microprocessor 8085
8051 memory
Pic microcontroller architecture
Pic 18 microcontroller
Ad

Viewers also liked (20)

PPTX
Smart lamp with gsm modul sim800 l
PDF
PDF
Analog I/O in PIC16F877A
PDF
Introduction to 80386 microprocessor
PDF
CS215 - Lec 2 file organization
PPT
Ie Storage, Multimedia And File Organization
PDF
2 introduction to arm architecture
PPTX
Disk structure & File Handling
PDF
Gps file structure explained
PDF
CS215 - Lec 9 indexing and reclaiming space in files
PDF
DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER
PPTX
File Structure Concepts
PDF
Discussion : File structure of Meteor Apps
PPTX
04.01 file organization
DOC
Embedded systems notes
PPTX
Intel® 80386 microprocessor registers
PDF
File organization and processing
PPT
Ch 1-final-file organization from korth
PPTX
Concept of computer files for Grade 12 learners
PPT
File organization techniques
Smart lamp with gsm modul sim800 l
Analog I/O in PIC16F877A
Introduction to 80386 microprocessor
CS215 - Lec 2 file organization
Ie Storage, Multimedia And File Organization
2 introduction to arm architecture
Disk structure & File Handling
Gps file structure explained
CS215 - Lec 9 indexing and reclaiming space in files
DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER
File Structure Concepts
Discussion : File structure of Meteor Apps
04.01 file organization
Embedded systems notes
Intel® 80386 microprocessor registers
File organization and processing
Ch 1-final-file organization from korth
Concept of computer files for Grade 12 learners
File organization techniques
Ad

Similar to register file structure of PIC controller (20)

PDF
Introduction to pic microcontroller
PPTX
Class 6 an 8 bit embedded platform -pic mircocontroller basics
PPT
Chp4 introduction to the pic microcontroller copy
PPT
PIC Introduction and explained in detailed
PDF
PIC1jjkkkkkkkjhgfvjitr c its GJ tagging hugg
PPTX
07_ PIC16F778 Overview (families and standards ) .pptx
PPTX
PIC Presentation_final updated.pptx
PDF
UNIT-V (PIC16F877-Microcontrollers).pdf
PPTX
Seminar topic.on embeded system
PPT
My seminar new 28
PPTX
PIC 16F877 micro controller by Gaurav raikar
PPTX
PIC introduction + mapping
PPTX
PIC16F877 NTTF (1).presentation architecture ,i/o ports,memory
PPT
Microchip's PIC Micro Controller
PPT
UNIT 3 mp (1).ppt
PPTX
MICROCONTROLLER 8051- Architecture and registers
PPTX
MICROCONTROLLER.pptx
Introduction to pic microcontroller
Class 6 an 8 bit embedded platform -pic mircocontroller basics
Chp4 introduction to the pic microcontroller copy
PIC Introduction and explained in detailed
PIC1jjkkkkkkkjhgfvjitr c its GJ tagging hugg
07_ PIC16F778 Overview (families and standards ) .pptx
PIC Presentation_final updated.pptx
UNIT-V (PIC16F877-Microcontrollers).pdf
Seminar topic.on embeded system
My seminar new 28
PIC 16F877 micro controller by Gaurav raikar
PIC introduction + mapping
PIC16F877 NTTF (1).presentation architecture ,i/o ports,memory
Microchip's PIC Micro Controller
UNIT 3 mp (1).ppt
MICROCONTROLLER 8051- Architecture and registers
MICROCONTROLLER.pptx

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Construction Project Organization Group 2.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
PPT on Performance Review to get promotions
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Geodesy 1.pptx...............................................
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
UNIT 4 Total Quality Management .pptx
Construction Project Organization Group 2.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Lecture Notes Electrical Wiring System Components
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPT on Performance Review to get promotions
R24 SURVEYING LAB MANUAL for civil enggi
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Geodesy 1.pptx...............................................

register file structure of PIC controller

  • 1. Register File Structure in PIC 16F877a or16F8XX Presented By Nirbhay Kumar Singh nirbhaykumar2008@gmail.com Roll No. 151607 ME – ECE – 2015 Batch NITTTR Chandigarh 27-Dec-16 1
  • 2. 27-Dec-16 2 Register File Structure in PIC 16F8xx The Registers A register is a place inside the PIC that can be written to, read from or both. Think of a register as a piece of paper where you can look at and write information on.
  • 3. Register File Structure • Register file → locations that an instruction can access via an address. • Register file consists of two component:- 1. General purpose register file (same as RAM) 2. Special purpose register file 27-Dec-16 Nirbhay Kr Singh, Roll No. 151607, ME-MOD-ECE-2015 3
  • 4. RAM (96 bytes) Special purpose Register (32 bytes) 27-Dec-16 Nirbhay Kr Singh, Roll No. 151607, ME-MOD-ECE-2015 4 Extra 64 bytes of RAM in PIC 16 C63 16 C65A 16 C73A 16 C74A RAM (32 bytes) Special purpose Register (32 bytes) Bank 0 128 bytes Bank 1 128 bytes 7F 20 1F 00 FF C0 BF A0 9F 80
  • 5. 27-Dec-16 5 Register File Structure in PIC 16F8xx Registers in PIC 16F8XX W or working register (8 bit) Status Register (8 bits) SFR (Special Function Registers) GPR (General Purpose Registers)
  • 6. 27-Dec-16 6 Register File Structure in PIC 16F8xx • 8 bits wide • Contains one of the source operands during the execution of instructions. • Serve as the destination for the result of the operation. • Only used for ALU operations.. W or Working Register
  • 7. 27-Dec-16 7 Register File Structure in PIC 16F8xx Status Register (8 bits) • 1 - Banks 0 and 1 are active (memory location 00h-FFh) • 0 - Banks 2 and 3 are active (memory location 100h-1FFh) IRP - Bit selects register bank. It is used for indirect addressing. • Bits select register bank. They are used for direct addressing.RP1,RP0 • 1 - After power-on or after executing CLRWDT instruction which resets watch-dog timer or SLEEP instruction which sets the microcontroller into low-consumption mode. • 0 - After watch-dog timer time-out has occurred. TO - Time-out bit. • 1 - After power-on or after executing CLRWDT instruction which resets watch-dog timer. • 0 - After executing SLEEP instruction which sets the microcontroller into low-consumption mode. PD - Power-down bit. • 1 - The result of an arithmetic or logic operation is zero. • 0 - The result of an arithmetic or logic operation is different from zero.Z - Zero bit • 1 - A carry-out from the 4th low-order bit of the result has occurred. • 0 - No carry-out from the 4th low-order bit of the result has occurred. DC - Digit carry/borrow bit is changed during addition and subtraction if an “overflow” or a “borrow” of the result occurs. • 1 - A carry-out from the most significant bit of the result has occurred. • 0 - No carry-out from the most significant bit of the result has occurred. C - Carry/Borrow bit is changed during addition and subtraction if an “overflow” or a “borrow” of the result occurs, i.e. if the result is greater than 255 or less than 0.
  • 8. 27-Dec-16 8 Register File Structure in PIC 16F8xx  Microchip has provided only direct addressing mode for the register file with 7-bits address plus remaining 8th and 9th bits frozen in the STATUS REGISTER bits RP1:RP0. 11 = Bank 3 (180h-1FFh) 10 = Bank 2 (100h-17Fh) 01 = Bank 1 (80h-FFh) 00 = Bank 0 (00h-7Fh) As shown in figure
  • 9. 27-Dec-16 9 Register File Structure in PIC 16F8xx Use of IPR bit in indirect addressing mode
  • 10. 27-Dec-16 10 Register File Structure in PIC 16F8xx Indirect addressing mode  IRP bit is used for indirect addressing.  The IRP bit allows selecting either 1= Bank 2 & bank 3 0= Bank 0 & bank 1  The IPR bit and FSR decide the effective 9 bit address. As shown in figure
  • 11. 27-Dec-16 11 Register File Structure in PIC 16F8xx Use of IPR bit in indirect addressing mode
  • 12. 27-Dec-16 12 Register File Structure in PIC 16F8xx Special Function Register  PCL and PCLATH Registers: The size of the program memory of the PIC16F887 is 8K. Therefore, it has 8192 locations for program storing. For this reason the program counter must be 13-bits wide (2^13 = 8192). In order that the contents of some location may be changed in software during operation, its address must be accessible through some SFR. Since all SFRs are 8-bits wide, this register is “artificially” created by dividing its 13 bits into two independent registers: PCLATH and PCL.
  • 13. 27-Dec-16 13 Register File Structure in PIC 16F8xx  Eight lower bits (the low byte) come from the PCL register which is readable and writable, whereas five upper bits coming from the PCLATH register are writable only.  The PCLATH register is cleared on any reset.
  • 14. 27-Dec-16 14 Register File Structure in PIC 16F8xx PCL  Program Counter byte.  PCL is the lower byte of the PC.  Cause PCLATH contents to be transferred to the PC higher bit locations.  PC of PIC is associated with an 8-level stack.  PC always points to the next instruction to be executed.  In case of call to subroutines, the returned address is pushed onto the stack.  After the return from called subroutine, this return address is retrieved.  Stack width and PC width should be same.
  • 15. 27-Dec-16 15 Register File Structure in PIC 16F8xx Power control register  Contains the flags which can differentiate between the type of reset occurred namely o Power on reset o Brown out reset
  • 16. 27-Dec-16 16 Register File Structure in PIC 16F8xx Stack  The entire PIC chip has an area for storing the return addresses.  This area or unit called Stack is used in some Peripheral interface controllers.
  • 17. 27-Dec-16 17 Register File Structure in PIC 16F8xx PIC16F87XA Data Memory Organization  Data memory is divided in two four banks, Each bank holds 128 bytes of addressable memory.  Contain GPR and SPR.  The banked arrangement is necessary because there are only 7 bits are available in the instruction word for the addressing of a register, which gives only 128 addresses.  The selection of the banks are determined by control bits RP1, RP0 in the STATUS registers  Together the RP1, RP0 and the specified 7 bits effectively form a 9 bit address.
  • 18. 27-Dec-16 18 Register File Structure in PIC 16F8xx
  • 19. 27-Dec-16 19 Register File Structure in PIC 16F8xx Thanks