Avr microcontrollers training (sahil gupta - 9068557926)
-
Upload
sahil-gupta -
Category
Education
-
view
742 -
download
8
description
Transcript of Avr microcontrollers training (sahil gupta - 9068557926)
![Page 1: Avr microcontrollers training (sahil gupta - 9068557926)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/1.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/2.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/3.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/4.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/5.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/6.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/7.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/8.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/9.jpg)
![Page 10: Avr microcontrollers training (sahil gupta - 9068557926)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/10.jpg)
![Page 11: Avr microcontrollers training (sahil gupta - 9068557926)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/11.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/12.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/13.jpg)
Registers
![Page 14: Avr microcontrollers training (sahil gupta - 9068557926)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/14.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/15.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/16.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/17.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/18.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/19.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/20.jpg)
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)](https://reader031.fdocument.pub/reader031/viewer/2022020110/5583a874d8b42a03088b507f/html5/thumbnails/21.jpg)
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.