SlideShare ist ein Scribd-Unternehmen logo
1 von 16
An 8 Bit Embedded
Platform (Part II)
Session 6
SURYAPRAKASH S
suryaprakash.vsm@gmail.com
The resource for the PPT is made from variety of Books and online
PPT that were available in Internet. The Purpose of the PPT is made
for the Classroom Teaching.
Agenda
Memory Organization
2/12/2019
suryaprakash.vsm@gmail.com 2
Introduction
• There are three memory blocks
in each of the PIC16F87XA
devices
• The program memory and data
memory have separate buses so
that concurrent access can
occur. ( due to Harvard
Architecture).
12-02-2019 suryaprakash.vsm@gmail.com 3
Program Memory Organization
• The PIC16F876A/877A devices have 8K
words x 14 bits of Flash program
memory, accessing a location above the
physically implemented address will
cause a wraparound.
• The Reset vector is at 0000h and the
interrupt vector is at 0004h.
12-02-2019 suryaprakash.vsm@gmail.com 4
Data Memory Organization
• The data memory is partitioned into multiple banks which contain the
General Purpose Registers and the Special Function Registers.
• Bits RP1 (Status<6>) and RP0 (Status<5>) are the bank select bits.
12-02-2019 suryaprakash.vsm@gmail.com 5
Contd.,
• Each bank extends up to 7Fh (128 bytes). The lower locations of each
bank are reserved for the Special Function Registers.
• Above the Special Function Registers are General Purpose Registers,
implemented as static RAM.
• Some frequently used Special Function Registers from one bank may
be mirrored in another bank for code reduction and quicker access.
• GPR file can be accessed either directly, or indirectly, through the File
Select Register (FSR).
• Image
12-02-2019 suryaprakash.vsm@gmail.com 6
SPECIAL FUNCTION REGISTERS
• The Special Function Registers are registers used by the CPU and
peripheral modules for controlling the desired operation of the
device.
• These registers are implemented as static RAM.
• The Special Function Registers can be classified into two sets: core
(CPU) and peripheral.
• Link to Special Function Register
12-02-2019 suryaprakash.vsm@gmail.com 7
Status Register
• The Status register contains the arithmetic status of the ALU, the Reset status and
the bank select bits for data memory.
• The Status register can be the destination for any instruction, as with any other
register.
• If the Status register is the destination for an instruction that affects the Z, DC or
C bits, then the write to these three bits is disabled.
• These bits are set or cleared according to the device logic. Furthermore, the TO
and PD bits are not writable, therefore, the result of an instruction with the
Status register as destination may be different than intended.
• For example, CLRF STATUS, will clear the upper three bits and set the Z bit. This
leaves the Status register as 000u u1uu (where u = unchanged).
• It is recommended, therefore, that only BCF, BSF, SWAPF and MOVWF
instructions are used to alter the Status register because these instructions do
not affect the Z, C or DC bits from the Status register.
12-02-2019 suryaprakash.vsm@gmail.com 8
PCL and PCLATH
• The Program Counter (PC) is 13 bits wide. The low byte comes from the PCL register which is a
readable and writable register. The upper bits (PC<12:8>) are not readable, but are indirectly
writable through the PCLATH register. On any Reset, the upper bits of the PC will be cleared.
12-02-2019 suryaprakash.vsm@gmail.com 9
STACK
• The PIC16F87XA family has an 8-level deep x 13-bit wide hardware stack.
• The stack space is not part of either program or data space and the stack
pointer is not readable or writable.
• The PC is PUSHed onto the stack when a CALL instruction is executed, or an
interrupt causes a branch.
• The stack is POP’ed in the event of a RETURN, RETLW or a RETFIE
instruction execution.
• The stack operates as a circular buffer. This means that after the stack has
been PUSHed eight times, the ninth push overwrites the value that was
stored from the first push. The tenth push overwrites the second push (and
so on).
12-02-2019 suryaprakash.vsm@gmail.com 10
Program Memory Paging
• All PIC16F87XA devices are capable of addressing a continuous 8K word
block of program memory.
• The CALL and GOTO instructions provide only 11 bits of address to allow
branching within any 2K program memory page.
• When doing a CALL or GOTO instruction, the user must ensure that the
page select bits are programmed so that the desired program memory
page is addressed.
• If a return from a CALL instruction (or interrupt) is executed, the entire 13-
bit PC is popped off the stack.
• Therefore, manipulation of the PCLATH<4:3> bits is not required for the
RETURN instructions (which POPs the address from the stack).
12-02-2019 suryaprakash.vsm@gmail.com 11
Example 2-1 shows the calling of a subroutine in page 1 of the program
memory. This example assumes that PCLATH is saved and restored by
the Interrupt Service Routine (if interrupts are used).
12-02-2019 suryaprakash.vsm@gmail.com 12
DATA EEPROM AND FLASH PROGRAM MEMORY
• The data EEPROM and Flash program memory is readable and
writable during normal operation (over the full VDD range).
• This memory is not directly mapped in the register file space. Instead,
it is indirectly addressed through the Special Function Registers.
• There are six SFRs used to read and write this memory:
• EECON1
• EECON2
• EEDATA
• EEDATH
• EEADR
• EEADRH
12-02-2019 suryaprakash.vsm@gmail.com 13
Contd.,
• When interfacing to the data memory block, EEDATA holds the 8-bit
data for read/write and EEADR holds the address of the EEPROM
location being accessed. These devices have 128 or 256 bytes of data
EEPROM (depending on the device), with an address range from 00h
to FFh. On devices with 128 bytes, addresses from 80h to FFh are
unimplemented and will wraparound to the beginning of data
EEPROM memory.
• When interfacing the program memory block, the EEDATA and
EEDATH registers form a two-byte word that holds the 14-bit data for
read/write and the EEADR and EEADRH registers form a two-byte
word that holds the 13-bit address of the program memory location
being accessed. These devices have 4 or 8K words of program Flash,
with an address range from 0000h to 1FFFh for the PIC16F877A.
12-02-2019 suryaprakash.vsm@gmail.com 14
Contd.,
• The EEPROM data memory allows single-byte read and write. The Flash
program memory allows single-word reads and four-word block writes.
• Program memory write operations automatically perform an erase-before
write on blocks of four words.
• A byte write in data EEPROM memory automatically erases the location
and writes the new data (erase-before-write).
• The write time is controlled by an on-chip timer. The write/erase voltages
are generated by an on-chip charge pump, rated to operate over the
voltage range of the device for byte or word operations
12-02-2019 suryaprakash.vsm@gmail.com 15
2/12/2019 suryaprakash.vsm@gmail.com 16
This Photo by Unknown Author is licensed under CC BY-NC-ND
Learn by Doing
Excel Thru Experimentation
Lead by Example
Acquire skills and get employed
Update skills and stay employed

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Minimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 MicroprocessorMinimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 Microprocessor
 
80386 Architecture
80386 Architecture80386 Architecture
80386 Architecture
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Module 4 advanced microprocessors
Module 4 advanced microprocessorsModule 4 advanced microprocessors
Module 4 advanced microprocessors
 
Cs14 406 80386-mod1
Cs14 406 80386-mod1Cs14 406 80386-mod1
Cs14 406 80386-mod1
 
Introduction to 80386 microprocessor
Introduction to 80386 microprocessorIntroduction to 80386 microprocessor
Introduction to 80386 microprocessor
 
Pentium processor
Pentium processorPentium processor
Pentium processor
 
Advanced micro -processor
Advanced micro -processorAdvanced micro -processor
Advanced micro -processor
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
80386 & 80486
80386 & 8048680386 & 80486
80386 & 80486
 
8086 conti
8086 conti8086 conti
8086 conti
 
PAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorPAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 Microporcessor
 
Advanced microprocessor
Advanced microprocessorAdvanced microprocessor
Advanced microprocessor
 
The 80386 80486
The 80386 80486The 80386 80486
The 80386 80486
 
8086 Architecture
8086 Architecture8086 Architecture
8086 Architecture
 
8086
80868086
8086
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
 
Unit V:Motorola 563xx
Unit V:Motorola 563xxUnit V:Motorola 563xx
Unit V:Motorola 563xx
 
80486 microprocessor
80486 microprocessor80486 microprocessor
80486 microprocessor
 
Memory Segmentation of 8086
Memory Segmentation of 8086Memory Segmentation of 8086
Memory Segmentation of 8086
 

Ähnlich wie Class 6 an 8 bit embedded platform -pic mircocontroller basics

Assembly_Language _Programming_UNIT.pptx
Assembly_Language _Programming_UNIT.pptxAssembly_Language _Programming_UNIT.pptx
Assembly_Language _Programming_UNIT.pptxVickyThakur61
 
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.pptMICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.pptkpkarthi2001
 
Class 7 an 8 bit embedded platform -instruction set
Class 7 an 8 bit embedded platform -instruction setClass 7 an 8 bit embedded platform -instruction set
Class 7 an 8 bit embedded platform -instruction setSURYAPRAKASH S
 
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...Asst.prof M.Gokilavani
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessorDiponkor Bala
 
ppt-U1 - (Introduction to 8086, Instruction Set).pptx
ppt-U1 - (Introduction to 8086, Instruction Set).pptxppt-U1 - (Introduction to 8086, Instruction Set).pptx
ppt-U1 - (Introduction to 8086, Instruction Set).pptxRaviKiranVarma4
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01destaw belay
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01Siva Raman
 
MPI-Unit-5-PPT (1).ppt
MPI-Unit-5-PPT (1).pptMPI-Unit-5-PPT (1).ppt
MPI-Unit-5-PPT (1).pptkrishna859893
 
MPI-uses and their applications in day to day life
MPI-uses and their applications in day to day lifeMPI-uses and their applications in day to day life
MPI-uses and their applications in day to day lifessuser2b759d
 

Ähnlich wie Class 6 an 8 bit embedded platform -pic mircocontroller basics (20)

MP_MC.pdf
MP_MC.pdfMP_MC.pdf
MP_MC.pdf
 
Unit 1 MPMC
Unit 1 MPMCUnit 1 MPMC
Unit 1 MPMC
 
Unit 4
Unit 4Unit 4
Unit 4
 
Assembly_Language _Programming_UNIT.pptx
Assembly_Language _Programming_UNIT.pptxAssembly_Language _Programming_UNIT.pptx
Assembly_Language _Programming_UNIT.pptx
 
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.pptMICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
 
Class 7 an 8 bit embedded platform -instruction set
Class 7 an 8 bit embedded platform -instruction setClass 7 an 8 bit embedded platform -instruction set
Class 7 an 8 bit embedded platform -instruction set
 
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
 
Module 1 8086
Module 1 8086Module 1 8086
Module 1 8086
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessor
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 
Unit 2 mpmc
Unit 2 mpmcUnit 2 mpmc
Unit 2 mpmc
 
PLc Memory & Addressing
 PLc Memory & Addressing  PLc Memory & Addressing
PLc Memory & Addressing
 
ppt-U1 - (Introduction to 8086, Instruction Set).pptx
ppt-U1 - (Introduction to 8086, Instruction Set).pptxppt-U1 - (Introduction to 8086, Instruction Set).pptx
ppt-U1 - (Introduction to 8086, Instruction Set).pptx
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01
 
Unit4.tms320c54x
Unit4.tms320c54xUnit4.tms320c54x
Unit4.tms320c54x
 
MPI-Unit-5-PPT (1).ppt
MPI-Unit-5-PPT (1).pptMPI-Unit-5-PPT (1).ppt
MPI-Unit-5-PPT (1).ppt
 
MPI-uses and their applications in day to day life
MPI-uses and their applications in day to day lifeMPI-uses and their applications in day to day life
MPI-uses and their applications in day to day life
 

Mehr von SURYAPRAKASH S

Class 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformClass 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformSURYAPRAKASH S
 
Class 2 categories of processor
Class 2 categories of processorClass 2 categories of processor
Class 2 categories of processorSURYAPRAKASH S
 
Class 1 introduction to embedded systems
Class 1 introduction to embedded systemsClass 1 introduction to embedded systems
Class 1 introduction to embedded systemsSURYAPRAKASH S
 
Product Design and Development
Product Design and DevelopmentProduct Design and Development
Product Design and DevelopmentSURYAPRAKASH S
 
Unit 4 Automated system
Unit 4 Automated systemUnit 4 Automated system
Unit 4 Automated systemSURYAPRAKASH S
 
Unit 3 Computer Numerical Control
Unit 3 Computer Numerical ControlUnit 3 Computer Numerical Control
Unit 3 Computer Numerical ControlSURYAPRAKASH S
 

Mehr von SURYAPRAKASH S (9)

Class 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformClass 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platform
 
Class 4 I/O Ports
Class 4 I/O PortsClass 4 I/O Ports
Class 4 I/O Ports
 
Class 3 Memory types
Class 3 Memory typesClass 3 Memory types
Class 3 Memory types
 
Class 2 categories of processor
Class 2 categories of processorClass 2 categories of processor
Class 2 categories of processor
 
Class 1 introduction to embedded systems
Class 1 introduction to embedded systemsClass 1 introduction to embedded systems
Class 1 introduction to embedded systems
 
Product Design and Development
Product Design and DevelopmentProduct Design and Development
Product Design and Development
 
Unit 4 Automated system
Unit 4 Automated systemUnit 4 Automated system
Unit 4 Automated system
 
Unit 3 Computer Numerical Control
Unit 3 Computer Numerical ControlUnit 3 Computer Numerical Control
Unit 3 Computer Numerical Control
 
Canbus
CanbusCanbus
Canbus
 

Kürzlich hochgeladen

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Kürzlich hochgeladen (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Class 6 an 8 bit embedded platform -pic mircocontroller basics

  • 1. An 8 Bit Embedded Platform (Part II) Session 6 SURYAPRAKASH S suryaprakash.vsm@gmail.com The resource for the PPT is made from variety of Books and online PPT that were available in Internet. The Purpose of the PPT is made for the Classroom Teaching.
  • 3. Introduction • There are three memory blocks in each of the PIC16F87XA devices • The program memory and data memory have separate buses so that concurrent access can occur. ( due to Harvard Architecture). 12-02-2019 suryaprakash.vsm@gmail.com 3
  • 4. Program Memory Organization • The PIC16F876A/877A devices have 8K words x 14 bits of Flash program memory, accessing a location above the physically implemented address will cause a wraparound. • The Reset vector is at 0000h and the interrupt vector is at 0004h. 12-02-2019 suryaprakash.vsm@gmail.com 4
  • 5. Data Memory Organization • The data memory is partitioned into multiple banks which contain the General Purpose Registers and the Special Function Registers. • Bits RP1 (Status<6>) and RP0 (Status<5>) are the bank select bits. 12-02-2019 suryaprakash.vsm@gmail.com 5
  • 6. Contd., • Each bank extends up to 7Fh (128 bytes). The lower locations of each bank are reserved for the Special Function Registers. • Above the Special Function Registers are General Purpose Registers, implemented as static RAM. • Some frequently used Special Function Registers from one bank may be mirrored in another bank for code reduction and quicker access. • GPR file can be accessed either directly, or indirectly, through the File Select Register (FSR). • Image 12-02-2019 suryaprakash.vsm@gmail.com 6
  • 7. SPECIAL FUNCTION REGISTERS • The Special Function Registers are registers used by the CPU and peripheral modules for controlling the desired operation of the device. • These registers are implemented as static RAM. • The Special Function Registers can be classified into two sets: core (CPU) and peripheral. • Link to Special Function Register 12-02-2019 suryaprakash.vsm@gmail.com 7
  • 8. Status Register • The Status register contains the arithmetic status of the ALU, the Reset status and the bank select bits for data memory. • The Status register can be the destination for any instruction, as with any other register. • If the Status register is the destination for an instruction that affects the Z, DC or C bits, then the write to these three bits is disabled. • These bits are set or cleared according to the device logic. Furthermore, the TO and PD bits are not writable, therefore, the result of an instruction with the Status register as destination may be different than intended. • For example, CLRF STATUS, will clear the upper three bits and set the Z bit. This leaves the Status register as 000u u1uu (where u = unchanged). • It is recommended, therefore, that only BCF, BSF, SWAPF and MOVWF instructions are used to alter the Status register because these instructions do not affect the Z, C or DC bits from the Status register. 12-02-2019 suryaprakash.vsm@gmail.com 8
  • 9. PCL and PCLATH • The Program Counter (PC) is 13 bits wide. The low byte comes from the PCL register which is a readable and writable register. The upper bits (PC<12:8>) are not readable, but are indirectly writable through the PCLATH register. On any Reset, the upper bits of the PC will be cleared. 12-02-2019 suryaprakash.vsm@gmail.com 9
  • 10. STACK • The PIC16F87XA family has an 8-level deep x 13-bit wide hardware stack. • The stack space is not part of either program or data space and the stack pointer is not readable or writable. • The PC is PUSHed onto the stack when a CALL instruction is executed, or an interrupt causes a branch. • The stack is POP’ed in the event of a RETURN, RETLW or a RETFIE instruction execution. • The stack operates as a circular buffer. This means that after the stack has been PUSHed eight times, the ninth push overwrites the value that was stored from the first push. The tenth push overwrites the second push (and so on). 12-02-2019 suryaprakash.vsm@gmail.com 10
  • 11. Program Memory Paging • All PIC16F87XA devices are capable of addressing a continuous 8K word block of program memory. • The CALL and GOTO instructions provide only 11 bits of address to allow branching within any 2K program memory page. • When doing a CALL or GOTO instruction, the user must ensure that the page select bits are programmed so that the desired program memory page is addressed. • If a return from a CALL instruction (or interrupt) is executed, the entire 13- bit PC is popped off the stack. • Therefore, manipulation of the PCLATH<4:3> bits is not required for the RETURN instructions (which POPs the address from the stack). 12-02-2019 suryaprakash.vsm@gmail.com 11
  • 12. Example 2-1 shows the calling of a subroutine in page 1 of the program memory. This example assumes that PCLATH is saved and restored by the Interrupt Service Routine (if interrupts are used). 12-02-2019 suryaprakash.vsm@gmail.com 12
  • 13. DATA EEPROM AND FLASH PROGRAM MEMORY • The data EEPROM and Flash program memory is readable and writable during normal operation (over the full VDD range). • This memory is not directly mapped in the register file space. Instead, it is indirectly addressed through the Special Function Registers. • There are six SFRs used to read and write this memory: • EECON1 • EECON2 • EEDATA • EEDATH • EEADR • EEADRH 12-02-2019 suryaprakash.vsm@gmail.com 13
  • 14. Contd., • When interfacing to the data memory block, EEDATA holds the 8-bit data for read/write and EEADR holds the address of the EEPROM location being accessed. These devices have 128 or 256 bytes of data EEPROM (depending on the device), with an address range from 00h to FFh. On devices with 128 bytes, addresses from 80h to FFh are unimplemented and will wraparound to the beginning of data EEPROM memory. • When interfacing the program memory block, the EEDATA and EEDATH registers form a two-byte word that holds the 14-bit data for read/write and the EEADR and EEADRH registers form a two-byte word that holds the 13-bit address of the program memory location being accessed. These devices have 4 or 8K words of program Flash, with an address range from 0000h to 1FFFh for the PIC16F877A. 12-02-2019 suryaprakash.vsm@gmail.com 14
  • 15. Contd., • The EEPROM data memory allows single-byte read and write. The Flash program memory allows single-word reads and four-word block writes. • Program memory write operations automatically perform an erase-before write on blocks of four words. • A byte write in data EEPROM memory automatically erases the location and writes the new data (erase-before-write). • The write time is controlled by an on-chip timer. The write/erase voltages are generated by an on-chip charge pump, rated to operate over the voltage range of the device for byte or word operations 12-02-2019 suryaprakash.vsm@gmail.com 15
  • 16. 2/12/2019 suryaprakash.vsm@gmail.com 16 This Photo by Unknown Author is licensed under CC BY-NC-ND Learn by Doing Excel Thru Experimentation Lead by Example Acquire skills and get employed Update skills and stay employed

Hinweis der Redaktion

  1. A stack pointer is a small register that stores the address of the last program request in a stack. A stack is a specialized buffer which stores data... A program counter is a register in a computer processor that contains the address (location) of the instruction being executed at the current time. As each instruction gets fetched, the program counter increases its stored value by 1. After each instruction is fetched, the program counter points to the next instruction in the sequence. When the computer restarts or is reset, the program counter normally reverts to 0.