Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

AVR Assembly (as needed, assume ATMega2560) 1 How many general purpose registers

ID: 3589326 • Letter: A

Question

AVR Assembly

(as needed, assume ATMega2560)

1 How many general purpose registers is there in the AVR? And where are they located? And what is the size of each register?

2 The AVR data memory is composed of three parts, mention them and mention the kind of data stored in each one of them?

3 What is the size of each location in the data memory?

4 The CPU consists of the ALU, PC (Program Counter) and the Instruction decoder, what’s the function of each one of them?

5 Find the data memory size for the following AVR chips? (hint use their data sheets)

a) ATmega32                                         c) Attiny44

b) ATmega16

Explanation / Answer

AVR Assembly
(as needed, assume ATMega2560)


1 How many general purpose registers is there in the AVR? And where are they located? And what is the size of each register?
2 The AVR data memory is composed of three parts, mention them and mention the kind of data stored in each one of them?
3 What is the size of each location in the data memory?
4 The CPU consists of the ALU, PC (Program Counter) and the Instruction decoder, what’s the function of each one of them?
5 Find the data memory size for the following AVR chips? (hint use their data sheets)
a) ATmega32 c) Attiny44
b) ATmega16


AVR: Automatic Voltage Regulator

AVR: Advanced Virtual RISC

Answer:


1 How many general purpose registers is there in the AVR?

AVR has 32 8-bit general purpose registers ranging from R0 to R31.


And where are they located?

Each register is assigned a data memory address, residing directly into the first 32 locations of the user Data Space. The first 32 locations address the Register file in SRAM Data Memory.

General purpose registers in AVR are located directly connecting to the Arithmetic Logic Unit (ALU). The Digital pins from 0 to 13 and the adjacent AREF and GND pins, analog inputs 0 to 5, the power header and ICSP header are all located in equivalent locations. The main UART or serial port is located on the same pins (0 and 1). External interrupts 0 and 1 are located on pins 2 and 3. SPI is available through the ICSP header on both the and Duemilanove / Diecimila. I2C is not located on the same pins on the Mega (20 and 21) as the Duemilanove / Diecimila (analog inputs 4 and 5).

And what is the size of each register?

The size of each register is 8-bits.

2) The AVR data memory is composed of three parts, mention them and mention the kind of data stored in each one of them?


AVR Data Memory is used for data.


The three parts of AVR data memory are:

1) 64K/128K/256K bytes of In-System Programmable Flash - which is a 256 KB in size to store code of which 8 KB is used for the bootloader. It has Read-While-Write capabilities.
2) SRAM - which is 8 KB in size.
3) EEPROM - 4 KB in size which can be read and written with the EEPROM library.


3) What is the size of each location in the data memory?

Flash - 256KB
EEPROM - 4KB
RAM - 8KB


4) The CPU consists of the ALU, PC (Program Counter) and the Instruction decoder, what’s the function of each one of them?

*ALU is the acronym for Arithmetic Logic Unit which performs all the arithmetic and logical operations like additions, subtractions, logical AND, OR, NOT, etc.

*PC or Program Counter is basically a register which holds the address of the instruction being executed at a given time.

*Instruction decoder of a CPU is a generalized gate (a combination of circuits) with 'm' inputs and 'n' outputs. This is in the form of a read only memory or sometimes in the form of a regular combinatorial circuit. Its function is to translate or decode the instruction code into the address in the micro memory where the micro code for the instruction starts.

5 Find the data memory size for the following AVR chips?

a) ATmega32 - 1 KB of EEPROM memory, 2Kbytes Internal SRAM, 32Kbytes of In-System Self-programmable Flash program memory.
c) Attiny44 - 4KB ISP flash memory, 256-Byte EEPROM, 256B SRAM,
b) ATmega16 - 16 KB programmable flash memory, static RAM of 1 KB and EEPROM of 512 Bytes

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote