Arduino and AVR - Rochester Institute of...

15
Arduino and AVR Kevin J Dolan and Eric Tevelson

Transcript of Arduino and AVR - Rochester Institute of...

Page 1: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

Arduino and AVR Kevin J Dolan and Eric Teve lson

Page 2: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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

Page 3: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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.

Page 4: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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

Page 5: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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

Page 6: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

Arduino Uno - Hardware

Page 7: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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

Page 8: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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.

Page 9: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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.

Page 10: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

Pipelining

• Harvard architecture allows paralle l instruction fe tches and executions • Makes a 2 stage pipe line

Page 11: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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;

}

Page 12: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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

Page 13: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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

Page 14: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

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)

Page 15: Arduino and AVR - Rochester Institute of Technologymeseec.ce.rit.edu/551-projects/fall2015/1-4.pdf · History of Arduino • Family of Microcontrollers created as a masters thesis

Thank You Any Questions?