0% found this document useful (0 votes)
55 views

Lecture 04 AV-314 PIC Memory Architecture

This document provides an overview of the memory architecture of the PIC16X microcontroller. It discusses the three types of memory: ROM, EEPROM, and RAM. The ROM is used to permanently store the program and has 8K locations addressed by a 13-bit program counter. The EEPROM can retain data when power is off and allows changing data during operation, with 256 bytes of memory. The RAM contains general purpose registers and special function registers, with 368 bytes partitioned into four banks selected via the status register. Interrupts are handled via vectors stored in program memory.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Lecture 04 AV-314 PIC Memory Architecture

This document provides an overview of the memory architecture of the PIC16X microcontroller. It discusses the three types of memory: ROM, EEPROM, and RAM. The ROM is used to permanently store the program and has 8K locations addressed by a 13-bit program counter. The EEPROM can retain data when power is off and allows changing data during operation, with 256 bytes of memory. The RAM contains general purpose registers and special function registers, with 368 bytes partitioned into four banks selected via the status register. Interrupts are handled via vectors stored in program memory.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

AV-314

Digital Systems-Embedded System


Lecture No-04

“PIC16X Memory Architecture”


PIC 16F8xX Datasheet
PIC Microcontrollers (mikroElectronika) Chapter 01

Number of Slides: 16
1
Learning Objectives

• To understand the memory architecture of


PIC16X MCU

2
PIC 16F877 Overview

3
PIC16Fx Memory Elements (Types)
PIC16Fx hosts three types of memories
1. ROM
– Also Known as Program memory
– Used to permanently save the program (code)
– 8K locations (8192 locations)
– 14 bits each
– Contents can be changed by providing a special
programming voltage (12 volts)
– Separate address bus (Harvard Architecture)
4
PIC16Fx Memory Elements (Types)
PIC16Fx hosts three types of memories
2. EEPROM
– Contents are retained even if power goes off
(similar to program memory)
– Contents can even be changed during operations
(Unlike program memory)
– Used to permanently save results during
operations
– 256 x 8 bits of EEPROM
5
PIC16Fx Memory Elements (Types)
PIC16Fx hosts three types of memories
3. RAM
– Data is lost if power is removed
– Contains
• General Purpose Registers (GPRs)
– 368 x 8 bits of memory
• Special Function Registers (SFRs)

6
PROGRAM MEMORY (ROM)

7
Program Memory
• 13 bit Program Counter
• Address space 213 = 8192
• Reset Vector at 0000H
• Interrupt Vector at 0004H
• Stack = Eight 13-bit registers

Source: Datasheet 8
Interrupt Handling Described
• Traffic Light Example

9
Memory Paging
• 2K (2048) size of segments
• 4 Pages
• Easy Management
• Call and Goto have 11bits
address

10
RAM (REGISTER FILES)

11
RAM Memory

12
RAM Register Types
• 8-Bit registers
• GPRs
– To store temporary data and results
– Can be utilized for general use
• SFRs
– Purpose is pre-determined and cannot be changed
– Bits are physically connected to specific peripherals
– Change in contents directly affect the relevant circuit

13
RAM Memory Organization
• Data memory is partitioned in 4 banks (blocks)
– Each contains 128 memory locations
• Bank selection through 2-bits of Status Register

• Some registers are in multiple banks on same


address (for easy access)
14
15
End of Lecture
Next Lecture PIC16: Key SFRs

16

You might also like