AVR Microcontrollers Architecture

Similar documents
Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

ATmega128. Introduction

MICROPROCESSOR BASED SYSTEM DESIGN

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

ARDUINO MEGA INTRODUCTION

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

8-bit Microcontroller with 8K Bytes Programmable Flash AT90C8534. Preliminary

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

8-bit Microcontroller with 4K Bytes In-System Programmable Flash. ATtiny40. Preliminary

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

AVR ISA & AVR Programming (I)

8-bit Microcontroller with 2K Bytes of In-System Programmable Flash. ATtiny22 ATtiny22L. Preliminary. Features. Description

Mechatronics and Microcomputers. Stipendium Hungaricum 2018/2019 Autumn Semester Szilárd Aradi, PhD

8-bit Microcontroller with 2K Bytes of In-System Programmable Flash AT90S2323 AT90LS2323 AT90S2343 AT90S/LS2323. Features.

EE 308: Microcontrollers

Arduino Uno R3 INTRODUCTION

VCC PB2 (SCK/ADC1/T0/PCINT2) PB1 (MISO/AIN1/OC0B/INT0/PCINT1) PB0 (MOSI/AIN0/OC0A/PCINT0)

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

8-bit Microcontroller with 1K Byte of In-System Programmable Flash AT90S1200

AT90S Bit Microcontroller with 1K bytes Downloadable Flash AT90S1200. Features. Description. Pin Configuration

Microcontrollers. Microcontroller

Module 2: Introduction to AVR ATmega 32 Architecture

LAMPIRAN. Universitas Sumatera Utara

ECED3204: Microprocessor Part I--Introduction

Basic Components of Digital Computer

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

8051 microcontrollers

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

8-bit XMEGA D Microcontroller XMEGA D MANUAL. Preliminary

8-bit Microcontroller with 1K Bytes Flash. ATtiny10 ATtiny11 ATtiny12. Preliminary. Features. Pin Configuration

8-bit Microcontroller with 1K Byte Flash. ATtiny11. ATtiny12

8051 Microcontroller

8-bit Microcontroller with 8K Bytes In-System Programmable Flash. ATmega8515 ATmega8515L. Features

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

8-bit Atmel XMEGA C Microcontroller XMEGA C MANUAL

DERTS Design Requirements (1): Microcontroller Architecture & Programming

AVR MICROCONTROLLER ARCHITECTURTE

STM32 MICROCONTROLLER

ATmega8A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET COMPLETE

8-Bit Microcontroller with 1K bytes In-System Programmable Flash AT90S1200. Features. Description. Pin Configuration

Distributed Real- Time Control Systems

ATmega128A. Introduction. Features. 8-bit AVR Microcontroller DATASHEET COMPLETE

Lecture 2. Introduction to Microcontrollers

AVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director

Microprocessors/Microcontrollers

8-bit Microcontroller with 2K Bytes of In-System Programmable Flash AT90S2313

Chapter 2 Sections 1 8 Dr. Iyad Jafar

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad


8-bit Microcontroller with 1K Byte Flash. ATtiny15L

Microprocessors & Interfacing

MICROCONTROLLERS 8051

Introduction to Microcontrollers

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

Interrupts (I) Lecturer: Sri Notes by Annie Guo. Week8 1

EE 354 Fall 2015 Lecture 1 Architecture and Introduction

Microcomputer Architecture and Programming

8-bit Microcontroller with 16K Bytes In-System Programmable Flash. ATmega169V ATmega169. Features. Notice: Not recommended in new designs.

8-bit Microcontroller with 4K/8K bytes In-System Programmable Flash AT90S4414 AT90S8515. Features. Pin Configurations

Microcontroller: CPU and Memory

Introduction to ARM LPC2148 Microcontroller

8-bit Atmel Microcontroller with 8/16K Bytes In-System Programmable Flash AT90PWM81 AT90PWM161

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

AVR Microcontroller with Core Independent Peripherals and PicoPower technology

8. Power Management and Sleep Modes

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny261/V ATtiny461/V ATtiny861/V. Preliminary

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT90S8515

EE 308: Microcontrollers

8-bit Microcontroller with 2K Bytes Flash. ATtiny26 ATtiny26L

CN310 Microprocessor Systems Design

acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.

Chapter 7 Central Processor Unit (S08CPUV2)

8-bit Atmel XMEGA D Microcontroller XMEGA D MANUAL

8-bit Microcontroller with 2/4/8K Bytes In-System Programmable Flash. ATtiny261 ATtiny461 ATtiny861. Automotive

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.

8-bit Microcontroller with 2K Bytes of Flash. ATtiny28L ATtiny28V

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

ARM Cortex A9. ARM Cortex A9

Fig 1. Block diagram of a microcomputer

A First Look at Microprocessors

ELC4438: Embedded System Design Embedded Processor

ATmegaS128. Introduction. Features

8-bit Microcontroller with 4/8K Bytes In-System Programmable Flash. ATtiny48/88. Preliminary

8/16-bit Atmel AVR XMEGA Microcontrollers

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Question Bank Microprocessor and Microcontroller

8-bit Microcontroller with 4K Bytes of In-System Programmable Flash AT90S4433 AT90LS4433. Features. Not Recommend for New Designs. Use ATmega8.

8-bit Microcontroller with 40K Bytes In-System Programmable Flash. ATmega406. Preliminary

COMP2121: Microprocessors and Interfacing

Microprocessor Architecture

TKT-3500 Microcontroller systems

UNIT IV MICROCONTROLLER

By: Dr. Hamed Saghaei

8-bit Microcontroller with 2K Bytes Flash. ATtiny26 ATtiny26L. Preliminary. Features

Transcription:

ก ก There are two fundamental architectures to access memory 1. Von Neumann Architecture 2. Harvard Architecture 2 1 Harvard Architecture The term originated from the Harvard Mark 1 relay-based computer, which stored instructions on punched tape and data in relay latches. Harvard Architecture: The Harvard architecture uses physically separate memories for their instructions and data, requiring dedicated buses for each of them. Instructions and operands can therefore be fetched simultaneously. Different program and data bus widths are possible, allowing program and data memory to be better optimized to the architectural requirements. E.g.: If the instruction format requires 14 bits then program bus and memory can be made 14-bit wide, while the data bus and data memory remain 8-bit wide. 4. ก ก Von Neumann Architecture There are two fundamental architectures to access memory. 3 John Von Neumann's: One shared memory for instructions (program) and data with one data bus and one address bus between processor and memory. Instructions and data have to be fetched in sequential order (known as the Von Neuman Bottleneck), limiting the operation bandwidth. Its design is simpler than that of the Harvard architecture. It is mostly used to interface to external memory.

6 8 Some Advanced Microcontrollers 8-bit microcontroller Atmel AVR (ATmega8) 16-bit microcontroller Intel MCS-96 32-bit microcontroller ARM microcontroller PIC Microcontroller 5 ARM Microcontrollers 32-bit RISC architecture ARM offers several microprocessor core designs, including the ARM7, ARM9, ARM11, Cortex- A8, Cortex-A9, and Cortex-A15. Optimized for implementation in FPGAs Microchip Microcontrollers PIC Microcontrollers AVR Microcontrollers 7

ก Atmel 1996 Flash memory ก ก RISC Microcontrollers ก Harvard - tiny AVR - mega AVR - XMEGA AVR - 32-bit AVR 9 ก AVR ก Series Name Pins Flash Memory Special Feature TinyAVR 6-32 0.5-8 KB Small in size MegaAVR 28-100 4-256KB Extended peripherals XmegaAVR 44-100 16-384KB DMA, Event System included 10 PIC and AVR Microcontrollers The PIC (Programmable Interrupt Controller) appeared around 1980. Microchip Technology Inc. 8 bit bus executes 1 instruction in 4 clk cycles Harvard architecture AVR (1994) Atmel corporation 8 bit bus one instruction per cycle Harvard architecture 11 Harvard Architecture Microcontroller 12

Block diagram of the AVR MCU Architecture 13 SIMPLIFIED INTERNAL ARCHITECTURE OF ATMEGA8 The central feature is the AVR core consisting ALU, 32 general purpose registers including three index registers, processor status register, stack pointer and program counter with instruction register and instruction decoder. 14 SOME IMPORTANT FEATURES OF ATMEGA8 ( ) SOME IMPORTANT FEATURES OF ATMEGA8 8-bit advanced RISC architecture. Register to register architecture without any accumulator. 130 instructions including signed and unsigned multiplication. 32 general purpose 8-bit registers. Fully static to 16 MHz operational frequency. 8K bytes on-chip flash program memory. 1K bytes on-chip SRAM for data storage. 512 bytes on-chip EEPROM. Programming lock for software security. 23 programmable I/O lines. 15 Two 8-bit and one 16-bit Timers/Counters. Six-channel 10-bit on-chip ADC. Programmable serial USART. SPI serial interface. Watchdog timer with separate onchip oscillator. On-chip analog comparator. External and internal interrupt sources. Five sleep modes for power management. 16

PINS AND SIGNALS OF ATMEGA8 Note that all 23 I/O lines have alternate functions. Five power input lines. External crystal and reset are not essential. 17 OPERATING VOLTAGE AND POWER CONSUMPTION Operating voltage of ATmega8: 4.5V to 5.5V ATmega8L: 2.7V to 5.5V At 4 Mhz with 3 volts it consumes 3.6 ma, reduced to 1 ma in idle mode and 0.5 ua in power-down mode. Each port pin of ATmega8L is capable of sourcing or sinking 20 ma current at 5V and 10 ma current at 3V. Note the identical sourcing as well as sinking capabilities. 18 Program Memory (Flash) The Flash memory has an endurance of at least 10,000 write/erase cycles. The ATmega8A Program Counter (PC) is 12 bits wide, thus addressing the 4K Program memory locations Flash ก PC ก ก 19 MAP OF ATMEGA8 PROGRAM MEMORY (FLASH) Program memory is arranged as 4K words as ATmega8 opcodes are either 16-bit or 32-bit. The program memory is divided into two sections : boot and application for software security. 20

SRAM Data Memory and Register ORGANIZATION OF 1120 BYTES OF SRAM DATA MEMORY Data Memory Map 8 bits Data memory (SRAM) accommodates general purpose registers, I/O registers and scratch pad area. 21 I/O registers are similar to the Special Function Registers (SFRs) of 8051. I/O registers have two sets of addresses. 22 The X-register, Y-register and Z-register AVR CPU General Purpose Working Registers ก 1 Clock SBCI, SUBI, CPI, ANDI ORI ก ก ก LDI ก R6 - R31 SBC,SUB,CP,AND OR 23 R26 - R31 ก indirect addressing X, Y Z 24

Status Register Bit 7 I: Global Interrupt Enable The Global Interrupt Enable bit must be set for the interrupts to be enabled. The individual interrupt enable control is then performed in separate control registers. If the Global Interrupt Enable Register is cleared, none of the interrupts are enabled independent of the individual interrupt enable settings. The I-bit is cleared by hardware after an interrupt has occurred, and is set by the RETI instruction to enable subsequent interrupts. The I-bit can also be set and cleared by the application with the SEI and CLI instructions, as described in the Instruction Set Reference. Bit 6 T: Bit Copy Storage The Bit Copy instructions BLD (Bit LoaD) and BST (Bit STore) use the T-bit as source or destination for the operated bit. A bit from a register in the Register File can be copied into T by the BST instruction, and a bit in T can be copied into a bit in a register in the Register File by the BLD instruction. Bit 5 H: Half Carry Flag The Half Carry Flag H indicates a Half Carry in some arithmetic operations. Half Carry is useful in BCD arithmetic. See the Instruction Set Description for detailed information. 26 STACK AND STACK POINTER Stack may be located anywhere within upper 1024 bytes of SRAM. Lower 96 bytes (register area) must not be occupied by stack. 16-bit stack pointer contains two 8-bit registers, SPH and SPL. PUSH command decreases the stack pointer and POP command increases it. In general, the stack pointer to be initialized by the highest address of SRAM. 28 DETAILS OF STATUS REGISTER (SREG) OF ATMEGA8 C : carry S : sign Z : zero H : half carry N : negative T : bit copy storage V : 2 s complement I : global interrupt overflow disable 25 Status Register Bit 4 S: Sign Bit, S = N V The S-bit is always an exclusive or between the Negative Flag N and the Two s Complement Overflow Flag V. See the Instruction Set Description for detailed information. Bit 3 V: Two s Complement Overflow Flag The Two s Complement Overflow Flag V supports two s complement arithmetics. See the Instruction Set Description for detailed information. Bit 2 N: Negative Flag The Negative Flag N indicates a negative result in an arithmetic or logic operation. See the Instruction Set Description for detailed information. Bit 1 Z: Zero Flag The Zero Flag Z indicates a zero result in an arithmetic or logic operation. See the Instruction Set Description for detailed information. Bit 0 C: Carry Flag The Carry Flag C indicates a Carry in an arithmetic or logic operation. See the Instruction Set Description for detailed information. 27

Stack Pointer Instructions SPH and SPL Stack Pointer High and Low Register 30 29 POWER MANAGEMENT AND SLEEP MODES ATmega8 offers five sleep modes for efficient power management. They are: Idle mode ADC noise reduction mode Power-down mode SYSTEM RESET Four sources of reset for ATmega8 are: Power-on reset External reset Watchdog reset, and Brown-out reset. All I/O registers are initialized and execution starts from the reset vector. MCUCSR register holds the information about the source of reset. 32 Power-save mode, and Standby mode. SLEEP instruction evokes the sleep mode. 31

34 WATCHDOG TIMER Operated by a separate internal oscillator of 1 MHz frequency. May be enabled or disabled through its register WDTCR. Generates system reset at terminal count. System Clock and Clock Options Useful to avoid hanging system. To be loaded periodically to avoid system reset. 33 System Clock and Clock Options Clock source can be selected via I/O register Changing clock source requires time to stabilize frequency Adjusting clock frequency makes trade-off between processing power and power consumption 35