Upload
lelien
View
213
Download
0
Embed Size (px)
Citation preview
Arduino and AVR Kevin J Dolan and Eric Teve lson
Agenda
• History of Arduino • Comparison to Other Platforms • Arduino Uno - Hardware • ATmega328P Peripherals • Instruction Se t • Processor Components • Pipe lining • Programming • Applications • Future of Arduino
History of Arduino
• Family of Microcontrolle rs created as a maste rs thesis project • intended for use by a non-technical audience of artists, designe rs, e tc.
• Made for accessibility and ease of use . • Programming made easy for the audience
• Ability to program board via USB
• Inexpensive price point • Expanded for othe r types and configurations
• Example : Arduino Lilypad for wearable technologie s
• Popularity has expanded functionality including “shie lds” and Blue tooth.
Comparison to Other Platforms
• Raspberry Pi
• Raspberry Pi is a full compute r that can run and support an OS, and has built in graphics.
• Portability is an issue , since an exte rnal supply is needed.
• Network needs more se tup on an Arduino
• Raspberry Pi does not support analog sensors as we ll
• Teensy
• Less expensive
• Compatible with Arduino “ske tches” and “shie lds”
• Bette r ADC sampling, same functionality, be tte r re solution
• Smalle r physical board size
Arduino Uno - Hardware
• ATmega328P Microcontrolle r
• 32 KB Flash Memory (2 KB SRAM, 1 KB EEPROM)
• 16 MHz Clock
• 14 Digital I/O Pins
• 6 PWM Digital I/O Pins
• 6 Analog Input Pins
• Up to 20mA DC Current pe r I/O Pin up to 300mA total across all pins
• 50mA DC Current on 3.3V Pin
Arduino Uno - Hardware
ATmega328P Peripherals
• Total of 6 accessible A/D Pins on Port C
• 14 GPIO (7 Pins each from PORT B & D)
• UART (Serial)
• SPI Support
• Watchdog timer to rese t CPU
Instruction Set
• Harvard Architecture , which is non-von Neumann memory, but still a von Neumann architecture .
• Allows separate storage and pathways of data and instructions
• Word width, timing and memory address structure can diffe r
• Instruction address ze ro is not the same as data address ze ro
• Harvard allows both reading an instruction and read/write data at the same time , even with no cache
• Allows for more speed, since fe tch and execution can be done concurrently
• Trade offs include cost and power saving from omitting cache outwe ighs the programming penaltie s from featuring distinct code and data address spaces.
Processor Components
• Arithmetic and Logic operations be tween registe rs.
• Single cycle ALU instructions
• Entire memory space accessible by conditional/unconditional jumping.
• 16 or 32 bit instructions
• 26 8-bit registe rs with three 16-bit registe rs.
• 16-bit registe rs must be assessed using two R/W ope rations on the 8-bit data bus.
Pipelining
• Harvard architecture allows paralle l instruction fe tches and executions • Makes a 2 stage pipe line
Programming
• Programmed in C, called “ske tches” • Structure
• Header: declarations, includes, e tc. • se tup(), execute s only once when program starts • loop(), continuously re -executed when the end is reached
• Main Program: int main(void){
init(); setup(); for (;;)
loop(); return 0;
}
Applications
• Combine with “shie lds”, add on modules for expansion of functions
• Control motors for moving objects
• Inte rface with sensors
• Make use of screens
• Network
Future of Arduino
• Arduino MEGA
• Large r Uno, more I/O
• Arduino Zero
• 32-bit Uno
• Arduino Due
• 32-bit MEGA, with ARM core
• Arduino Gemma
• Small for wearable s
Sources
• https://www.arduino.cc/en/Main/Products?from=Main.Hardware (Arduino
Hardware Listing)
• http://www.atmel.com/Images/doc8161.pdf (AVR Data Shee t)
• http://courses.cs.washington.edu/courses/csep567/10wi/lectures/Lecture6.pdf
(ATMega328 and Arduino Lecture from University of Washington)
• http://www.kenleung.ca/portfolio/arduino-a-brie f-history-3/ (History of Arduino
Paper)
Thank You Any Questions?