avr microcontrollers training (sahil gupta - 9068557926)

21
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

Upload: sahil-gupta

Post on 19-Jun-2015

743 views

Category:

Education


8 download

DESCRIPTION

Training PPT on AVR MICROCONTROLLER

TRANSCRIPT

Page 1: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 2: Avr microcontrollers training  (sahil gupta - 9068557926)

ATMega32 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

Page 3: Avr microcontrollers training  (sahil gupta - 9068557926)

Uses

Consumer electronics Appliances Automotive Electrical/Heating Computers / Hard Drives Hobbyist projects!

Installation art Musical instruments Home automation Audio Distribution Web Server!! MANY MORE!!

Page 4: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 5: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 6: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 7: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 8: Avr microcontrollers training  (sahil gupta - 9068557926)

ATMega32 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)

Page 9: Avr microcontrollers training  (sahil gupta - 9068557926)
Page 10: Avr microcontrollers training  (sahil gupta - 9068557926)
Page 11: Avr microcontrollers training  (sahil gupta - 9068557926)

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)

Page 12: Avr microcontrollers training  (sahil gupta - 9068557926)

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!

Page 13: Avr microcontrollers training  (sahil gupta - 9068557926)

Registers

Page 14: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 15: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 16: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 17: Avr microcontrollers training  (sahil gupta - 9068557926)

Operating System?

No common operating systems available None would work! EEPROM Bootloader / Initializer Real-Time Operating Systems Commercial Systems:

Salvo AVRX NutOS Proc

Page 18: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 19: Avr microcontrollers training  (sahil gupta - 9068557926)

Loading

EEPROM burner / custom Programmer ISP-interface

Serial / Parallel Programming (AVRdude) USB tty support Most IDE's available will make this job easy

Page 20: Avr microcontrollers training  (sahil gupta - 9068557926)

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

Page 21: Avr microcontrollers training  (sahil gupta - 9068557926)

A/D CONVERTER

An Analog-to-digitalconverter (abbreviated ADC, A/D or A to D) is a device that converts a continuous physical quantity (usually voltage) to a digital number that represents the quantity's amplitude. The conversion involves quantization of the input, so it necessarily introduces a small amount of error. Instead of doing a single conversion, an ADC often performs the conversions (“samples" the input) periodically. The result is a sequence of digital values that have converted a continuous-time and continuous-amplitude analog signal to a discrete time and discrete-amplitude digital signal.