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

Lab 2 Memory and Data Application Design

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

Lab 2 Memory and Data Application Design

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

Lab 2.

Memory and data


application design

Professor: Oleg Nepomnuashchiy


Assistant: Svetlana Leshchenko
Storage classification

2
RAM VS ROM
RAM – Random Access Memory

The RAM device allows data items to be read or


written at substantially the same time
regardless of the physical location of the data in
memory. However, with other direct-access
media such as hard disks, CD-RWs, DVD-RWs,
and older magnetic tapes, the time required to
read / write data varies greatly relative to their
physical location on the media due to
mechanical constraints. rotation speed of the
wearer and hand movement.

3
RAM VS ROM
ROM – Read Only Memory

A type of nonvolatile memory used in


computers and other electronic devices. The
data stored in the ROM cannot be changed
electronically after the manufacture of the
memory device. Persistent memory is useful
for storing software that rarely changes over
the life of the system, sometimes called
firmware. Software applications for
programmable devices may be distributed
as removable cartridges containing read-
only memory.

4
RAM VS ROM
RAM ROM
Data Cannot hold data without power. Can hold data without power.
Storage Temporary medium of storage. Permanent medium of storage.
Power Chip is volatile, loses information if power Is nonvolatile, does not require constant source
is gone. of power.

Operation Chip is used in normal operation of Is primarily used in startup process of computer
computer. or bootstrapping.

Speed Writing data to RAM is faster. Writing to ROM is much slower as compared to
RAM.

Example Chips can store information, run the PROM chip used with BIOS store the program
program and quickly switch between the need to begin initial computer start up process.
tasks.

5
RAM – what is it?
RAM is also includes:
• SRAM - Static Random Access
Memory (including Cache L1, Cache L2,
Cache L3);
• DRAM - Dynamic Random Access
Memory.

DRAM is the most popular memory


card used in many devices on the
market.

6
ROM – what is it?
PROM (Programmable Read-Only Memory) - ROM, once "flashed" by the user;
EPROM (Erasable Programmable Read-Only Memory) is a reprogrammable ROM.
For the passage of ultraviolet rays to the crystal, a window with quartz glass was
provided in the microcircuit case.
EEPROM (Electrically Erasable Programmable Read-Only Memory) - electrically
erasable programmable ROM, the memory of which can be erased and filled with
data several tens of thousands of times, is used in solid-state drives, one of the
varieties of EEPROM is flash memory.
NVRAM (Non-volatile memory, "non-destructive" memory) - ROM that acts as a
small RAM, structurally combined with a battery; in the USSR, such devices were
often called "Dallas" after the company Dallas Semiconductor, which put them on
the market; in NVRAM of modern computers, the battery is no longer structurally
connected to the RAM and can be replaced;
7
AVR microcontroller architecture
BLOCKS:

CPU - central control processor, the


heart of the microcontroller, 8-bit
microprocessor core;
ALU - arithmetic logic unit, the basis of
the CPU block;
Program Counter - command counter;
32 general purpose registers;
Instruction Register - register of
commands, instructions;
Instruction Decoder;
OCD (On-Chip Debugger) - internal
debug unit;
Analog Comparator - analog signal
comparison unit;
A / D Converter - analog-to-digital
converter;
8
AVR microcontroller architecture
Interfaces:

JTAG Interface (Joint Test Action Group Interface)


- in-circuit debugging interface (4 wires);
LCD Interface (Liquid-Crystal Display Interface) -
an interface for connecting a liquid crystal
display, indicator;
USART (Universal Asynchronous Receiver-
Transmitter), UART - universal asynchronous
transceiver;
TWI (Two-Wire serial Interface) - a serial interface
with a two-wire connection;
Watchdog Timer - watchdog or supervision
timer;
I / O Ports – input/ output ports;
Interrupts - block of control and response to
interrupts;
Timers / Counters - modules for timers and
counters. 9
AVR microcontroller architecture
Memory blocks:

FLASH - reprogrammable
memory for storing the
program;
EEPROM (Electrically
Erasable Programmable
Read-Only Memory) - re-
programmable ROM, non-
volatile memory;
RAM (Random Access
Memory) - processor RAM.
10
AVR controller software model
All program memory of
AVR microcontrollers is
made using FLASH
technology and located
on a chip. It is a
sequence of 16-bit cells
and has a capacity from
512 words to 64K
words, depending on
the type of crystal.

11
AVR controller software model

12
AVR controller software model

13
AVR controller software model

14
15
Memory allocation
AVR CPU General Purpose Working Registers Data memory map

16
Compiler directive: DEF
Directive Description
BYTE Reserve bytes in RAM Program segment
CSEG Program segment
DSEG Data segment
ESEG EEPROM segment
DEF Assign a symbolic name to a register
ORG Set position in segment
SET Set variable symbolic equivalent of expression

17
Compiler directive: DSEG, CSEG, BYTE
Press Alt+6 to open.
In the list of memory types, select data REGISTERS.

18
Compiler directive: SET, ORG

SET - Set variable symbolic equivalent of expression

ORG - Set position in segment

19
Lab 2. The task
Purpose of work: studying operations of writing and reading data into memory, operations of
addition and subtraction over registers, operations of comparison of registers and constants,
organization of cycles.

Arrange the original arrays A and B in data memory sequentially starting at $0060. Fill the
original arrays with arbitrary values. Perform the required operation on arrays A and B, write
the result into memory in array C located at the specified address. Find the
minimum/maximum element in array C and write it to the required address. Sort array C in
ascending/descending order.

20
Lab 2. The forms
Forms Array size (A, B) Operation Array size (С) Array Find an item Element Sorting
address address
1 8 Crossing 8 0x75 Min 0x7E Ascending
2 10 Difference 20 0x79 Max 0x8F Ascending
3 12 Crossing 12 0x7D Min 0x8C Ascending
4 14 Difference 24 0x81 Max 0x9D Ascending
5 16 Crossing 16 0x85 Min 0x9A Ascending
6 8 Difference 16 0x75 Max 0x8B Descending
7 10 Crossing 10 0x7B Min 0x8C Descending
8 12 Difference 24 0x81 Max 0xA2 Descending
9 14 Crossing 14 0x87 Min 0x9E Descending
10 16 Difference 32 0x8D Max 0xB7 Descending
11 8 Crossing 8 0x75 Min 0x8B Descending
12 10 Difference 24 0x7C Max 0x9A Ascending
13 12 Crossing 12 0x91 Min 0x7A Descending
14 14 Difference 24 0x8A Max 0x7C Ascending
15 16 Crossing 16 0x9C Min 0x8A Descending
Useful links and reading
1. The AVR Microcontroller and Embedded Systems Using Assembly and C
(Chapter 0, 1 and 2).
2. Atmel assembler for beginners Beginners Introduction to the Assembly
Language of ATMEL-AVR-Microcontrollers by Gerhard Schmidt http://www.avr-asm-
tutorial.net April 2020.

22

You might also like