0% found this document useful (0 votes)
5 views31 pages

Lec 5 Avr

The document provides an overview of the AVR8515 microcontroller, detailing its architecture, applications, and categories such as Tiny AVR, Mega AVR, and Xmega AVR. It describes the microcontroller's features, including its memory structure, CPU components, pin configuration, and instruction sets. Additionally, it highlights various applications of the AVR8515 in fields like home automation, medical devices, and robotics.

Uploaded by

naziashar394
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)
5 views31 pages

Lec 5 Avr

The document provides an overview of the AVR8515 microcontroller, detailing its architecture, applications, and categories such as Tiny AVR, Mega AVR, and Xmega AVR. It describes the microcontroller's features, including its memory structure, CPU components, pin configuration, and instruction sets. Additionally, it highlights various applications of the AVR8515 in fields like home automation, medical devices, and robotics.

Uploaded by

naziashar394
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/ 31

Quaid -E- Awam University of Engineering, Science and

Technology Nawabshah

#5

EMBEDDED SYSTEMS

Department of Computer Systems Engineering


AVR8515 MICROCONTROLLER
AVR8515 (BASICS)

 The most common standard microcontroller families


are 8051, AVR and PIC microcontroller.

 In 1996, AVR was developed by Atmel Corporation.

 The architecture of this microcontroller was developed


by “Alf-Egil Bogen” and “Vegard Wollan”.

 The term AVR derives from its developers and stands for
Alf-Egil Bogen Vegard Wollan RISC microcontroller.

 The first microcontroller AT90S8515 was based on the


Harvard architecture.
AVR8515 (BASICS)
AVR8515 (BASICS)

 Applications

 8-bit RISC machine

 On-chip SRAM and Flash memory

 EEPROM

 Input-output data space


AVR8515 (Applications)

 Home Automation
 Automobiles
 Touch screen
 Medical devices
 Defense
 Education
 Robots
 Safety devices
 Security alarm
 Fire detection
AVR8515 (CATEGORY)

 Tiny AVR: This microcontroller has Less memory,


small in size, suitable only for simpler applications.

 Mega AVR: This microcontroller is the most


popular ones having a good amount of memory
up to 256KB, higher number of built-in peripherals
and fit for modest to difficult applications.

 Xmega AVR: This microcontroller is used


commercially which needs large program memory
and high speed.
TINY AVR
 32 general purpose registers
 132 instructions
 8 bit microcontroller
 1 kb SRAM
 512 PROM
 8 kb Flash memory
 28 pins
 RISC architecture
 3 ports
 16 MHz
 I2C –Inter – integrated circuit
 SPI- Serial peripheral interface
 UART: Universal asynchronous receiver transmitter
 2.7 – 5.5V
 Watchdog timer
 Two 8-bit timer
8-bit PIN diagram
 3 ports
 RXD, TXD receiving and transmitting
 RESET: reset
 INT0, INT1: external Interrupts
 XCK/T0: External clock/ Timer
 XTAL1/TOSC1: Crystal/Oscillator
 T1: Timer- Counter
 AIN0: Analog comparator +ve
 AIN1: Analog comparator –ve
 ICP1: input capture
 OC1A: output capture match A
 MOSI: Master output slave input
 SCK: Serial Clock
 AVCC: Vcc for internal ADC
 AREF: analog reference pin
 ADC1: ADC input channel
AVR8515 ( Harvard ARCHTECTURE)
AVR8515 ( Harvard ARCHTECTURE)
AVR8515 ( fetch and execute cycle)
AVR8515 (architecture)
AVR8515 (CPU)
 The CPU must be able to perform calculations, access memories,
control peripherals & handle interrupts.

 The AVR is based Harvard architecture.

 The IC has two buses namely one instruction bus and data bus.

 The CPU core of the AVR consists of the ALU, General Purpose
Registers, Program Counter, Instruction Register, Instruction
Decoder, Status Register and Stack Pointer
AVR8515 (CPU)

 The memory word of AVR is 16 bit wide.

 Flash memory is organized into 4k x 16.

 Flash memory is divided into Boot program section and application


program section.

 Program counter is 12 bits wide.

 The results of ALU is stored into temporary location.


AVR8515 (CPU-Status register)
7 0
I T H S V N Z C

I- Interrupt enable
T- Bit copy – bit load and bit store
H- Half carry
S- Sign
V- Overflow
N- Negative
Z- Zero
C- Carry
AVR8515 (Registers)

R7 R6 R5 R4 R3 R2 R1 R0

 8-bit register can store number from 0 to 255 or from -128 to 127.

 There are 32 registers in AVR named R0 –R31.

 All 32 general purpose registers are connected to the CPU

 Can be used directly in assembler instruction.

 Two registers to be accessed in one single instruction execution.


AVR8515 (Pointer register)
 The register pairs R27:R26; R29:R28, R31-R30
named as X, Y, Z in assembler.

 Reserve for the pointer access.

 These pairs are 16 bit pointer register.

 These registers point the addresses up 16 bit length.

 The lower byte of 16 bit address is located in lower


register and upper byte is located in upper register.

 The higher order byte of Z register is named as ZH


and the lower byte of the Z register is named as ZL.
AVR8515 (Pin Configuration)
AVR8515 (Pin Configuration)

 AVR has 4 – 8 bit ports.


 PA,PB,PC,PD configured as a input and
output ports.
 dual purpose pins.
 VCC supply generally whereas AVCC
produce supply to ADC module.
 Pin 12 ad 13 reserved for crystal clock.
 RXD and TXD pins are used in serial
communication for receiving and
transmitting of bits.
 RESET, INT0, INT1 , INT2 pins are
reserved for interrupts.
 AREF – analog reference pin.
 AIN0 and AIN1 pins are used as analog
comparator.
AVR8515 (memory map)
AVR8515 (memory map)

 32 memory location address lines reserved for


registers.
 64 memory locations are reserved for I/O
registers.
 512 address lines are reserved for internal RAM.

 64927 addresses are reserved for external RAM.


 Direct, indirect, indirect Displacement, indirect
with pre-decrement and indirect with post-
increment modes covers SRAM.
 R26- R31 are the indirect addressing pointer
register.
AVR8515 (ADDRESS SPACE)
AVR8515 (EEPROM)

 The EEPROM is a nonvolatile memory , which stands for


Electronically Erasable programmable Read-Only Memory.

 can’t run a program from it, but it is used as long time storage.

 The EEPROM doesn’t get removed when the IC loses power, it’s
a great place for storing.

 EEPROM writes the small amount of info required for your


application every time when updated the EEPROM.
AVR8515 (I/O module)

 Digital I/O modules provides the digital


communication or logic communication with the
AVR microcontroller and the external devices.

 Analog I/O modules are used to input or output


analog information from or to external devices.
These modules comprise analog comparators and
analog-to-digital converters (ADC).
AVR8515 (Timer and Communication port)

 Most AVR microcontrollers have at least one Timer or Counter


module which is used to achieve timing or counting operations
in the microcontroller. These comprises time stamping,
counting events, measuring intervals, etc.

 All AVR microcontrollers have an internal Watchdog Timer. It


has very limited useful features comprising: distinct 128kHz
CLK source, skill to reset the microcontroller and produce an
interrupt.

 The USART (Universal Synchronous/Asynchronous


Receiver/Transmitter) port is used for serial communication
with the exterior world. An instance is the USART peripheral
which uses the RS232 standard.
AVR8515 (Instruction set groups)

 Data transfer
 Arithmetic and Logical
 Bit and Bit-Test
 Control Transfer (Brach Instructions)
 MCU Control
AVR8515 (ADD instruction)

ADD two registers and the contents of the C Flag and places the
result in the destination Rd.

Operation:

(i) Rd = Rd+ Rr + C

Syntax Operands Program Counter

(i) ADC Rd, Rr PC = PC + 1


AVR8515 (AND instruction)

Perform the logical AND between the contents of Register Rd and Rr,
and places the result in the destination Rd.

Operation:

(i) Rd = Rd* Rr
Syntax Operands Program Counter

(i) AND Rd, Rr PC = PC + 1


AVR8515 (arithmetic shift)

Shift all bits in Rd one place to the right. Bit 7 is held constant. Bit 0 is
loaded into the C lag of the SREG.
Operation:

(i) b7……….bo C

Syntax Operands Program Counter

(i) AND Rd, Rr PC = PC + 1


Allah Hafiz

You might also like