0% found this document useful (0 votes)
32 views33 pages

Presentation1 - AVR

Uploaded by

Rohit Padile
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)
32 views33 pages

Presentation1 - AVR

Uploaded by

Rohit Padile
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/ 33

Introduction to AVR

• It is developed by Atmel corporation in 1996 and acquired


by microchip Technology in 2016
• Full form is Advance Virtual RISC or Alf and Vegard RISC
• AVR is an 8 bit RISC based single chip microprocessor,
meaning that CPU can work on only 8 bits of data at a time
• It has program (code) ROM, data ROM (EEPROM), data
RAM, timers and I/O ports
• Supports serial interfaces such as CAN, I2C,SPI, USB,
USART
General Purpose Registers
• Most of the instructions operating on the
register file have direct access to all
registers
• Most of them are single cycle
• Each register is assigned a data memory
address, mapping them directly into the
first 32 locations of the user data space
• Although not being physically
implemented as SRAM locations
• This memory organization provides great
flexibility in access of the registers, as
the X-, Y-, and Z-pointer registers can be
set to index any register in the file.
GPRs and
ALU
The AVR Data Memory
• AVR has two
memory space:
1. Code memory –
stores the program
2. Data memory –
stores the data
• Data memory
composed of Three
parts: GPRs, I/O
memory and
internal data SRAM
The AVR Data Memory with Extended I/O Memory
• GPRs use 32 bytes of data memory
space
• Always take the address location $00-
$1F in the data memory space,
regardless of AVR chip number
• I/O memory is dedicated to specific
function such as status register, timers,
serial communication, I/O ports, ADC
and so on
• I/O memory is made of 8-bit registers
• The no. of locations in the data memory
for I/O memory depends on the pin
numbers and peripheral functions
supported by that chip
• The AVR should have 64 bytes if I/O
memory
• Extended I/O memory (ATMega128 and
ATMega2560)
• Internal SRAM is used for storing data
and perameters
• Each location of SRAM can be accessed
Data Memory Sizes for the AVR Chips
Assembly Language Program
On chip ROM Size and Address Spaces
On chip Program ROM Address Range
I/O Programming in AVR
I/O port pins and their functions
• To use any of these ports as
an input or output port, it
must be programmed
• To used for I/O, each port
has some functions such as
ADC, timers, interrupts, and
serial communication pins
• Each port has three I/O
registers associate with it,
PORTx, DDRx(data
direction register) and
PINx(port input pins)
Register Addresses of Ports

• Each of I/O registers is 8 bits wide, and each port


has a maximum of 8 pins, therefore each bit of I/O
registers affects one of the pins
• For accessing I/O registers associated with the
ports the common relationship between the
registers and the pins of AVR microcontroller is
used
DDRx,PINx and PORTx Registers role in outputting
and inputting the data

• Each of I/O registers is 8 bits wide, and each port has a maximum of 8 pins,
therefore each bit of I/O registers affects one of the pins
• For accessing I/O registers associated with the ports the common relationship
between the registers and the pins of AVR microcontroller is used
Addition Instructions
Subtraction Instructions
Multiplication and Division
Logic Instructions
ROR Instruction
ROL Instruction

You might also like