SlideShare a Scribd company logo
LEARNING OUTCOMES
Part 1:
⚫Understand the PIC18 Architecture
Part 1 : PIC18 Microcontroller Architecture
At the end of this session you should be able to
explain:
⚫ PIC18 Microcontroller families
⚫ PIC18 architecture
⚫ Data RAM file Register
INTRODUCTION
⚫PICis afamilyof modified Harvard
architecture microcontrollersmade byMicrochip
T
echnology
, derived from the PIC1650originally
developed byGeneral Instrument's
Microelectronics Division.
⚫ The name PIC initially referred to "Peripheral
Interface Controller”
⚫PICs are popular with both industrial
developers and hobbyists alike due to their:
1. low cost,
2. wide availability,
3. large user base,
4. extensive collection of application notes,
5. availability of low cost or free development
tools,
6. serial programming (and re-programming
with flash memory) capability.
PIC Families
PIC18 PIC® Microcontrollers
⚫The PIC18 family use an 8-bit architecture.
⚫ With up to 16 MIPSofprocessingpower,PIC18
Microcontrollers feature advancedperipherals,such asCAN,
USB,Ethernet, LCD and CTMU.
29 March, 2013
9 mfauzi
Basic Upgrade
USB CAN
PIC18 Architecture
⚫PIC microcontrollers are based on advanced RISC
architecture.
⚫RISCstandsfor Reduced Instruction SetComputing. In
this architecture, the instruction set of hardware gets
reduced which increases the execution rate (speed) of
system.
⚫
⚫PIC microcontrollersfollow Harvard architecture for
internal data transfer
RISC vs CISC
⚫Reduced instruction set computing, or RISCis
a CPU design strategy based on the insight that
simplified instructions can provide higher
performance if this simplicity enables much faster
execution of each instruction.
⚫A complex instruction set computer (CISC), is
a computer where single instructions can execute
several low-level operations
PIC18 Architecture (cont’d)
⚫PIC microcontrollersare designed using
the HarvardArchitecture which includes:
⚫Microprocessor unit (MPU)
⚫Program memoryfor instructions
⚫Data memoryfor data
⚫I/O ports
⚫Support devices such astimers
Harvard Architecture vs Von Neumann
Architecture
• Von Neumann
Architecture:
– Used single memory space
for program and data.
– Limits operating bandwidth
• Harvard Architecture:
– Uses two separate memory
spaces for program
instructions and data
– Improved operating
bandwidth
– Allows for different bus
Von Neumann
Architecture
8-bit Bus
CPU
Program
& Data
Memory
CPU
Harvard
Architecture
Data
Memory
Program
Memory
8-bit Bus
16-bit Bus
PIC18 Architecture
PIC18Architecture Block Diagram
PIC18 Features:
⚫CPU core
⚫The function of the CPU is to execute
(process) information stored in memory
.
⚫Program ROM
⚫The ROM use to store program.
PIC18 Features (cont’d)
⦿Data Memory
The data memory is SRAMand EEPROM.
provides aplace to store data asapplication executes
and is lost when power is removed from the system.
⦿EEPROM
also anonvolatile memory which is used to store
data like values of certain variables. PIC18F4550 has
256 Bytesof EEPROM.
PIC18 Features (cont’d)
⚫I/O Ports:
⚫The I/O ports are used to interface the microprocessor
to the outside world.
PIC18F4550 pin diagram.
Other internal Devices
⚫Oscillator
⚫8x8 Multiplier
⚫ADC Interface
⚫Timers/Counter
s
⚫USB
PIC18 Registers
⚫CPUs use many registers to store data
temporarily.
⚫To program in assembly language, we must
understand the registers and architecture of
given CPU and the role they play in processing
data.
PIC18 Registers
⚫ PIC microcontroller contains an 8-bit ALU (Arithmetic
Logic Unit) and an 8-bit Working Register (WREG).
⚫ There are different GPRs (General Purpose
Registers) and SFRs (Special Function Registers) in
a PIC microcontroller.
⚫ The overall system performs 8-bit arithmetic and logic
functions.
PIC registers
WREG Register
⚫Stand forW
orkingregister
⚫8-bit register
⚫ Use for all arithmetic and logic instructions.
⚫used bymanyinstructions as:
⚫the source of an operand.
⚫the destination for the result of the
instruction execution.
PIC File Register
⚫The file register is read/write memory used by
CPU for data storage, scratch pad, and
register for internal use and functions.
⚫Divided into two sections:
a) Special Function Registers (SFR)
b) General Purpose Registers (GPR)
General Purpose Register (GPR)
⚫8-bit registers
⚫are a group of RAM locations in the file
register that are used for data storage and
scratch pad.
⚫the space that is not allocated to the SFRs
typically used for general-purpose registers.
Special Function Register (SFR)
⚫SFR are dedicated to specific functions such
as ALU status, timers, serial communication,
I/O ports, ADC and so on.
⚫The function of each SFR is fixed by the CPU
designer at the time of design.
⚫8-bit registers
Special
Function
Register
of PIC18
family
SFR(cont’d)
⦿Examples of SFRregister:
1. PORTx
2. LA
Tx
3. TRISx
4. TIMER0
5. ADCON0,ADCON1
6. ADRESH
7. INTCON
8. etc
Review Questions
1. What do RISC an CISC stand for?
2. True or false. Harvard architecture uses the
same address and data busses to fetch both
code and data.
3. Register WREG is -bit wide.
4. True or false. Data space is SRAM memory,
whereas program (code) space is of the ROM
type.
5. The general-purpose RAM and SFRs together
are called .
6. The SFR registers in PIC are -bit.
STATUS Register
⚫8-bit register
⚫referred to asthe flagregister.
⚫only5 bits of it are used bythe PIC18.
⚫ called conditional flags
⚫The three unused bits are unimplemented
and read as0.
STATUSRegister (cont’d)
Flags in Status Register
b7 b6 b5 b4 b3 b2 b1 b0
Negative Overflow Zero Digit Carry Carry
⚫ C (Carry/Borrow Flag) set when an addition generates a carry and a
subtraction generates a borrow.
⚫ DC(Digit Carry Flag):also called Half Carry flag;set when carry generated
from Bit3 to Bit4 an arithmetic operatio.n
⚫ Z(Zero Flag):set when result of an operation is zero.
⚫ OV(Overflow Flag):set when result of an operation of signed numbers goes
beyond seven bits-if the results fall outside 127(0x7F)and -128(0x80).
⚫ N(Negative Flag):set when bit B7 is one of the result of an arithmetic/logic
operation.
- - - N OV Z DC C
Example 1
⚫Show the status of the C, DC and Z flag after the
addition of 38H and 2FH.
⚫Solution:
38H 00111000
+ 2FH + 00101111
67H 01100111
C = 0
DC = 1
Z = 0
Review Questions
1. The flag register in PIC is called the .
2. What is the size of the flag register in PIC?
3. Which bits of the status register are unused?
4. Which bits of the status register are used for the
C and DC flag bit respectively?
5. Show the status of the C, DC and Z flag after the
addition of 9CH and 64FH.

More Related Content

Similar to chapter2-part1-140329134839-phpapp02.pptx

Microcontroller pic 16 f877 registers memory ports
Microcontroller pic 16 f877 registers memory portsMicrocontroller pic 16 f877 registers memory ports
Microcontroller pic 16 f877 registers memory ports
Nilesh Bhaskarrao Bahadure
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
RamaPrabha24
 
microprocessor8085 power point presentation
microprocessor8085 power point presentationmicroprocessor8085 power point presentation
microprocessor8085 power point presentation
rohitkuarm5667
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontroller
SHILPA Sillobhargav
 
Lecture 5-Embedde.pdf
Lecture 5-Embedde.pdfLecture 5-Embedde.pdf
Lecture 5-Embedde.pdf
BlackHunter13
 
Introduction to 8085 by Adi PPT.pdf
Introduction to 8085 by Adi PPT.pdfIntroduction to 8085 by Adi PPT.pdf
Introduction to 8085 by Adi PPT.pdf
Prof. Dr. K. Adisesha
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
Siva Kumar
 
PIC18F458_Ritula Thakur.pptx.pdf
PIC18F458_Ritula Thakur.pptx.pdfPIC18F458_Ritula Thakur.pptx.pdf
PIC18F458_Ritula Thakur.pptx.pdf
AvinashJain66
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
Vishnu C Sathi
 
pic 18
pic 18pic 18
Smart logic
Smart logicSmart logic
Picmico
PicmicoPicmico
Picmico
loges91
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
sagar Ramdev
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.ppt
AakashRawat35
 
TMS320C5x
TMS320C5xTMS320C5x
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
KanchanThory
 
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationA 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
Talal Khaliq
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
Abhishek Sood
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
aviban
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTES
Dr.YNM
 

Similar to chapter2-part1-140329134839-phpapp02.pptx (20)

Microcontroller pic 16 f877 registers memory ports
Microcontroller pic 16 f877 registers memory portsMicrocontroller pic 16 f877 registers memory ports
Microcontroller pic 16 f877 registers memory ports
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
 
microprocessor8085 power point presentation
microprocessor8085 power point presentationmicroprocessor8085 power point presentation
microprocessor8085 power point presentation
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontroller
 
Lecture 5-Embedde.pdf
Lecture 5-Embedde.pdfLecture 5-Embedde.pdf
Lecture 5-Embedde.pdf
 
Introduction to 8085 by Adi PPT.pdf
Introduction to 8085 by Adi PPT.pdfIntroduction to 8085 by Adi PPT.pdf
Introduction to 8085 by Adi PPT.pdf
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
PIC18F458_Ritula Thakur.pptx.pdf
PIC18F458_Ritula Thakur.pptx.pdfPIC18F458_Ritula Thakur.pptx.pdf
PIC18F458_Ritula Thakur.pptx.pdf
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
pic 18
pic 18pic 18
pic 18
 
Smart logic
Smart logicSmart logic
Smart logic
 
Picmico
PicmicoPicmico
Picmico
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.ppt
 
TMS320C5x
TMS320C5xTMS320C5x
TMS320C5x
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
 
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationA 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTES
 

More from SangeetaTripathi8

Gunn Diodes engineering electronics and communication
Gunn Diodes engineering electronics and communicationGunn Diodes engineering electronics and communication
Gunn Diodes engineering electronics and communication
SangeetaTripathi8
 
lecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptxlecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptx
SangeetaTripathi8
 
lecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptxlecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptx
SangeetaTripathi8
 
softcorecomputing-121025042248-phpapp02.pptx
softcorecomputing-121025042248-phpapp02.pptxsoftcorecomputing-121025042248-phpapp02.pptx
softcorecomputing-121025042248-phpapp02.pptx
SangeetaTripathi8
 
LECT 2.pptx
LECT 2.pptxLECT 2.pptx
LECT 2.pptx
SangeetaTripathi8
 
Dr. Sangeeta PPT fro STTP 18 Jan.pptx
Dr. Sangeeta PPT fro STTP 18 Jan.pptxDr. Sangeeta PPT fro STTP 18 Jan.pptx
Dr. Sangeeta PPT fro STTP 18 Jan.pptx
SangeetaTripathi8
 
Lect 1 Into.pptx
Lect 1 Into.pptxLect 1 Into.pptx
Lect 1 Into.pptx
SangeetaTripathi8
 
Ch5_MorrisMano.pptx
Ch5_MorrisMano.pptxCh5_MorrisMano.pptx
Ch5_MorrisMano.pptx
SangeetaTripathi8
 
DC-circuit-theory.ppt
DC-circuit-theory.pptDC-circuit-theory.ppt
DC-circuit-theory.ppt
SangeetaTripathi8
 
Chapter4.ppt
Chapter4.pptChapter4.ppt
Chapter4.ppt
SangeetaTripathi8
 
what_is_technology.ppt
what_is_technology.pptwhat_is_technology.ppt
what_is_technology.ppt
SangeetaTripathi8
 
Magzine.pptx
Magzine.pptxMagzine.pptx
Magzine.pptx
SangeetaTripathi8
 
Lecture1-Introduction-Jan18-2021.pptx
Lecture1-Introduction-Jan18-2021.pptxLecture1-Introduction-Jan18-2021.pptx
Lecture1-Introduction-Jan18-2021.pptx
SangeetaTripathi8
 
10-Hot-Data-Analytics-Tre-8904178.ppsx
10-Hot-Data-Analytics-Tre-8904178.ppsx10-Hot-Data-Analytics-Tre-8904178.ppsx
10-Hot-Data-Analytics-Tre-8904178.ppsx
SangeetaTripathi8
 
Presentation on Transformer.pptx
Presentation on Transformer.pptxPresentation on Transformer.pptx
Presentation on Transformer.pptx
SangeetaTripathi8
 
Resonance ppt.ppt
Resonance ppt.pptResonance ppt.ppt
Resonance ppt.ppt
SangeetaTripathi8
 
Chp 2 and 3.pptx
Chp 2 and 3.pptxChp 2 and 3.pptx
Chp 2 and 3.pptx
SangeetaTripathi8
 

More from SangeetaTripathi8 (17)

Gunn Diodes engineering electronics and communication
Gunn Diodes engineering electronics and communicationGunn Diodes engineering electronics and communication
Gunn Diodes engineering electronics and communication
 
lecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptxlecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptx
 
lecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptxlecture05picioportprogramming-190107152342.pptx
lecture05picioportprogramming-190107152342.pptx
 
softcorecomputing-121025042248-phpapp02.pptx
softcorecomputing-121025042248-phpapp02.pptxsoftcorecomputing-121025042248-phpapp02.pptx
softcorecomputing-121025042248-phpapp02.pptx
 
LECT 2.pptx
LECT 2.pptxLECT 2.pptx
LECT 2.pptx
 
Dr. Sangeeta PPT fro STTP 18 Jan.pptx
Dr. Sangeeta PPT fro STTP 18 Jan.pptxDr. Sangeeta PPT fro STTP 18 Jan.pptx
Dr. Sangeeta PPT fro STTP 18 Jan.pptx
 
Lect 1 Into.pptx
Lect 1 Into.pptxLect 1 Into.pptx
Lect 1 Into.pptx
 
Ch5_MorrisMano.pptx
Ch5_MorrisMano.pptxCh5_MorrisMano.pptx
Ch5_MorrisMano.pptx
 
DC-circuit-theory.ppt
DC-circuit-theory.pptDC-circuit-theory.ppt
DC-circuit-theory.ppt
 
Chapter4.ppt
Chapter4.pptChapter4.ppt
Chapter4.ppt
 
what_is_technology.ppt
what_is_technology.pptwhat_is_technology.ppt
what_is_technology.ppt
 
Magzine.pptx
Magzine.pptxMagzine.pptx
Magzine.pptx
 
Lecture1-Introduction-Jan18-2021.pptx
Lecture1-Introduction-Jan18-2021.pptxLecture1-Introduction-Jan18-2021.pptx
Lecture1-Introduction-Jan18-2021.pptx
 
10-Hot-Data-Analytics-Tre-8904178.ppsx
10-Hot-Data-Analytics-Tre-8904178.ppsx10-Hot-Data-Analytics-Tre-8904178.ppsx
10-Hot-Data-Analytics-Tre-8904178.ppsx
 
Presentation on Transformer.pptx
Presentation on Transformer.pptxPresentation on Transformer.pptx
Presentation on Transformer.pptx
 
Resonance ppt.ppt
Resonance ppt.pptResonance ppt.ppt
Resonance ppt.ppt
 
Chp 2 and 3.pptx
Chp 2 and 3.pptxChp 2 and 3.pptx
Chp 2 and 3.pptx
 

Recently uploaded

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 

Recently uploaded (20)

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 

chapter2-part1-140329134839-phpapp02.pptx

  • 1.
  • 3. Part 1 : PIC18 Microcontroller Architecture At the end of this session you should be able to explain: ⚫ PIC18 Microcontroller families ⚫ PIC18 architecture ⚫ Data RAM file Register
  • 4. INTRODUCTION ⚫PICis afamilyof modified Harvard architecture microcontrollersmade byMicrochip T echnology , derived from the PIC1650originally developed byGeneral Instrument's Microelectronics Division. ⚫ The name PIC initially referred to "Peripheral Interface Controller”
  • 5. ⚫PICs are popular with both industrial developers and hobbyists alike due to their: 1. low cost, 2. wide availability, 3. large user base, 4. extensive collection of application notes, 5. availability of low cost or free development tools, 6. serial programming (and re-programming with flash memory) capability.
  • 7. PIC18 PIC® Microcontrollers ⚫The PIC18 family use an 8-bit architecture. ⚫ With up to 16 MIPSofprocessingpower,PIC18 Microcontrollers feature advancedperipherals,such asCAN, USB,Ethernet, LCD and CTMU.
  • 8. 29 March, 2013 9 mfauzi Basic Upgrade USB CAN
  • 9. PIC18 Architecture ⚫PIC microcontrollers are based on advanced RISC architecture. ⚫RISCstandsfor Reduced Instruction SetComputing. In this architecture, the instruction set of hardware gets reduced which increases the execution rate (speed) of system. ⚫ ⚫PIC microcontrollersfollow Harvard architecture for internal data transfer
  • 10. RISC vs CISC ⚫Reduced instruction set computing, or RISCis a CPU design strategy based on the insight that simplified instructions can provide higher performance if this simplicity enables much faster execution of each instruction. ⚫A complex instruction set computer (CISC), is a computer where single instructions can execute several low-level operations
  • 11. PIC18 Architecture (cont’d) ⚫PIC microcontrollersare designed using the HarvardArchitecture which includes: ⚫Microprocessor unit (MPU) ⚫Program memoryfor instructions ⚫Data memoryfor data ⚫I/O ports ⚫Support devices such astimers
  • 12. Harvard Architecture vs Von Neumann Architecture • Von Neumann Architecture: – Used single memory space for program and data. – Limits operating bandwidth • Harvard Architecture: – Uses two separate memory spaces for program instructions and data – Improved operating bandwidth – Allows for different bus Von Neumann Architecture 8-bit Bus CPU Program & Data Memory CPU Harvard Architecture Data Memory Program Memory 8-bit Bus 16-bit Bus
  • 14. PIC18 Features: ⚫CPU core ⚫The function of the CPU is to execute (process) information stored in memory . ⚫Program ROM ⚫The ROM use to store program.
  • 15. PIC18 Features (cont’d) ⦿Data Memory The data memory is SRAMand EEPROM. provides aplace to store data asapplication executes and is lost when power is removed from the system. ⦿EEPROM also anonvolatile memory which is used to store data like values of certain variables. PIC18F4550 has 256 Bytesof EEPROM.
  • 16. PIC18 Features (cont’d) ⚫I/O Ports: ⚫The I/O ports are used to interface the microprocessor to the outside world. PIC18F4550 pin diagram.
  • 17. Other internal Devices ⚫Oscillator ⚫8x8 Multiplier ⚫ADC Interface ⚫Timers/Counter s ⚫USB
  • 18. PIC18 Registers ⚫CPUs use many registers to store data temporarily. ⚫To program in assembly language, we must understand the registers and architecture of given CPU and the role they play in processing data.
  • 19. PIC18 Registers ⚫ PIC microcontroller contains an 8-bit ALU (Arithmetic Logic Unit) and an 8-bit Working Register (WREG). ⚫ There are different GPRs (General Purpose Registers) and SFRs (Special Function Registers) in a PIC microcontroller. ⚫ The overall system performs 8-bit arithmetic and logic functions.
  • 21. WREG Register ⚫Stand forW orkingregister ⚫8-bit register ⚫ Use for all arithmetic and logic instructions. ⚫used bymanyinstructions as: ⚫the source of an operand. ⚫the destination for the result of the instruction execution.
  • 22. PIC File Register ⚫The file register is read/write memory used by CPU for data storage, scratch pad, and register for internal use and functions. ⚫Divided into two sections: a) Special Function Registers (SFR) b) General Purpose Registers (GPR)
  • 23. General Purpose Register (GPR) ⚫8-bit registers ⚫are a group of RAM locations in the file register that are used for data storage and scratch pad. ⚫the space that is not allocated to the SFRs typically used for general-purpose registers.
  • 24. Special Function Register (SFR) ⚫SFR are dedicated to specific functions such as ALU status, timers, serial communication, I/O ports, ADC and so on. ⚫The function of each SFR is fixed by the CPU designer at the time of design. ⚫8-bit registers
  • 26. SFR(cont’d) ⦿Examples of SFRregister: 1. PORTx 2. LA Tx 3. TRISx 4. TIMER0 5. ADCON0,ADCON1 6. ADRESH 7. INTCON 8. etc
  • 27. Review Questions 1. What do RISC an CISC stand for? 2. True or false. Harvard architecture uses the same address and data busses to fetch both code and data. 3. Register WREG is -bit wide. 4. True or false. Data space is SRAM memory, whereas program (code) space is of the ROM type. 5. The general-purpose RAM and SFRs together are called . 6. The SFR registers in PIC are -bit.
  • 28. STATUS Register ⚫8-bit register ⚫referred to asthe flagregister. ⚫only5 bits of it are used bythe PIC18. ⚫ called conditional flags ⚫The three unused bits are unimplemented and read as0.
  • 29. STATUSRegister (cont’d) Flags in Status Register b7 b6 b5 b4 b3 b2 b1 b0 Negative Overflow Zero Digit Carry Carry ⚫ C (Carry/Borrow Flag) set when an addition generates a carry and a subtraction generates a borrow. ⚫ DC(Digit Carry Flag):also called Half Carry flag;set when carry generated from Bit3 to Bit4 an arithmetic operatio.n ⚫ Z(Zero Flag):set when result of an operation is zero. ⚫ OV(Overflow Flag):set when result of an operation of signed numbers goes beyond seven bits-if the results fall outside 127(0x7F)and -128(0x80). ⚫ N(Negative Flag):set when bit B7 is one of the result of an arithmetic/logic operation. - - - N OV Z DC C
  • 30. Example 1 ⚫Show the status of the C, DC and Z flag after the addition of 38H and 2FH. ⚫Solution: 38H 00111000 + 2FH + 00101111 67H 01100111 C = 0 DC = 1 Z = 0
  • 31. Review Questions 1. The flag register in PIC is called the . 2. What is the size of the flag register in PIC? 3. Which bits of the status register are unused? 4. Which bits of the status register are used for the C and DC flag bit respectively? 5. Show the status of the C, DC and Z flag after the addition of 9CH and 64FH.