0% found this document useful (0 votes)
9 views22 pages

Unit54. Memory and ATmega Memory Map

The document provides an overview of memory types relevant to the ATmega 328P microcontroller, including both non-volatile (e.g., ROM, EEPROM, Flash) and volatile (e.g., SRAM, DRAM) memory. It details the characteristics, uses, and differences between these memory types, along with specific information about the ATmega 328P's memory architecture. Additionally, it discusses the organization and functionality of the EEPROM and Flash memory within the ATmega 328P, highlighting their roles in program storage and data retention.

Uploaded by

sddode96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views22 pages

Unit54. Memory and ATmega Memory Map

The document provides an overview of memory types relevant to the ATmega 328P microcontroller, including both non-volatile (e.g., ROM, EEPROM, Flash) and volatile (e.g., SRAM, DRAM) memory. It details the characteristics, uses, and differences between these memory types, along with specific information about the ATmega 328P's memory architecture. Additionally, it discusses the organization and functionality of the EEPROM and Flash memory within the ATmega 328P, highlighting their roles in program storage and data retention.

Uploaded by

sddode96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

4.

Memory and
ATmega 328P Memory map

1
Sciences and Humanities Types of memories

Non-volatile memory: ROM


1. Mask ROM
Vishwakarma Institute of

2. PROM
3. EPROM
Technology

4. EEPROM
FY - Department of Engineering,

5. Flash EEPROM

Volatile memory –Random access memory RAM


6. RAM SRAM
7. RAM DRAM

2
Sciences and Humanities Types of Non-volatile memories

Non-volatile memory
Non-volatile memory (NVM) preserves the data stored in it during periods when the
power to the chip is turned off.
Vishwakarma Institute of

If the information written on ROM goes wrong, the ROM must be discarded. So it is
referred to as OTP One Time Programmable ROM
Technology

ROM (Read-only memory) – This is designed to hold permanent data. It’s normal operation
FY - Department of Engineering,

is read-only and not to write . It is used to store system software which must be
immediately accessible to the computer,
1. MROM (Mask programmed ROM or Mask ROM) – In this type the data is programmed
into the chip when the chip is manufactured, so it is only used for large production runs.
It cannot be rewritten with new data.

3
Sciences and Humanities Types of Non-volatile memories

2. PROM (Programmable read-only memory) – The data is written into a ROM during
manufacture, while with a PROM the data is programmed into them after manufacture.
Vishwakarma Institute of

The data is written into an PROM chip before it is installed in the circuit. The PROMs are
manufactured blank. The chip is plugged into a device called a PROM programmer. For
Technology

every bit of PROM there exists a fuse.


The memory can be programmed just once after manufacturing by "blowing" the fuses,
FY - Department of Engineering,

which is an irreversible process.


The PROM was invented in 1956 by Wen Tsing Chow a Chinese-born American missile
guidance scientist and a digital computer pioneer, known for the invention of
programmable read-only memory or PROM.

4
Types of Non-volatile memories
3. EPROM (UV Erasable programmable read-only memory) –
Sciences and Humanities

a. In this type the data can be rewritten by removing the chip from the circuit
board.
Vishwakarma Institute of

b. It is plugged into a PROM/EPROM programmer.


c. The data can be erased using UV light exposure through a glass window
Technology

provided on top of the memory chip or even the microcontrollers.


FY - Department of Engineering,

d. Chip is kept in EPROM erasure equipment to expose it to Ultra Violet light to


erase the existing data.
e. It takes about 20 min to erase the program.
f. To burn a code or data into EPROM, the ROM burner uses 12.5 volts or higher
depending on EPROM type. The voltage is referred to as Vpp in data sheet
g. It is often used for prototypes and small production run devices, where the
program in it may have to be changed at the factory.
5
M27C256B– 256Kbits,
32 Kbytes
showing transparent Zero
window used to erase Insertion
Sciences and Humanities

the chip Force


(ZIF)
socket
Vishwakarma Institute of

Example : Programming
setup with M27C322
32 Mb EPROM
Technology
FY - Department of Engineering,

By Bill BertramPixel8Photo by: Bill BertramCamera:Fujifilm FinePix


F106.3 Megapixels 3x Optical zoom - Own work, CC BY-SA 2.5,
https://commons.wikimedia.org/w/index.php?curid=751671
6
Sciences and Humanities Types of Non-volatile memories

4. EEPROM (Electrically erasable programmable read-only memory)


Vishwakarma Institute of

In this type the data can be written electrically, while the chip is on the circuit
board, but the writing process is slow.
Technology

This type is used to hold firmware, the low level microcode which runs hardware
FY - Department of Engineering,

devices, such as the BIOS program in most computers, so that it can be updated.

Microcontrollers consists of EEPROMs.


ATmega 328 has an EEPROM memory of 1KB

7
Types of Non-volatile memories
SN EEPROM UV-EPROM
Sciences and Humanities

1 Method of erasing code is electrical Method of erasing code is exposure to


ultra violet rays
Vishwakarma Institute of

2 Erasure of data is instant as it is electrical Data erasure takes around 20 min

3 In EEPROM one can select which byte is In UVEPROM entire contents get erased
to be erased
Technology

4 We can program and erase the contents Needs to be removed from system
while still it is on system board board for erasing data or for
FY - Department of Engineering,

programming
5 EEPROM does not require an external External programming as well as
programming or erasure device. erasure device is required
6 Number of program and erase cycles is Number of program and erase cycles is
100,000, For RAM and hard disk--infinite 1000
7 Costlier as compared to EPROM Relatively less costlier

8
Types of Non-volatile memories

5. Flash memory –
Sciences and Humanities

1. Since 1990 --, user programmable memory


2. Erasure of entire contents takes less than a second. Or in a flash. Hence the name.
Vishwakarma Institute of

3. In this type the writing process is intermediate in speed between EEPROMS and RAM
memory
4. Data can be written on Flash, but not fast enough to serve as main memory. It is often
used to store files
Technology

5. Erasure method is electrical, hence it is also called as flash EEPROM. Referred to as


Flash to avoid confusion.
FY - Department of Engineering,

6. When Flash memory contents are erased, entire device is erased, in contrast to
EEPROM, where desired byte/bytes can be erased.
7. In specially developed Flash memories, the contents are divided into blocks and
erasure can be done block by block, but not byte by byte.
8. It is used in portable devices such as PDAs, USB flash drives, and removable memory
cards used in digital cameras and cell phones.
ATmega328 microcontroller has a Flash-type program memory of 32KB.

9
RAM– Random access
memory
Sciences and Humanities

Random-access memory (RAM) is a form of computer memory that can be read


and changed. RAM is used to store the data that is currently processed by the
Vishwakarma Institute of

CPU. Most of the machine code and working data that are modifiable are stored
in RAM. Commercial use of semiconductor RAM started by IBM in 1965
RAM is normally associated with volatile types of memory, The stored
Technology

information in RAM is lost if power is removed.


FY - Department of Engineering,

Integrated RAM chips are available in two forms:


1. Static random-access memory (SRAM)
2. Dynamic random-access memory (DRAM).

Atmega 328P consists of 2K SRAM

10
Levels of data memory:
Level 1 or Register
It is a type of memory in which data is stored and accepted that are immediately stored in
Sciences and Humanities

CPU. Most commonly used register is accumulator, Program counter, address register etc.
Vishwakarma Institute of

Level 2 or Cache memory


It is the fastest memory which has faster access time where data is temporarily stored for
faster access. The name of the actual hardware that is used for cache memory is high-speed
static random access memory (SRAM).
Technology

Level 3 or Main Memory


FY - Department of Engineering,

It is memory on which computer works currently. It is small in size and once power is off data
no longer stays in this memory.

Level 4 or Secondary Memory – Not the temporary memory


It is external memory which is not as fast as main memory but data stays permanently in this
memory. Like hard disks, portable hard disks, flash drives etc.

Also there is a concept of virtual memory

11
Sciences and Humanities
RAM– continued
1. Static Random Access Memory (SRAM) :
SRAM stores information with the help of transistors.
SRAM is called static as no change or action
Vishwakarma Institute of

i.e. refreshing is not needed to keep the data intact.


SRAM is a type of semiconductor memory that uses Bistable latching circuitry to store each
bit. Data is stored using the six transistor memory cell.
Static RAM is mostly used as a cache memory for the processor (CPU).
Technology

2. Dynamic Random Access Memory (DRAM) :


FY - Department of Engineering,

Data is stored in capacitors. Capacitors that store data in DRAM gradually discharge energy,
no energy means the data has been lost. So, a periodic refresh of power is required in
order to function. DRAM is called dynamic as constant action i.e. refreshing is needed to
keep the data intact. It is used to as main memory.

3. Virtual memory- When a large program or multiple programs are running, it's possible for
memory to be fully used. To compensate for a shortage of physical memory, the
computer's operating system (OS) can create virtual memory. To do this, the OS
temporarily transfers inactive data from DRAM to disk storage.
12
SRAM and DRAM
SN SRAM DRAM
Sciences and Humanities

1 Complex internal circuitry. Hence less Small internal circuitry in the one bit
storage capacity compared to same memory cell. So, in DRAM large storage
physical size of DRAM capacity is available
Vishwakarma Institute of

2 Transistors are used to store information Capacitors are used to store data in DRAM.
in SRAM.
3 SRAM has lower access time. Faster than DRAM has higher access time compared to
Technology

DRAM SRAM. Slower


4 It has medium /more power consumption. DRAM offers reduced power consumption.
FY - Department of Engineering,

5 SRAM has low packaging density High packaging density


6 These are used in cache memories. its size It is used in main memories. Its size is 4GB
is 1MB to 16MB. to 16GB in computers and laptops.
7 SRAM is usually present on processors. On DRAM is present on the motherboard. Off
chip memory chip memory.
8 Costlier than DRAM DRAM costs less compared to SRAM

13
Vishwakarma Institute of
FY - Department of Engineering,
Technology Sciences and Humanities

configuration
Atmega 328P
Memory/Registers

14
EEPROM in
Atmega328P
Sciences and Humanities

EEPROM is 1 K bytes. (1024)


Vishwakarma Institute of

1. It is organized as a separate data space, in which single bytes can be read


and written.
Technology

2. Can endure at least 100,000 write/erase cycles.


FY - Department of Engineering,

3. Non-volatile storage for program specific data, constants, etc.

4. Requires special write sequence to store data.

5. Should be accessed using – Part of I/O memory


• EEPROM Address Register,
• EEPROM Data Register and
• EEPROM Control Register.
15
Flash Program Memory
ATmega328P
Sciences and Humanities

• The ATmega328P contains 32Kbytes On-chip In-System Reprogrammable Flash


Vishwakarma Institute of

memory for program storage. Can endure at least 100,000 write/erase cycles.
Nonvolatile.
Technology

• Flash is organized as 16K x 16.


FY - Department of Engineering,

• The ATmega328/P Program Counter (PC) is 14 bits wide, thus addressing the
16K program memory locations. (Each location of 16 bits)

• The Flash memory is organized in two main sections, the Application section
and the Boot Loader section.

16
Flash Program Memory map
ATmega328P • The AVR Bootloader is a program that allows a
Sciences and Humanities

Windows application , like Arduino IDE to write


D15 D14 -------------------------D2 D1
D0 code in flash memory.
0x0000
Vishwakarma Institute of

• I helps in using the PC serial port instead of a


traditional programmer.
16 bits
BLS – Boot Loader Section
Technology

16 K = • Self-Programming Mode (SPM) is a feature of the


Application Program Section 16384 AVR microcontroller which enables the boot
FY - Department of Engineering,

loader section to program its own Application


section . The Boot Loader software is located in
the BL section

Boot loader section Application Section


0x3FFF • The Application section is the section of the Flash
that is used for storing the application code. The
Application section can never store any Boot
16K but 16bits,
Loader code
Hence 32K 17
Vishwakarma Institute of
FY - Department of Engineering,
Technology Sciences and Humanities

ATmega328P
Flash Program Memory map

18
RAM in Atmega328P – Volatile
Data can be accessed through the standard data bus (Load/Store Instructions).
Sciences and Humanities

There is a secondary In/Out Bus for rapid direct access to select locations.
Vishwakarma Institute of

Stores Operands and results of


arithmetic/logical operations
32 Registers
Ro –Ro
R31
– R31
Technology

00 –00
1F– 1F 64 I/O registers Used to access peripherals
FY - Department of Engineering,

20 –20
3F– 3F
160 Extended I/O Used to access extra peripherals
registers

0x0100
2048 Used to store temporary
data
Internal SRAM (2K)
0x8FF

19
Sciences and Humanities
RAM in Atmega328P – Volatile
Data address I/O address Contents
0x0000 – 0x001F Registers R0 – R31
Vishwakarma Institute of

I/O registers (bit-


0x0020 – 0x003F 0x00 – 0x1F
addressable)
I/O registers (not
0x0040 – 0x005F 0x20 – 0x3F
Technology

bit-addressable)
Extended I/O
FY - Department of Engineering,

0x0060 – 0x00FF registers (memory-


mapped I/O only)
0x0100 – 08FF Internal SRAM

20
RAM in Atmega328P – Volatile
Registers (32 bytes) (000016–001F16)
Sciences and Humanities

The 32 general purpose working registers are addressed by their numbers (R0–R31)
Vishwakarma Institute of

I/O Memory (64 bytes) (002016–005F16)


Contains addressable space for peripheral control registers and other I/O registers.
The IN/OUT data bus has direct access to this 64-byte I/O Memory section (not the Extended)
Technology

This memory can also be accessed by the standard data bus using a 0x20 address offset in the
FY - Department of Engineering,

access command.

Extended I/O Memory (160 bytes) (006016–08FF16)


Atmega 328 is a complex microcontroller with more peripheral units than can be supported.

Some of the SRAM is used as Extended I/O memory to handle the extra peripherals control
registers and other I/O functions.
For this Extended I/O space in SRAM, only the ST/STS/STD (Store) and LD/LDS/LDD (Load)
instructions can be used.
21
Sciences and Humanities
RAM in Atmega328P – Volatile
Internal SRAM (2048 x 8-bit) (010016–08FF16)
Vishwakarma Institute of

SRAM is used for temporarily storing intermediate results and variables.


The GP registers are like SRAM as they can store data.
Difference is-- they are a part of the CPU core. The core has direct (and fast) access
Technology

to them, and some operations (like arithmetic, comparisons, etc.) can only be
FY - Department of Engineering,

performed on GP registers.

Other instructions are used to move data between GP registers and SRAM.
I/O registers are a means to manipulate the various peripherals (timers, USARTs,
SPI, etc).
22

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy