0% found this document useful (0 votes)
16 views4 pages

Memory Architecture

The document discusses the memory architecture of the ATmega16 microcontroller. It describes the different types of memory including volatile memory (SRAM, DRAM), non-volatile memory (ROM, PROM, EPROM, EEPROM, Flash), and the memories used in the ATmega16 specifically. The ATmega16 contains 16KB of flash program memory, 1KB of SRAM data memory, and 512B of EEPROM. The flash memory is divided into a boot section and application section. The SRAM is organized into registers, I/O registers, and internal memory. The document also provides memory maps of the program and data memories.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Memory Architecture

The document discusses the memory architecture of the ATmega16 microcontroller. It describes the different types of memory including volatile memory (SRAM, DRAM), non-volatile memory (ROM, PROM, EPROM, EEPROM, Flash), and the memories used in the ATmega16 specifically. The ATmega16 contains 16KB of flash program memory, 1KB of SRAM data memory, and 512B of EEPROM. The flash memory is divided into a boot section and application section. The SRAM is organized into registers, I/O registers, and internal memory. The document also provides memory maps of the program and data memories.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

ATmega16 Memory Architecture

A general classification of memory


Generally two main types: Volatile and Non-volatile Memory

Volatile Memory
Volatile memory is a memory which retains its contents only so long as the system is powered
on. Volatile Memory will lose the data in it when powered down.

– Static RAM
– Dynamic RAM

SRAM is a short for static random access memory and it’s a type of memory that is faster and
more reliable than dynamic RAM.
While DRAM supports access times of about 60 nanoseconds, SRAM can give access times as
low as 10 nanoseconds. But, SRAM is much more expensive to produce than DRAM.

Non-volatile Memory
Contrary to volatile memory, non-volatile memories retain their content even when power is cut.
– ROM
– PROM
– EPROM
– EEPROM
– Flash memory
Non-volatile memory is usually a lot slower, more involved to work with, and much more
expensive than the volatile memory.
For example, while the volatile memory in your PC has access times in the nanosecond range,
some types of non-volatile memory will be unavailable for milliseconds after writing even one
byte to them.

ROMs are commonly programmed by manufacturer and once programmed, can’t be changed.
These are cost-effective when you need thousands of copies of a single program.

PROMs and so-called One Time Programmable ROMs called OTP can be programmed by a
special device called a PROM programmer only one time, so these are not suitable for development
where the content of the memory need to be often changed. But once the development process is
finished, they are well-suited for middle range mass production.

EPROMs. This chip could be programmed with a special programmer and could be erased by applying
ultra-violet light. It takes long time to erase.
EEPROMs are much like EPROMs except that they are electrically erasable without ultraviolet source.
Limitations of EEPROMs are just slow speed and high cost, and they can be reprogrammed over than
10,000 times.

Flash Memory: Flash memory is also a computer storage that can be electrically erased and
reprogrammed, like EEPROM, but Flash devices can erase all the data at once with block mode erasing,
unlike EEPROM with byte-by-byte mode.
Flash memory was invented by a Japanese working for Toshiba in 1984, and commercialized in the early
1990s, the erasure process of the memory reminded him of the flash of a camera, so he named the
memory flash. Flash memory is sometimes called flash ROM or flash EEPROM

Memories used in microcontroller system


First we need to get the obvious distinction of memory types which is used in microcontroller
system in general.

Register File: Normally this is a relatively small memory embedded on the CPU and consists of
several registers. It is used as a scratchpad for temporary storage of values that the CPU is
working with.

Data Memory: This is longer term storage, which is much larger than the register file.
Data memory is also used for temporary storage of the dynamic data which is generated by the
application program.

Program Memory: Like the data memory, the program memory is usually a relatively large
memory, and it is used for storage of program code.

EEPROM Memory: This is commonly a lot smaller than program memory, and it is used for
storage of data that has to be kept even though power is off.

ATmega16 memory architecture


This section describes the different memories in the ATmega16.
ATmega16 contains all the memory in one package internally.
ATmega16 has two main memory spaces, that is, Program Memory and Data Memory.
In addition, it includes an EEPROM Memory as well.
Flash Program Memory
The ATmega16 contains 16 Kbytes Flash memory for program storage.
Since all AVR instructions are 16 or 32 bits wide, the Flash is organized as 8K ×16.
The Program Counter in the ATmega16 is 13 bits wide, so you can address the 8K program
memory locations.
Program Flash memory space is divided in two sections, the Boot program section and the
Application Program section.
The Application section is the section of the Flash that is used for storing the application code.
The Boot program section is used for the Boot Loader software.
The size of the different sections can be configured by the boot size configuration fuse bit called
BOOTSZ.
Figure 1. Program Memory Map

Suppose you developed your specific


software for the microcontroller in your PC,
then you could get hex file, which is to be
downloaded into the application flash
section of the microcontroller to be
executed.
Boot flash section is for storage of boot
loader program, which is used for the
application program update.
The program memory in all AVR
controllers, it is 16 bit (2 byte) wide and its
extension by external EPROM or Flash is
impossible.

SRAM Data Memory


In the ATmega16 the internal data memory is volatile and built as a static RAM (SRAM).

Figure 2 shows how the ATmega16 SRAM Memory is organized.


Totally 1120 bytes of memory locations.
ATmega16 Data memory consists of the 32 general purpose working registers, 64 I/O Registers,
and the 1024 bytes of internal SRAM.
There are five different addressing modes for the data memory in the Atmega16.
That is, Direct, Indirect, Indirect with Displacement, Indirect with Pre-decrement, Indirect with
Post-increment.
All the data memory can be accessed through these addressing modes.
These addressing modes will be described detailed in the next time when you are going to learn
about Assembly language.
In contrast with program memory section, there exists the possibility to expand the data memory
externally up to 64KBytes.
I/O Memory
The I/O memory of the ATmega16 contains the address of all the peripherals of how to be
configured in the memory space.
It will be detailed later in the 7th lecture.

EEPROM Data Memory


The ATmega16 contains 512 bytes of nonvolatile EEPROM memory.
The EEPROM has an endurance of at least 100,000 write/erase cycles.
In order for use of EEPROM data memory, you should touch on three specific registers,
EEPROM Address Register, EEPROM Data Register, EEPROM Control Register.
You can write in and read from the data by using these registers.
When programming in practical, this part will be detailed.

Assignment

[1]. What is a microprocessor and a microcontroller?


[2]. What is the difference between microprocessor and microcontroller?
[3]. CISC and RISC
[4]. Von Neumann architecture and Havard architecture
[5]. Program counter and Stack pointer
[6]. A general instruction structure of CPU ( Opcode, Operand)

You might also like