SlideShare a Scribd company logo
1 of 7
Download to read offline
MICROPROCESSORS
&
MICROCONTROLLERS
Khalil Zeineddine
2021
KAFAZ
Microprocessors & Microcontrollers KAFAZ- 1
Version 2021 Khalil Zeineddine
P
I
C
1
6
F
8
7
7
A
Chapter _1:
To know:
1. Introduction to PIC16F877a
2. Pin out of PIC
3. Internal architecture of PIC
4. Basic elements of PIC
Contents_1:
PIC Introduction
Peripheral Interface Controllers (PIC) is one of the advanced
microcontrollers developed by microchip technologies. These microcontrollers
are widely used in modern electronics applications. A PIC controller
integrates all type of advanced interfacing ports and memory modules.
These controllers are more advanced than normal microcontroller like
8051. The first PIC chip was announced in 1975 (PIC1650). As like normal
microcontroller, the PIC chip also combines a microprocessor unit called
CPU and is integrated with various types of memory modules (RAM, ROM,
EEPROM ,etc), I/O ports, timers/counters, communication ports, etc.
All PIC microcontroller family uses Harvard architecture. This architecture
has the program and data accessed from separate memories so the device has
a program memory bus and a data memory bus (more than 8 lines in a normal
bus).
This improves the bandwidth (data throughput) over traditional von
Neumann architecture where program and data are fetched from the same
memory (accesses over the same bus). Separating program and data memory
Microprocessors & Microcontrollers KAFAZ- 2
Version 2021 Khalil Zeineddine
P
I
C
1
6
F
8
7
7
A
further allows instructions to be sized differently than the 8-bit wide data
word. Now we will move to PIC16F877A.
Introduction au PIC16F877a
The essential elements of the PIC 16F877 are:
• A flash EEPROM type program memory of 8K 14-bit words,
• A data RAM of 368 bytes,
• A 256-byte EEPROM memory,
• 05 input output ports, A (6 bits), B (8 bits), C (8 bits), D (8 bits) and E (3
bits)
• 10-bit Analog to Digital converter with 8 selectable inputs,
• USART, Universal serial port, asynchronous mode and synchronous
mode
• SSP, Synchronous serial port
• Three TIMERS with their Prescaler, TMR0, TMR1, TMR2
• Two comparison modules and Capture CCP1 and CCP2
• 15 interrupt sources,
• Clock generator, quartz (up to 20 MHz)
• Code protection,
• Operating voltage from 2 to 5V,
• Sets of 35 instructions.
Microprocessors & Microcontrollers KAFAZ- 3
Version 2021 Khalil Zeineddine
P
I
C
1
6
F
8
7
7
A
Pin out :
The PIC 16F877A box described in the figure below includes 40 pins:
1. 33 input / output pins (5 following ports):
• Port A: 6 I / O pins numbered from RA0 to RA5
• Port B: 8 I / O pins numbered from RB0 to RB7
• Port C: 8 I / O pins numbered from RC0 to RC7
• Port D: 8 I / O pins numbered from RD0 to RD7
• Port E: 3 I / O pins numbered from RE0 to RE2
Max output current: 20mA / pin; 200mA / port
Microprocessors & Microcontrollers KAFAZ- 4
Version 2021 Khalil Zeineddine
P
I
C
1
6
F
8
7
7
A
2. The VDD and VSS pins are used to power the PIC. Note that we have 2
"VDD" connections and 2 "VSS" connections.
3. The pins OSC1 and OSC2 or CLKIN and CLOUT are used to operate the
internal oscillator of the PIC.
4. The MCLR pin is used to initialize the MC in the event of power-up,
external reset, watchdog and in the event of supply voltage drop.
Internal Architecture
1. The CPU executes the program instructions (encoded in 14 bits),
processes and generates operations on digital information.
2. The 368 byte Random Access Memory (RAM) is used for temporary
storage of data and results.
3. The 256-byte read-only memory (EEPROM) keeps valuable data
semi-permanently.
4. The 8k x 14bits FLASH memory is used to store the program
(instructions).
5. The clock generates the signal that rates the execution of instructions.
6. Bidirectional ports (A - E) allow communication with the outside; the
lines of each port can be programmed as input or output.
7. The timers (3), programmable modules whose functions are:
• Astable (periodic signals)
• Monostable (impulse)
• Counter
• PWM signals (direct current motor control).
8. The 10-bit analog / digital converter ADC - 8 inputs available from 0
to 5V; the results of the conversions are stored in internal registers.
Microprocessors & Microcontrollers KAFAZ- 5
Version 2021 Khalil Zeineddine
P
I
C
1
6
F
8
7
7
A
The basic elements of the PIC 16F877A
1. The clock
The clock can be either internal or external. The internal clock consists of a
crystal oscillator or an RC oscillator. With the Quartz oscillator, we can
have frequencies up to 20 MHz depending on the type of μC.
2. The ALU and the W accumulator
The ALU is an 8-Bit Arithmetic and Logic Unit which performs basic
arithmetic and logic operations.
Accumulator W is an 8-bit working register, all two-operand operations go
through it.
Can we have :
 An instruction on a single operand which is usually a register
located in RAM.
 An instruction on 2 operands. In this case, one of the two
operands is always the accumulator W, the other can be either a
register or a constant.
3. RAM memory
The addressable RAM memory space is 512 positions of 1 byte each:
Microprocessors & Microcontrollers KAFAZ- 6
Version 2021 Khalil Zeineddine
P
I
C
1
6
F
8
7
7
A
 96 positions are reserved for the SFR (Special Function Registers)
which are the PIC configuration registers.
 The remaining 416 positions constitute the GPR registers (General
Propose Registers) or user RAM. On the 16F877, 3 blocks of 16
bytes each are not physically implanted resulting in a user RAM
capacity of 368 GPR.
4. Permanent memories
The PIC 16F877 has 2 permanent memories.
 PROGRAM EEPROM memory with a capacity of 8k 14-bit words.
 The DATA EEPROM memory with a capacity of 256 bytes.

More Related Content

What's hot (20)

174085193 pic-prgm-manual
174085193 pic-prgm-manual174085193 pic-prgm-manual
174085193 pic-prgm-manual
 
Architecture of 16C6X
Architecture of 16C6XArchitecture of 16C6X
Architecture of 16C6X
 
PIC16F877A interfacing with LCD
PIC16F877A interfacing with LCDPIC16F877A interfacing with LCD
PIC16F877A interfacing with LCD
 
Presentation
PresentationPresentation
Presentation
 
PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mapping
 
Pic full note
Pic full notePic full note
Pic full note
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Programming pic microcontrollers
Programming pic microcontrollersProgramming pic microcontrollers
Programming pic microcontrollers
 
Pic16cxx instruction set
Pic16cxx instruction setPic16cxx instruction set
Pic16cxx instruction set
 
Pic16f84
Pic16f84Pic16f84
Pic16f84
 
PIC Microcontrollers
PIC MicrocontrollersPIC Microcontrollers
PIC Microcontrollers
 
Atmel and pic microcontroller
Atmel and pic microcontrollerAtmel and pic microcontroller
Atmel and pic microcontroller
 
Pic 18 microcontroller
Pic 18 microcontrollerPic 18 microcontroller
Pic 18 microcontroller
 
PIC Microcontroller
PIC MicrocontrollerPIC Microcontroller
PIC Microcontroller
 
PIC CONTROLLERS
PIC CONTROLLERSPIC CONTROLLERS
PIC CONTROLLERS
 
Pic microcontroller [autosaved] [autosaved]
Pic microcontroller [autosaved] [autosaved]Pic microcontroller [autosaved] [autosaved]
Pic microcontroller [autosaved] [autosaved]
 
Test
TestTest
Test
 
PIC Introduction and explained in detailed
PIC Introduction and explained in detailedPIC Introduction and explained in detailed
PIC Introduction and explained in detailed
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
 
register file structure of PIC controller
register file structure of PIC controllerregister file structure of PIC controller
register file structure of PIC controller
 

Similar to MICROPROCESSORS & MICROCONTROLLERS

Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Vishalya Dulam
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copymkazree
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentseceprinter6
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.pptAakashRawat35
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESDr.YNM
 
8051 architecture and pin configuration
8051 architecture and pin configuration8051 architecture and pin configuration
8051 architecture and pin configurationNITHIN KALLE PALLY
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERsravannunna24
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetMicrotech Solutions
 
Study of 8051 microcontroller
Study of 8051 microcontrollerStudy of 8051 microcontroller
Study of 8051 microcontroller918007165995
 
Seminar topic.on embeded system
Seminar topic.on embeded systemSeminar topic.on embeded system
Seminar topic.on embeded systemSachinMaithani1
 

Similar to MICROPROCESSORS & MICROCONTROLLERS (20)

Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
89s52 2
89s52 289s52 2
89s52 2
 
Pic microcontrollers
Pic microcontrollersPic microcontrollers
Pic microcontrollers
 
Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)Pc based wire less data aquisition system using rf(1)
Pc based wire less data aquisition system using rf(1)
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.ppt
 
Ee6008 mcbsd notes
Ee6008 mcbsd notesEe6008 mcbsd notes
Ee6008 mcbsd notes
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTES
 
Introduction to PIC.pptx
Introduction to PIC.pptxIntroduction to PIC.pptx
Introduction to PIC.pptx
 
2 unit-es-printed
2 unit-es-printed2 unit-es-printed
2 unit-es-printed
 
EE6008 MBSD
EE6008  MBSDEE6008  MBSD
EE6008 MBSD
 
8051 architecture and pin configuration
8051 architecture and pin configuration8051 architecture and pin configuration
8051 architecture and pin configuration
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
3.TechieNest microcontrollers
3.TechieNest  microcontrollers3.TechieNest  microcontrollers
3.TechieNest microcontrollers
 
Ii avr-basics(1)
Ii avr-basics(1)Ii avr-basics(1)
Ii avr-basics(1)
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data Sheet
 
Study of 8051 microcontroller
Study of 8051 microcontrollerStudy of 8051 microcontroller
Study of 8051 microcontroller
 
Seminar topic.on embeded system
Seminar topic.on embeded systemSeminar topic.on embeded system
Seminar topic.on embeded system
 

Recently uploaded

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 

MICROPROCESSORS & MICROCONTROLLERS

  • 2. Microprocessors & Microcontrollers KAFAZ- 1 Version 2021 Khalil Zeineddine P I C 1 6 F 8 7 7 A Chapter _1: To know: 1. Introduction to PIC16F877a 2. Pin out of PIC 3. Internal architecture of PIC 4. Basic elements of PIC Contents_1: PIC Introduction Peripheral Interface Controllers (PIC) is one of the advanced microcontrollers developed by microchip technologies. These microcontrollers are widely used in modern electronics applications. A PIC controller integrates all type of advanced interfacing ports and memory modules. These controllers are more advanced than normal microcontroller like 8051. The first PIC chip was announced in 1975 (PIC1650). As like normal microcontroller, the PIC chip also combines a microprocessor unit called CPU and is integrated with various types of memory modules (RAM, ROM, EEPROM ,etc), I/O ports, timers/counters, communication ports, etc. All PIC microcontroller family uses Harvard architecture. This architecture has the program and data accessed from separate memories so the device has a program memory bus and a data memory bus (more than 8 lines in a normal bus). This improves the bandwidth (data throughput) over traditional von Neumann architecture where program and data are fetched from the same memory (accesses over the same bus). Separating program and data memory
  • 3. Microprocessors & Microcontrollers KAFAZ- 2 Version 2021 Khalil Zeineddine P I C 1 6 F 8 7 7 A further allows instructions to be sized differently than the 8-bit wide data word. Now we will move to PIC16F877A. Introduction au PIC16F877a The essential elements of the PIC 16F877 are: • A flash EEPROM type program memory of 8K 14-bit words, • A data RAM of 368 bytes, • A 256-byte EEPROM memory, • 05 input output ports, A (6 bits), B (8 bits), C (8 bits), D (8 bits) and E (3 bits) • 10-bit Analog to Digital converter with 8 selectable inputs, • USART, Universal serial port, asynchronous mode and synchronous mode • SSP, Synchronous serial port • Three TIMERS with their Prescaler, TMR0, TMR1, TMR2 • Two comparison modules and Capture CCP1 and CCP2 • 15 interrupt sources, • Clock generator, quartz (up to 20 MHz) • Code protection, • Operating voltage from 2 to 5V, • Sets of 35 instructions.
  • 4. Microprocessors & Microcontrollers KAFAZ- 3 Version 2021 Khalil Zeineddine P I C 1 6 F 8 7 7 A Pin out : The PIC 16F877A box described in the figure below includes 40 pins: 1. 33 input / output pins (5 following ports): • Port A: 6 I / O pins numbered from RA0 to RA5 • Port B: 8 I / O pins numbered from RB0 to RB7 • Port C: 8 I / O pins numbered from RC0 to RC7 • Port D: 8 I / O pins numbered from RD0 to RD7 • Port E: 3 I / O pins numbered from RE0 to RE2 Max output current: 20mA / pin; 200mA / port
  • 5. Microprocessors & Microcontrollers KAFAZ- 4 Version 2021 Khalil Zeineddine P I C 1 6 F 8 7 7 A 2. The VDD and VSS pins are used to power the PIC. Note that we have 2 "VDD" connections and 2 "VSS" connections. 3. The pins OSC1 and OSC2 or CLKIN and CLOUT are used to operate the internal oscillator of the PIC. 4. The MCLR pin is used to initialize the MC in the event of power-up, external reset, watchdog and in the event of supply voltage drop. Internal Architecture 1. The CPU executes the program instructions (encoded in 14 bits), processes and generates operations on digital information. 2. The 368 byte Random Access Memory (RAM) is used for temporary storage of data and results. 3. The 256-byte read-only memory (EEPROM) keeps valuable data semi-permanently. 4. The 8k x 14bits FLASH memory is used to store the program (instructions). 5. The clock generates the signal that rates the execution of instructions. 6. Bidirectional ports (A - E) allow communication with the outside; the lines of each port can be programmed as input or output. 7. The timers (3), programmable modules whose functions are: • Astable (periodic signals) • Monostable (impulse) • Counter • PWM signals (direct current motor control). 8. The 10-bit analog / digital converter ADC - 8 inputs available from 0 to 5V; the results of the conversions are stored in internal registers.
  • 6. Microprocessors & Microcontrollers KAFAZ- 5 Version 2021 Khalil Zeineddine P I C 1 6 F 8 7 7 A The basic elements of the PIC 16F877A 1. The clock The clock can be either internal or external. The internal clock consists of a crystal oscillator or an RC oscillator. With the Quartz oscillator, we can have frequencies up to 20 MHz depending on the type of μC. 2. The ALU and the W accumulator The ALU is an 8-Bit Arithmetic and Logic Unit which performs basic arithmetic and logic operations. Accumulator W is an 8-bit working register, all two-operand operations go through it. Can we have :  An instruction on a single operand which is usually a register located in RAM.  An instruction on 2 operands. In this case, one of the two operands is always the accumulator W, the other can be either a register or a constant. 3. RAM memory The addressable RAM memory space is 512 positions of 1 byte each:
  • 7. Microprocessors & Microcontrollers KAFAZ- 6 Version 2021 Khalil Zeineddine P I C 1 6 F 8 7 7 A  96 positions are reserved for the SFR (Special Function Registers) which are the PIC configuration registers.  The remaining 416 positions constitute the GPR registers (General Propose Registers) or user RAM. On the 16F877, 3 blocks of 16 bytes each are not physically implanted resulting in a user RAM capacity of 368 GPR. 4. Permanent memories The PIC 16F877 has 2 permanent memories.  PROGRAM EEPROM memory with a capacity of 8k 14-bit words.  The DATA EEPROM memory with a capacity of 256 bytes.