AVR Microcontrollers - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

AVR Microcontrollers

Description:

Intel, Freescale, Microchip (PIC), TI, Zilog. Atmel AVR. Many Types, tinyAT, megaAT, automotive ... Royalty Free. 1-2KB storage. 50-100Bytes Memory. Can spawn ... – PowerPoint PPT presentation

Number of Views:628
Avg rating:3.0/5.0
Slides: 25
Provided by: csSu5
Category:

less

Transcript and Presenter's Notes

Title: AVR Microcontrollers


1
AVR Microcontrollers
  • What is a microcontroller?
  • microprocessor
  • Read-write memory
  • Flash memory
  • EEPROM
  • Input/Output Control
  • Peripheral Devices (AD/DA)?
  • Billions sold per year, most processors
  • Emphasis is on cost. (pennies)?
  • Alternative/paired to ASIC/DSP
  • Emphasis on power consumption

2
Uses
  • Consumer electronics
  • Appliances
  • Automotive
  • Electrical/Heating
  • Computers / Hard Drives
  • Hobbyist projects!
  • Installation art
  • Musical instruments
  • Home automation
  • Audio Distribution
  • Web Server!!
  • MANY MORE!!

3
Other Examples
4
Other Examples
5
Manufacturers
  • Intel, Freescale, Microchip (PIC), TI, Zilog
  • Atmel AVR
  • Many Types, tinyAT, megaAT, automotive
  • Lighting, LCD
  • Share unified platform
  • Different s of I/O control
  • Built-in Pull-up resistors
  • Ethernet, Serial Data, Auxiliary Power, USB
  • Analog I/O, Packaging, Interrupts, Math, JTAG
  • Get the right amount of memory for the job

6
Development Platforms
  • Everything Needed, All-In-One
  • Arduino / Diecimila
  • ATMega8 / ATMega168 based
  • Open source, multiplatform IDE
  • Cheap (33 assembled!)?
  • Great Online Community
  • USB, power, protoshield available, breadboard,
    LEDs
  • Parallax (PIC)?
  • PICAXE (PIC)?
  • ArmExpress
  • Many Others

7
Cheaper
  • A Transistor Saved is a Transistor Earned
  • No Lack Floating Point
  • Non-Pipeline
  • No cache
  • Limited Math / Branching
  • Very Slow (1 to 32MHz)?
  • Very Little Memory (64bytes to 256KB)?
  • From under a dollar to 20 for advanced
  • Cheaper in volume
  • Important for large product runs

8
Atmel / AVR History
  • Conceived by two students at Norwegian Institute
    of Technology (NTH)?
  • Alf-Egil Bogen and Vegard Wollan
  • Originally Known as µRISC (Micro RISC)?
  • Sold to Atmel, continued working under Atmel
    Norway subsidiary
  • AVR supposedly not acronym
  • May mean Advanced Virtual RISC
  • Beauty in simplicity
  • Can wrap mind around entire CPU

9
ATMega168 Specifications
  • Low-Power 8-bit AVR Microcontroller
  • Modified Harvard Architecture
  • Around 4 individual, 2.50 in Volume
  • 32 8-bit general-purpose registers
  • 131 Instructions, Multi-cycle Implementation
  • Most are single-cycle
  • 2-cycle multiply, 2-cycle memory access
  • Thus up to 1MIPS/MHz
  • 20MHz, up to 20MIPS
  • 16KB self-programmable Flash
  • 512 Bytes EEPROM
  • 1KB SRAM

10
ATMega168 IO
  • 6 PWM Shared Input/Outputs (Analog)?
  • 8 digital input/outputs
  • SPI-serial, 2-wire serial, ISP, others
  • Monitoring, debugging, programming, power
  • USART serial interface
  • (interfaces with USB on Arduino)?

11
(No Transcript)
12
(No Transcript)
13
Instruction Set
  • Mostly unified across all AVR
  • With exceptions for feature differences
  • 32 or 16 bit instructions
  • 8-bit fields, vary depending on instructions
  • I/O manipulation treated in similar fashion to
    registers
  • Allows for clean and simple usage
  • Parallel Instruction Fetch
  • Uses Skip instead of Branches
  • Use software libraries for more complex
    functionality (divide)?

14
Example Code
  • Assembly Code Example(1)?
  • ...
  • Define pull-ups and set outputs high
  • Define directions for port pins
  • ldi r16,(1ltltPB7)(1ltltPB6)(1ltltPB1)(1ltltPB0)?
  • ldi r17,(1ltltDDB3)(1ltltDDB2)(1ltltDDB1)(1ltltDD
    B0)?
  • out PORTB,r16
  • out DDRB,r17
  • Insert nop for synchronization
  • nop
  • Read port pins
  • in r16,PINB
  • ...

15
Registers
  • 32 general purpose registers
  • Addressable as first 32 memory addresses
  • 4 Different Simultaneous Access Schemes
  • X, Y, Z registers for indirect memory
  • Dual-purpose, 16 bit
  • 26/27, 28/29, 30/31
  • 200 I/O, settings, timers, interrupts registers
  • Overflow at 256 / 65K!

16
Registers
17
Memories
  • 3 different memories
  • SRAM
  • Flash
  • EEPROM
  • Direct/Indirect Addressing (5 modes total)?
  • Flash is divided into two 8KB sections
  • Independently addressable
  • Flash has reserved Bootloader section for
    software security

18
Additional Functionality
  • Registers for serial access
  • Interrupts
  • External Interrupts
  • Power Management
  • Timers
  • Analog Comparators
  • Other Goodies
  • All handled via special registers
  • Some settings via bit-flags

19
Compilers
  • Meant for Assembly Programming
  • Many environments available
  • BASIC and FORTRAN compilers available
  • Open Source Tools and Compilers
  • avr-GCC for C/C support
  • AVR Studio Assembler / Simulator
  • Supported, official, Windows-only IDE

20
Operating System?
  • No common operating systems available
  • None would work!
  • EEPROM Bootloader / Initializer
  • Real-Time Operating Systems
  • Commercial Systems
  • Salvo
  • AVRX
  • NutOS
  • Proc

21
FreeRTOS
  • Free and Open Source Operating System
  • Portable across many platforms
  • Royalty Free
  • 1-2KB storage
  • 50-100Bytes Memory
  • Can spawn off tasks
  • Guaranteed timings, simple
  • Coroutines
  • Less memory, more complex, coexist, portable
  • Commercial Sister Projects

22
Loading
  • EEPROM burner / custom Programmer
  • ISP-interface
  • Serial / Parallel Programming (AVRdude)?
  • USB tty support
  • Most IDE's available will make this job easy

23
Future
  • Smaller, Better, Faster, Cheaper
  • Many new products become possible
  • Children's toys
  • Ubiquitous Computing
  • Physical Computing
  • Becoming very popular among Hobbyists
  • Great introduction for CS people into EE-land

24
Websites / References
  • ATMEL
  • www.atmel.com
  • Arduino
  • www.arduino.cc
  • Adafruit Industries
  • www.adafruit.com
  • FreeRTOS
  • www.freertos.org
  • AVR Freaks
  • www.avrfreaks.net
Write a Comment
User Comments (0)
About PowerShow.com