Arduino

77
PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Wed, 04 Dec 2013 07:33:23 UTC Arduino

description

ar

Transcript of Arduino

  • PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information.PDF generated at: Wed, 04 Dec 2013 07:33:23 UTC

    Arduino

  • ContentsArticles

    Arduino 1Single-board microcontroller 7Atmel AVR 12Atmel AVR instruction set 25Orthogonal instruction set 31Open-source hardware 33List of Arduino compatibles 37Wiring (development platform) 63Processing (programming language) 65

    ReferencesArticle Sources and Contributors 72Image Sources, Licenses and Contributors 73

    Article LicensesLicense 75

  • Arduino 1

    Arduino

    Arduino

    "Arduino Uno" Revision 3

    Type Single-board microcontroller

    Website www.arduino.cc [1]

    Arduino is a single-board microcontroller to make using electronics in multidisciplinary projects more accessible.The hardware consists of an open-source hardware board designed around an 8-bit Atmel AVR microcontroller, or a32-bit Atmel ARM. The software consists of a standard programming language compiler and a boot loader thatexecutes on the microcontroller.Arduino boards can be purchased pre-assembled or as do-it-yourself kits. Hardware design information is availablefor those who would like to assemble an Arduino by hand. It was estimated in mid-2011 that over 300,000 officialArduinos had been commercially produced.

    HistoryArduino started in 2005 as a project for students at the Interaction Design Institute Ivrea in Ivrea, Italy. At that timeprogram students used a "BASIC Stamp" at a cost of $100, considered expensive for students. Massimo Banzi, oneof the founders, taught at Ivrea.A hardware thesis was contributed for a wiring design by Colombian student Hernando Barragan. After the wiringplatform was complete, researchers worked to make it lighter, less expensive, and available to the open sourcecommunity. The school eventually closed down, so these researchers, one of them David Cuartielles, promoted theidea.The current prices run around $30 and related "clones" as low as $9.

  • Arduino 2

    Hardware

    An official Arduino Uno with descriptions of theI/O locations

    A 3rd-party Arduino board with a RS-232 serialinterface (upper left) and an Atmel ATmega8

    microcontroller chip (black, lower right); the 14digital I/O pins are located at the top and the six

    analog input pins at the lower right.

    An Arduino board consists of an Atmel 8-bit AVR microcontrollerwith complementary components to facilitate programming andincorporation into other circuits. An important aspect of the Arduino isthe standard way that connectors are exposed, allowing the CPU boardto be connected to a variety of interchangeable add-on modules knownas shields. Some shields communicate with the Arduino board directlyover various pins, but many shields are individually addressable via anIC serial bus, allowing many shields to be stacked and used in parallel.Official Arduinos have used the megaAVR series of chips, specificallythe ATmega8, ATmega168, ATmega328, ATmega1280, andATmega2560. A handful of other processors have been used byArduino compatibles. Most boards include a 5volt linear regulator anda 16MHz crystal oscillator (or ceramic resonator in some variants),although some designs such as the LilyPad run at 8MHz and dispensewith the onboard voltage regulator due to specific form-factorrestrictions. An Arduino's microcontroller is also pre-programmed witha boot loader that simplifies uploading of programs to the on-chip flashmemory, compared with other devices that typically need an externalprogrammer.

    At a conceptual level, when using the Arduino software stack, allboards are programmed over an RS-232 serial connection, but the waythis is implemented varies by hardware version. Serial Arduino boardscontain a level shifter circuit to convert between RS-232-level andTTL-level signals. Current Arduino boards are programmed via USB,implemented using USB-to-serial adapter chips such as the FTDI FT232. Some variants, such as the Arduino Miniand the unofficial Boarduino, use a detachable USB-to-serial adapter board or cable, Bluetooth or other methods.(When used with traditional microcontroller tools instead of the Arduino IDE, standard AVR ISP programming isused.)

    The Arduino board exposes most of the microcontroller's I/O pins for use by other circuits. The Diecimila,Duemilanove, and current Uno provide 14 digital I/O pins, six of which can produce pulse-width modulated signals,and six analog inputs. These pins are on the top of the board, via female 0.10-inch (2.5mm) headers. Several plug-inapplication shields are also commercially available.The Arduino Nano, and Arduino-compatible Bare Bones Board and Boarduino boards may provide male header pinson the underside of the board to be plugged into solderless breadboards.There are many Arduino-compatible and Arduino-derived boards. Some are functionally equivalent to an Arduinoand may be used interchangeably. Many are the basic Arduino with the addition of commonplace output drivers,often for use in school-level education to simplify the construction of buggies and small robots. Others areelectrically equivalent but change the form factor, sometimes permitting the continued use of Shields, sometimesnot. Some variants use completely different processors, with varying levels of compatibility.

  • Arduino 3

    Official boardsThe original Arduino hardware is manufactured by the Italian company Smart Projects. Some Arduino-brandedboards have been designed by the American company SparkFun Electronics.[2] Sixteen versions of the Arduinohardware have been commercially produced to date.

    Example Arduino boards

    Arduino Diecimila Arduino Duemilanove (rev2009b)

    Arduino UNO Arduino Leonardo

    Arduino Mega ArduinoNano

    Arduino Due(ARM-based)

    LilyPad Arduino (rev 2007)

    ShieldsArduino and Arduino-compatible boards make use of shieldsprinted circuit expansion boards that plug into thenormally supplied Arduino pin-headers. Shields can provide motor controls, GPS, ethernet, LCD display, orbreadboarding (prototyping). A number of shields can also be made DIY.

    Example Arduino shields

    Multiple shields can bestacked. In this example the

    top shield contains asolderless breadboard

    Screw-terminal breakout shieldin a wing-type format

    Adafruit Motor Shield with screwterminals for connection to

    motors

    Adafruit Datalogging Shield witha SD slot and Real-Time Clock

    chip

  • Arduino 4

    Software

    Arduino Software IDE

    A screenshot of the Arduino IDE showing the "Blink" program, a simple beginner program

    Developer(s) Arduino Software

    Stable release 1.0.5 / May15,2013

    Preview release 1.5.4 Beta / September10,2013

    Written in Java, C and C++

    Operating system Cross-platform

    Type Integrated development environment

    License LGPL or GPL license

    Website arduino.cc [3]

    The Arduino integrated development environment (IDE) is a cross-platform application written in Java, and isderived from the IDE for the Processing programming language and the Wiring projects. It is designed to introduceprogramming to artists and other newcomers unfamiliar with software development. It includes a code editor withfeatures such as syntax highlighting, brace matching, and automatic indentation, and is also capable of compiling anduploading programs to the board with a single click. A program or code written for Arduino is called a "sketch".Arduino programs are written in C or C++. The Arduino IDE comes with a software library called "Wiring" from theoriginal Wiring project, which makes many common input/output operations much easier. Users only need definetwo functions to make a runnable cyclic executive program: setup(): a function run once at the start of a program that can initialize settings loop(): a function called repeatedly until the board powers offA typical first program for a microcontroller simply blinks an LED on and off. In the Arduino environment, the usermight write a program like this:

  • Arduino 5

    The integrated pin 13 LED

    #define LED_PIN 13

    void setup () {

    pinMode (LED_PIN, OUTPUT); // Enable pin 13 for digital output

    }

    void loop () {

    digitalWrite (LED_PIN, HIGH); // Turn on the LED

    delay (1000); // Wait one second (1000 milliseconds)

    digitalWrite (LED_PIN, LOW); // Turn off the LED

    delay (1000); // Wait one second

    }

    It is a feature of most Arduino boards that they have an LED and load resistor connected between pin 13 and ground;a convenient feature for many simple tests. The previous code would not be seen by a standard C++ compiler as avalid program, so when the user clicks the "Upload to I/O board" button in the IDE, a copy of the code is written to atemporary file with an extra include header at the top and a very simple main() function at the bottom, to make it avalid C++ program.The Arduino IDE uses the GNU toolchain and AVR Libc to compile programs, and uses avrdude to upload programsto the board.As the Arduino platform uses Atmel microcontrollers, Atmel's development environment, AVR Studio or the newerAtmel Studio, may also be used to develop software for the Arduino.

    DevelopmentThe core Arduino developer team is composed of Massimo Banzi, David Cuartielles, Tom Igoe, Gianluca Martino,David Mellis and Nicholas Zambetti. Massimo Banzi was interviewed on the March 21st, 2009 episode (Episode 61)of FLOSS Weekly on the TWiT.tv network, in which he discussed the history and goals of the Arduino project. Healso gave a talk at TEDGlobal 2012 Conference, where he outlined various uses of Arduino boards around the world.Arduino is open source hardware: the Arduino hardware reference designs are distributed under a CreativeCommons Attribution Share-Alike 2.5 license and are available on the Arduino Web site. Layout and productionfiles for some versions of the Arduino hardware are also available. The source code for the IDE is available andreleased under the GNU General Public License, version 2.Although the hardware and software designs are freely available under copyleft licenses, the developers have requested that the name "Arduino" be exclusive to the official product and not be used for derivative works without permission. The official policy document on the use of the Arduino name emphasizes that the project is open to

  • Arduino 6

    incorporating work by others into the official product. Several Arduino-compatible products commercially releasedhave avoided the "Arduino" name by using "-duino" name variants.

    Applications Xoscillo: open-source oscilloscope Scientific equipment Arduinome: a MIDI controller device that mimics the Monome OBDuino: a trip computer that uses the on-board diagnostics interface found in most modern cars The Humane Reader and Humane PC from Humane Informatics: low-cost electronic devices with TV-out that

    can hold a five thousand book library (e.g. offline Wikipedia compilations) on a microSD card Ardupilot: drone software / hardware ArduinoPhone[4]

    ReceptionThe Arduino project received an honorary mention in the Digital Communities category at the 2006 Prix ArsElectronica.

    References[1] http:/ / www. arduino. cc[2] Schmidt, M. ["Arduino: A Quick Start Guide"], Pragmatic Bookshelf, January 22, 2011, Pg. 201[3] http:/ / arduino. cc/ en/ Main/ Software[4] ArduinoPhone (http:/ / www. instructables. com/ id/ ArduinoPhone/ ). Instructables.com (2013-07-17). Retrieved on 2013-08-04.

    External links Official website (http:/ / arduino. cc/ ) Arduino The Documentary (http:/ / www. imdb. com/ title/ tt1869268/ ) at the Internet Movie Database, YouTube

    (https:/ / www. youtube. com/ watch?v=8zB2KIm4EEQ), Vimeo (http:/ / vimeo. com/ 18539129) Simple Arduino setup process. (https:/ / exosite. zendesk. com/ hc/ en-us/ articles/

    200095738-Arduino-Basic-Temperature-Monitor) Documentary about Arduino (http:/ / tv. wired. it/ entertainment/ 2012/ 12/ 06/

    arduino-creare-e-un-gioco-da-ragazzi-eng-sub. html), Wired Magazine (in Italian) How to install additional Arduino libraries? (http:/ / arduino. cc/ en/ Guide/ Libraries) Arduino Cheat Sheet (http:/ / robodino. org/ resources/ arduino) Arduino Board Pinout Diagrams: Due (http:/ / arduino. cc/ forum/ index. php?/ topic,132130. 0. html), Esplora

    (http:/ / www. flickr. com/ photos/ 28521811@N04/ 8469564216/ sizes/ l/ in/ photostream/ ), Leonardo (http:/ /www. flickr. com/ photos/ 28521811@N04/ 8466547410/ sizes/ l/ in/ photostream/ ), Mega (http:/ / www. flickr.com/ photos/ 28521811@N04/ 8451024820/ sizes/ l/ in/ photostream/ ), Micro (http:/ / www. flickr. com/ photos/28521811@N04/ 8471357492/ sizes/ l/ in/ photostream/ ), Mini (http:/ / www. flickr. com/ photos/28521811@N04/ 8453583648/ sizes/ l/ in/ photostream/ ), Uno (http:/ / www. flickr. com/ photos/28521811@N04/ 8449936925/ sizes/ l/ in/ photostream/ )

    Evolution tree for Arduino (http:/ / i. imgur. com/ yGRLPvL. jpg)

  • Single-board microcontroller 7

    Single-board microcontroller

    The Make Controller Kit with an AtmelAT91SAM7X256 (ARM) microcontroller.

    A single-board microcontroller is a microcontroller built onto asingle printed circuit board. This board provides all of the circuitrynecessary for a useful control task: microprocessor, I/O circuits, clockgenerator, RAM, stored program memory and any support ICsnecessary. The intention is that the board is immediately useful to anapplication developer, without needing to spend time and effort indeveloping the controller hardware.

    As they are usually low-cost hardware, and have an especially lowcapital cost for development, single-board microcontrollers have longbeen popular in education. They are also a popular means fordevelopers to gain hands-on experience with a new processor family.

    Origins

    Single-board microcontrollers appeared in the late 1970s when the first generations of microprocessors, such as the6502 and the Z80, made it practical to build an entire controller on a single board, and affordable to dedicate acomputer to a relatively minor task.

    In March 1976, Intel announced a single-board computer product that integrated all the support components requiredfor their 8080 microprocessor, along with 1 kbyte of RAM, 4 kbytes of user-programmable ROM, and 48 lines ofparallel digital I/O with line drivers. The board also offered expansion through a bus connector, but it could be usedwithout an expansion card cage where applications didn't require additional hardware. Software development for thissystem was hosted on Intel's Intellec MDS microcomputer development system; this provided assembler and PL/Msupport, and permitted in-circuit emulation for debugging.[1]

    Processors of this era required a number of support chips in addition. RAM and EPROM were separate, oftenrequiring memory management or refresh circuitry for dynamic memory as well. I/O processing might be carried outby a single chip such as the 8255, but frequently required several more chips.A single-board microcontroller differs from a single-board computer in that it lacks the general purpose userinterface and mass storage interfaces that a more general-purpose computer would have. Compared to amicroprocessor development board, a microcontroller board would emphasize digital and analog controlinterconnections to some controlled system, where a development board might by comparison have only a few or nodiscrete or analog input/output devices. The development board exists to showcase or to train on some particularprocessor family and this internal implementation is more important than the external function.

    Internal busThe bus of the early single-board devices, such as the Z80 and 6502, was universally a Von Neumann architecture.Program and data memory were accessed by the same shared bus, even though they were stored in fundamentallydifferent types of memory: ROM for programs and RAM for data. This bus architecture was needed to economise onthe number of pins needed from the limited 40 available for the processor's ubiquitous dual-in-line IC package.It was common to offer the internal bus through an expansion connector, or at least the space for such a connector tobe soldered on. This was a low-cost option and offered the potential for expansion, even if it was rarely made use of.Typical expansions would be I/O devices, or memory expansion. It was unusual to add peripheral devices such astape or disk storage, or even a CRT display

  • Single-board microcontroller 8

    When single-chip microcontrollers, such as the 8048, became available later on, the bus no longer needed to beexposed outside the package as all the necessary memory could be provided within the chip package. This generationof processors used a Harvard architecture of separate program and data buses, both internal to the chip. Many ofthese processors used a modified Harvard architecture, where some write access was possible to the program dataspace, thus permitting in-circuit programming. None of these processors required, or supported, a Harvard bus acrossa single-board microcontroller. Where they supported a bus for expansion of peripherals, this used a dedicated I/Obus, such as I2C, One-wire or various serial buses.

    External bus expansionSome microcontroller boards using a general-purpose microprocessor can bring the address and data bus of theprocessor to an expansion connector, allowing additional memory or peripherals to be added. This would provideresources not already present on the single board system. Since not all systems require expansion, the connector maybe an option, with a mounting position provided for the connector for installation by the user if desired.

    Input and output

    Arduino Diecimila with Atmel ATMEGA168

    Microcontroller systems provide multiple forms of input and outputsignals to allow application software to control an external"real-world" system. Discrete digital I/O provides a single bit of data(on, or off). Analog signals, representing a continuously variable rangesuch as temperature or pressure, can also be inputs and outputs formicrocontrollers.Discrete digital inputs and outputs might only be buffered from themicroprocessor data bus by an addressable latch, or might be operatedby a specialized input/output integrated circuit such as an Intel 8255 orMotorola 6821 parallel input/output adapter. Later single-chipmicrcontrollers have input and output pins available. The input/output circuits usually do not provide enough currentto directly operate such devices as lamps or motors, so solid-state relays are operated by the microcontroller digitaloutputs, and inputs are isolated by signal conditioning level-shifting and protection circuits.

    One or more analog inputs, with an analog multiplexer and common analog to digital converter, are found on somemicrocontroller boards. Analog outputs may use a digital-to-analog converter, or on some microcontrollers may becontrolled by pulse-width modulation. As for discrete inputs, external circuits may be required to scale inputs, or toprovide such functions as bridge excitation or cold junction compensation.To control component costs, many boards were designed with extra hardware interface circuits but the componentsfor these circuits weren't installed and the board was left bare. The circuit was only added as an option on delivery,or could be populated later.It is common practice for boards to include "prototyping areas", areas of the board already laid out as a solderablebreadboard area with the bus and power rails available, but without a defined circuit. Several controllers, particularlythose intended for training, also included a pluggable re-usable breadboard for easy prototyping of extra I/O circuitsthat could be changed or removed for later projects.

  • Single-board microcontroller 9

    Communications and user interfacesCommunications interfaces vary depending on the age of the microcontroller system. Early systems mightimplement a serial port to provide RS-232 or current loop. The serial port could be used by the application program,or could be used, in conjunction with a monitor ROM, to transfer programs into the microcontroller memory.Current microcontrollers may support USB, wireless network (Wi-Fi, ZigBee, or others) ports, or provide anEthernet connection, and may support a TCP/IP protocol stack. Some devices have firmware available to implementa Web server, allowing an application developer to rapidly build a Web-enabled instrument or system.

    ProgrammingMany of the earliest systems had no internal facility for programming at all, and relied on a separate "host" system.This programming was typically in assembly language, sometimes C or even PL/M, and then cross-assembled orcross-compiled on the host. Some single-board microcontrollers support a BASIC language system, allowingprograms to be developed on the target hardware. Hosted development allows all the storage and peripherals of adesktop computer to be used, providing a more powerful development environment.

    EPROM burningEarly microcontrollers relied on erasable programmable read-only memory (EPROM) devices to hold the applicationprogram. The completed object code from a host system would be "burned" onto an EPROM with an EPROMprogrammer, this EPROM was then physically plugged into the board. As the EPROM would be removed andreplaced many times during program development, it was usual to provide a ZIF socket to avoid wear or damage.Erasing an EPROM with a UV eraser takes a considerable time, and so it was also usual for a developer to haveseveral EPROMs in circulation at any one time.Some microcontroller devices were available with on-board EPROM; these, too, would be programmed in a separateburner, then put into a socket on the target system.The use of EPROM sockets allowed field update of the application program, either to fix errors or to provideupdated features.

    Keypad monitors

    A single-board computer with a hex keypad and7-segment display

    Where the single-board controller formed the entire developmentenvironment (typically in education) the board might also be providedwith a simple hexadecimal keypad, calculator-style LED display and a"monitor" program set permanently in ROM. This monitor allowedmachine code programs to be entered directly through the keyboardand held in RAM. These programs were in machine code, not even inassembly language, and were assembled by hand on paper first. It'sarguable as to which process was more time-consuming and errorprone: assembling by hand, or keying byte-by-byte.

    Single-board "keypad and calculator display" microcontrollers of thistype were very similar to some low-end microcomputers of the time,such as the KIM-1 or the Microprofessor I. Some of thesemicroprocessor "trainer" systems are still in production today, as a verylow-cost introduction to microprocessors at the hardware programminglevel.

  • Single-board microcontroller 10

    Hosted developmentWhen desktop personal computers appeared, initially CP/M or Apple II, then later the IBM PC and compatibles,there was a shift to hosted development. Hardware was now cheaper and RAM capacity had expanded such that itwas possible to download the program through the serial port and hold it in RAM. This massive reduction in thecycle time to test a new version of a program gave an equally large boost in development speed.This program memory was still volatile and would be lost if power was turned off. Flash memory was not yetavailable at a viable price. As a completed controller project usually required to be non-volatile, the final step in aproject was often to burn an EPROM again.

    Single-chip microcontrollers

    A 8048-family microcontroller with on-board UVEPROM, the 8749

    A development board for a PIC family device

    Single-chip microcontrollers such as the 8748 combined many of thefeatures of the previous boards into a single IC package. Single-chipmicrocontrollers integrate memory (both RAM and ROM) on-packageand so do not need to expose the data and address bus through the ICpackage's pins. These pins are then available for I/O lines. Thesechanges reduce the area required on a printed circuit board andsimplify the design of a single-board microcontroller. Examples ofsingle-chip microcontrollers include:

    8748 PIC Atmel AVR

    Program memory

    For production use as embedded systems, the on-board ROM would beeither mask programmed at the chip factory or one-time programmed(OTP) by the developer as a PROM. PROMs often used the same UVEPROM technology for the chip, but in a cheaper package without thetransparent erasure window. During program development it was stillnecessary to burn EPROMs, this time the entire controller IC, and so ZIF sockets would be provided.

    With the development of affordable EEPROM, EAROM and eventually flash memory, it became practical to attachthe controller permanently to the board and to download program code to it through a serial connection to a hostcomputer. This was termed "in-circuit programming". Erasure of old programs was carried out by either over-writingthem with a new download, or bulk erasing them electrically (for EEPROM) which was slower, but could be carriedout in-situ.

    The main function of the controller board was now to carry the support circuits for this serial interface, or USB onlater boards. As a further convenience feature during development, many boards also carried low-cost features likeLED monitors of the I/O lines or reset switches mounted on board.

  • Single-board microcontroller 11

    Single-board microcontrollers today

    Dwengo board

    Microcontrollers are now cheap and simple to design circuit boards for.Development host systems are also cheap, especially when using opensource software. Higher level programming languages abstract detailsof the hardware, making differences between specific processors lessobvious to the application programmer. Rewritable flash memory hasreplaced slow programming cycles, at least during programdevelopment. Accordingly almost all development now is based oncross-compilation from personal computers and download to thecontroller board through a serial-like interface, usually appearing to thehost as a USB device.

    The original market demand of a simplified board implementation isno longer so relevant to microcontrollers. Single-boardmicrocontrollers are still important, but have shifted their focus to: Easily accessible platforms aimed at traditionally "non-programmer" groups, such as artists, designers, hobbyists,

    and others interested in creating interactive objects or environments.[2] Some typical projects in 2011 included;the backup control of DMX stage lights and special effects, multi-camera control, autonomous fighting robots,controlling bluetooth projects from a computer or smart phone, LEDs and multiplexing, displays, audio, motors,mechanics, and power control.[3] These controllers may be embedded to form part of a physical computingproject. Popular choices for this work are the Arduino, Dwengo or the Wiring (development platform).[4]

    Technology demonstrator boards for innovative processors or peripheral features: AVR Butterfly Parallax Propeller

    References[1] http:/ / www. dvq. com/ docs/ intel_sbc_80_10. pdf Intel Single Board Computer datasheet, 1975[2] Arduino's home page (http:/ / www. arduino. cc/ )[3] Arduino User's forum (http:/ / arduino. cc/ forum/ )[4] Wiring.org's Wiring development platform home page (http:/ / wiring. org. co/ )

    External links Atmega8 Development board (http:/ / www. robotplatform. com/ howto/ dev_board/ atmega8_dev_board_1.

    html) - DIY AVR development board based on Atmel's AVR microcontroller

  • Atmel AVR 12

    Atmel AVR

    Atmel ATmega8 in 28-pin narrow DIP

    The AVR is a modified Harvard architecture 8-bit RISC single chipmicrocontroller which was developed by Atmel in 1996. The AVR wasone of the first microcontroller families to use on-chip flash memoryfor program storage, as opposed to one-time programmable ROM,EPROM, or EEPROM used by other microcontrollers at the time.

    Brief history

    The AVR architecture was conceived by two students at theNorwegian Institute of Technology (NTH) Alf-Egil Bogen Blog [1]

    (www.alfbogen.com) and Vegard Wollan.[2]

    The original AVR MCU was developed at a local ASIC house in Trondheim, Norway called Nordic VLSI at thetime, now Nordic Semiconductor, where Bogen and Wollan were working as students.[citation needed] It was known asa RISC (Micro RISC)[citation needed] and was available as silicon IP/building block from Nordic VLSI.[citation needed]

    When the technology was sold to Atmel from Nordic VLSI,[citation needed] the internal architecture was furtherdeveloped by Bogen and Wollan at Atmel Norway, a subsidiary of Atmel. The designers worked closely withcompiler writers at IAR Systems to ensure that the instruction set provided for more efficient compilation ofhigh-level languages. Atmel says that the name AVR is not an acronym and does not stand for anything in particular.The creators of the AVR give no definitive answer as to what the term "AVR" stands for. However, it is commonlyaccepted that AVR stands for Alf (Egil Bogen) and Vegard (Wollan)'s RISC processor.Note that the use of "AVR" in this article generally refers to the 8-bit RISC line of Atmel AVR Microcontrollers.Among the first of the AVR line was the AT90S8515, which in a 40-pin DIP package has the same pinout as an8051 microcontroller, including the external multiplexed address and data bus. The polarity of the RESET line wasopposite (8051's having an active-high RESET, while the AVR has an active-low RESET), but other than that, thepinout was identical.

    Device overviewThe AVR is a modified Harvard architecture machine where program and data are stored in separate physicalmemory systems that appear in different address spaces, but having the ability to read data items from programmemory using special instructions.

    Basic familiesAVRs are generally classified into six broad groups: tinyAVR the ATtiny series

    0.516kB program memory 632-pin package Limited peripheral set

    megaAVR the ATmega series 4512kB program memory 28100-pin package Extended instruction set (multiply instructions and instructions for handling larger program memories) Extensive peripheral set

  • Atmel AVR 13

    XMEGA the ATxmega series 16384kB program memory 4464100-pin package (A4, A3, A1) Extended performance features, such as DMA, "Event System", and cryptography support. Extensive peripheral set with ADCs

    Application-specific AVR megaAVRs with special features not found on the other members of the AVR family, such as LCD controller,

    USB controller, advanced PWM, CAN, etc. FPSLIC (AVR with FPGA)

    FPGA 5K to 40K gates SRAM for the AVR program code, unlike all other AVRs AVR core can run at up to 50MHz [3]

    32-bit AVRsIn 2006 Atmel released microcontrollers based on the new, 32-bit, AVR32 architecture. They include SIMDand DSP instructions, along with other audio and video processing features. This 32-bit family of devices isintended to compete with the ARM based processors. The instruction set is similar to other RISC cores, but itis not compatible with the original AVR or any of the various ARM cores.

    Device architectureFlash, EEPROM, and SRAM are all integrated onto a single chip, removing the need for external memory in mostapplications. Some devices have a parallel external bus option to allow adding additional data memory ormemory-mapped devices. Almost all devices (except the smallest TinyAVR chips) have serial interfaces, which canbe used to connect larger serial EEPROMs or flash chips.

    Program memory

    Program instructions are stored in non-volatile flash memory. Although the MCUs are 8-bit, each instruction takesone or two 16-bit words.The size of the program memory is usually indicated in the naming of the device itself (e.g., the ATmega64x line has64kB of flash while the ATmega32x line has 32kB).There is no provision for off-chip program memory; all code executed by the AVR core must reside in the on-chipflash. However, this limitation does not apply to the AT94 FPSLIC AVR/FPGA chips.

  • Atmel AVR 14

    Internal data memory

    The data address space consists of the register file, I/O registers, and SRAM.

    Internal registers

    Atmel ATxmega128A1 in 100-pin TQFPpackage

    The AVRs have 32 single-byte registers and are classified as 8-bitRISC devices.

    In most variants of the AVR architecture, the working registers aremapped in as the first 32 memory addresses (000016001F16) followedby the 64 I/O registers (002016005F16).

    Actual SRAM starts after these register sections (address 006016).(Note that the I/O register space may be larger on some more extensivedevices, in which case the memory mapped I/O registers will occupy aportion of the SRAM address space.)

    Even though there are separate addressing schemes and optimizedopcodes for register file and I/O register access, all can still beaddressed and manipulated as if they were in SRAM.In the XMEGA variant, the working register file is not mapped into the data address space; as such, it is not possibleto treat any of the XMEGA's working registers as though they were SRAM. Instead, the I/O registers are mappedinto the data address space starting at the very beginning of the address space. Additionally, the amount of dataaddress space dedicated to I/O registers has grown substantially to 4096 bytes (0000160FFF16). As with previousgenerations, however, the fast I/O manipulation instructions can only reach the first 64 I/O register locations (thefirst 32 locations for bitwise instructions). Following the I/O registers, the XMEGA series sets aside a 4096 byterange of the data address space which can be used optionally for mapping the internal EEPROM to the data addressspace (1000161FFF16). The actual SRAM is located after these ranges, starting at 200016.

    EEPROM

    Almost all AVR microcontrollers have internal EEPROM for semi-permanent data storage. Like flash memory,EEPROM can maintain its contents when electrical power is removed.In most variants of the AVR architecture, this internal EEPROM memory is not mapped into the MCU's addressablememory space. It can only be accessed the same way an external peripheral device is, using special pointer registersand read/write instructions which makes EEPROM access much slower than other internal RAM.However, some devices in the SecureAVR (AT90SC) family [4] use a special EEPROM mapping to the data orprogram memory depending on the configuration. The XMEGA family also allows the EEPROM to be mapped intothe data address space.Since the number of writes to EEPROM is not unlimited Atmel specifies 100,000 write cycles in their datasheets a well designed EEPROM write routine should compare the contents of an EEPROM address with desiredcontents and only perform an actual write if the contents need to be changed.Note that erase and write can be performed separately in many cases, byte-by-byte, which may also help prolong lifewhen bits only need to be set to all 1s (erase) or selectively cleared to 0s (write).

  • Atmel AVR 15

    Program executionAtmel's AVRs have a two stage, single level pipeline design. This means the next machine instruction is fetched asthe current one is executing. Most instructions take just one or two clock cycles, making AVRs relatively fast amongeight-bit microcontrollers.The AVR processors were designed with the efficient execution of compiled C code in mind and have severalbuilt-in pointers for the task.

    Instruction setThe AVR instruction set is more orthogonal than those of most eight-bit microcontrollers, in particular the 8051clones and PIC microcontrollers with which AVR competes today. However, it is not completely regular: Pointer registers X, Y, and Z have addressing capabilities that are different from each other. Register locations R0 to R15 have different addressing capabilities than register locations R16 to R31. I/O ports 0 to 31 have different addressing capabilities than I/O ports 32 to 63. CLR affects flags, while SER does not, even though they are complementary instructions. CLR set all bits to zero

    and SER sets them to one. (Note that CLR is pseudo-op for EOR R, R; and SER is short for LDI R,$FF. Mathoperations such as EOR modify flags while moves/loads/stores/branches such as LDI do not.)

    Accessing read-only data stored in the program memory (flash) requires special LPM instructions; the flash bus isotherwise reserved for instruction memory.

    Additionally, some chip-specific differences affect code generation. Code pointers (including return addresses on thestack) are two bytes long on chips with up to 128 kBytes of flash memory, but three bytes long on larger chips; notall chips have hardware multipliers; chips with over 8 kBytes of flash have branch and call instructions with longerranges; and so forth.The mostly regular instruction set makes programming it using C (or even Ada) compilers fairly straightforward.GCC has included AVR support for quite some time, and that support is widely used. In fact, Atmel solicited inputfrom major developers of compilers for small microcontrollers, to determine the instruction set features that weremost useful in a compiler for high-level languages.

    MCU speedThe AVR line can normally support clock speeds from 0 to 20MHz, with some devices reaching 32MHz. Lowerpowered operation usually requires a reduced clock speed. All recent (Tiny, Mega, and Xmega, but not 90S) AVRsfeature an on-chip oscillator, removing the need for external clocks or resonator circuitry. Some AVRs also have asystem clock prescaler that can divide down the system clock by up to 1024. This prescaler can be reconfigured bysoftware during run-time, allowing the clock speed to be optimized.Since all operations (excluding literals) on registers R0 - R31 are single cycle, the AVR can achieve up to 1 MIPSper MHz, i.e. an 8MHz processor can achieve up to 8 MIPS. Loads and stores to/from memory take two cycles,branching takes two cycles. Branches in the latest "3-byte PC" parts such as ATmega2560 are one cycle slower thanon previous devices.

  • Atmel AVR 16

    Development

    Atmel STK500 development board

    AVRs have a large following due to the free and inexpensivedevelopment tools available, including reasonably priced developmentboards and free development software. The AVRs are sold undervarious names that share the same basic core, but with differentperipheral and memory combinations. Compatibility between chips ineach family is fairly good, although I/O controller features may vary.See external links for sites relating to AVR development.

    FeaturesCurrentWikipedia:Manual of Style/Dates and numbers#Chronological items AVRs offer a wide range of features: Multifunction, bi-directional general-purpose I/O ports with configurable, built-in pull-up resistors Multiple internal oscillators, including RC oscillator without external parts Internal, self-programmable instruction flash memory up to 256kB (384kB on XMega)

    In-system programmable using serial/parallel low-voltage proprietary interfaces or JTAG Optional boot code section with independent lock bits for protection

    On-chip debugging (OCD) support through JTAG or debugWIRE on most devices The JTAG signals (TMS, TDI, TDO, and TCK) are multiplexed on GPIOs. These pins can be configured to

    function as JTAG or GPIO depending on the setting of a fuse bit, which can be programmed via ISP or HVSP.By default, AVRs with JTAG come with the JTAG interface enabled.

    debugWIRE uses the /RESET pin as a bi-directional communication channel to access on-chip debug circuitry.It is present on devices with lower pin counts, as it only requires one pin.

    Internal data EEPROM up to 4kB Internal SRAM up to 16kB (32kB on XMega) External 64kB little endian data space on certain models, including the Mega8515 and Mega162.

    The external data space is overlaid with the internal data space, such that the full 64kB address space does notappear on the external bus and accesses to e.g. address 010016 will access internal RAM, not the external bus.

    In certain members of the XMega series, the external data space has been enhanced to support both SRAM andSDRAM. As well, the data addressing modes have been expanded to allow up to 16MB of data memory to bedirectly addressed.

    AVRs generally do not support executing code from external memory. Some ASSPs using the AVR core dosupport external program memory.

    8-bit and 16-bit timers PWM output (some devices have an enhanced PWM peripheral which includes a dead-time generator) Input capture that record a time stamp triggered by a signal edge

    Analog comparator 10 or 12-bit A/D converters, with multiplex of up to 16 channels 12-bit D/A converters A variety of serial interfaces, including

    IC compatible Two-Wire Interface (TWI) Synchronous/asynchronous serial peripherals (UART/USART) (used with RS-232, RS-485, and more) Serial Peripheral Interface Bus (SPI) Universal Serial Interface (USI) for two or three-wire synchronous data transfer

  • Atmel AVR 17

    Brownout detection Watchdog timer (WDT) Multiple power-saving sleep modes Lighting and motor control (PWM-specific) controller models CAN controller support USB controller support

    Proper full-speed (12 Mbit/s) hardware & Hub controller with embedded AVR. Also freely available low-speed (1.5 Mbit/s) (HID) bitbanging software emulations

    Ethernet controller support LCD controller support Low-voltage devices operating down to 1.8V (to 0.7V for parts with built-in DCDC upconverter) picoPower devices DMA controllers and "event system" peripheral communication. Fast cryptography support for AES and DES

    Programming interfacesThere are many means to load program code into an AVR chip. The methods to program AVR chips varies fromAVR family to family.

    ISP

    6- and 10-pin ISP header diagrams

    The in-system programming (ISP) programming method isfunctionally performed through SPI, plus some twiddling of the Resetline. As long as the SPI pins of the AVR are not connected to anythingdisruptive, the AVR chip can stay soldered on a PCB whilereprogramming. All that is needed is a 6-pin connector andprogramming adapter. This is the most common way to develop withan AVR.

    The Atmel AVR ISP mkII device connects to a computer's USB portand performs in-system programming using Atmel's software.AVRDUDE (AVR Downloader/UploaDEr) runs on Linux, FreeBSD, Windows, and Mac OS X, and supports avariety of in-system programming hardware, including Atmel AVR ISP mkII, Atmel JTAG ICE, older Atmelserial-port based programmers, and various third-party and "do-it-yourself" programmers.

    PDIThe Program and Debug Interface (PDI) is an Atmel proprietary interface for external programming and on-chipdebugging of XMEGA devices. The PDI supports high-speed programming of all non-volatile memory (NVM)spaces; flash, EEPROM, fuses, lock-bits and the User Signature Row. This is done by accessing the XMEGA NVMcontroller through the PDI interface, and executing NVM controller commands. The PDI is a 2-pin interface usingthe Reset pin for clock input (PDI_CLK) and a dedicated data pin (PDI_DATA) for input and output.

  • Atmel AVR 18

    High voltage serialHigh-voltage serial programming (HVSP) is mostly the backup mode on smaller AVRs. An 8-pin AVR packagedoes not leave many unique signal combinations to place the AVR into a programming mode. A 12 volt signal,however, is something the AVR should only see during programming and never during normal operation.

    High voltage parallelHigh voltage parallel programming (HVPP) is considered the "final resort" and may be the only way to fix AVRchips with bad fuse settings.

    BootloaderMost AVR models can reserve a bootloader region, 256B to 4KB, where re-programming code can reside. At reset,the bootloader runs first, and does some user-programmed determination whether to re-program, or jump to the mainapplication. The code can re-program through any interface available, it could read an encrypted binary through anEthernet adapter like PXE. Atmel has application notes and code pertaining to many bus interfaces.

    ROMThe AT90SC series of AVRs are available with a factory mask-ROM rather than flash for program memory.Because of the large up-front cost and minimum order quantity, a mask-ROM is only cost-effective for highproduction runs.

    aWireaWire is a new one-wire debug interface available on the new UC3L AVR32 devices.

    Debugging interfacesThe AVR offers several options for debugging, mostly involving on-chip debugging while the chip is in the targetsystem.

    debugWIREdebugWIRETM is Atmel's solution for providing on-chip debug capabilities via a single microcontroller pin. It isparticularly useful for lower pin count parts which cannot provide the four "spare" pins needed for JTAG. TheJTAGICE mkII, mkIII and the AVR Dragon support debugWIRE. debugWIRE was developed after the originalJTAGICE release, and now clones support it.

    JTAGThe Joint Test Action Group (JTAG) feature provides access to on-chip debugging functionality while the chip isrunning in the target system. JTAG allows accessing internal memory and registers, setting breakpoints on code, andsingle-stepping execution to observe system behaviour.Atmel provides a series of JTAG adapters for the AVR:1.1. The JTAGICE 3 is the latest member of the JTAGICE family (JTAGICE mkIII). It supports JTAG, aWire, SPI,

    and PDI interfaces.2.2. The JTAGICE mkII replaces the JTAGICE and is similarly priced. The JTAGICE mkII interfaces to the PC via

    USB, and supports both JTAG and the newer debugWIRE interface. Numerous third-party clones of the AtmelJTAGICE mkII device started shipping after Atmel released the communication protocol.

  • Atmel AVR 19

    3.3. The AVR Dragon is a low-cost (approximately $50) substitute for the JTAGICE mkII for certain target parts. TheAVR Dragon provides in-system serial programming, high-voltage serial programming and parallelprogramming, as well as JTAG or debugWIRE emulation for parts with 32KB of program memory or less.ATMEL changed the debugging feature of AVR Dragon with the latest firmware of AVR Studio 4 - AVR Studio5 and now it supports devices over 32KB of program memory.

    4. The JTAGICE adapter interfaces to the PC via a standard serial port.[citation needed] Although the JTAGICEadapter has been declared "end-of-life" by Atmel, it is still supported in AVR Studio and other tools.

    JTAG can also be used to perform a boundary scan test,[5] which tests the electrical connections between AVRs andother boundary scan capable chips in a system. Boundary scan is well-suited for a production line, while the hobbyistis probably better off testing with a multimeter or oscilloscope.

    Development tools and evaluation kitsOfficial Atmel AVR development tools and evaluation kits contain a number of starter kits and debugging tools withsupport for most AVR devices:

    STK600 starter kitThe STK600 starter kit and development system is an update to the STK500. The STK600 uses a base board, asignal routing board, and a target board.The base board is similar to the STK500, in that it provides a power supply, clock, in-system programming, anRS-232 port and a CAN (Controller Area Network, an automotive standard) port via DE9 connectors, and stake pinsfor all of the GPIO signals from the target device.The target boards have ZIF sockets for DIP, SOIC, QFN, or QFP packages, depending on the board.The signal routing board sits between the base board and the target board, and routes the signals to the proper pin onthe device board. There are many different signal routing boards that could be used with a single target board,depending on what device is in the ZIF socket.The STK600 allows in-system programming from the PC via USB, leaving the RS-232 port available for the targetmicrocontroller. A 4 pin header on the STK600 labeled 'RS-232 spare' can connect any TTL level USART port onthe chip to an onboard MAX232 chip to translate the signals to RS-232 levels. The RS-232 signals are connected tothe RX, TX, CTS, and RTS pins on the DB-9 connector.

    STK500 starter kitThe STK500 starter kit and development system features ISP and high voltage programming (HVP) for all AVRdevices, either directly or through extension boards. The board is fitted with DIP sockets for all AVRs available inDIP packages.STK500 Expansion Modules: Several expansion modules are available for the STK500 board: STK501 - Adds support for microcontrollers in 64-pin TQFP packages. STK502 - Adds support for LCD AVRs in 64-pin TQFP packages. STK503 - Adds support for microcontrollers in 100-pin TQFP packages. STK504 - Adds support for LCD AVRs in 100-pin TQFP packages. STK505 - Adds support for 14 and 20-pin AVRs. STK520 - Adds support for 14 and 20, and 32-pin microcontrollers from the AT90PWM and ATmega family. STK524 - Adds support for the ATmega32M1/C1 32-pin CAN/LIN/Motor Control family. STK525 - Adds support for the AT90USB microcontrollers in 64-pin TQFP packages. STK526 - Adds support for the AT90USB microcontrollers in 32-pin TQFP packages

  • Atmel AVR 20

    STK200 starter kitThe STK200 starter kit and development system has a DIP socket that can host an AVR chip in a 40, 20, or 8-pinpackage. The board has a 4 MHz clock source, 8 light-emitting diodes, 8 input buttons, an RS-232 port, a socket fora 32k SRAM and numerous general I/O. The chip can be programmed with a dongle connected to the parallel-port.

    Supported microcontrollers (according to the manual)

    Chip Flash size EEPROM SRAM Frequency[MHz]

    Package

    AT90S1200 1k 64 0 12 PDIP-20

    AT90S2313 2k 128 128 10 PDIP-20

    AT90S/LS2323 2k 128 128 10 PDIP-8

    AT90S/LS2343 2k 128 128 10 PDIP-8

    AT90S4414 4k 256 256 8 PDIP-40

    AT90S/LS4434 4k 256 256 8 PDIP-40

    AT90S8515 8k 512 512 8 PDIP-40

    AT90S/LS8535 8k 512 512 8 PDIP-40

    AVR ISP and AVR ISP mkIIThe AVR ISP and AVR ISP mkII are inexpensive tools allowing all AVRs to be programmed via ICSP.The AVR ISP connects to a PC via a serial port and draws power from the target system. The AVR ISP allows usingeither of the "standard" ICSP pinouts, either the 10-pin or 6-pin connector. The AVR ISP has been discontinued,replaced by the AVR ISP mkII.The AVR ISP mkII connects to a PC via USB and draws power from USB. LEDs visible through the translucentcase indicate the state of target power.

    AVR Dragon

    AVR Dragon with ISP programming cable andattached, blue ZIF Socket.

    The Atmel Dragon is an inexpensive tool which connects to a PC viaUSB. The Dragon can program all AVRs via JTAG, HVP, PDI, orICSP. The Dragon also allows debugging of all AVRs via JTAG, PDI,or debugWire; a previous limitation to devices with 32kB or lessprogram memory has been removed in AVR Studio 4.18. The Dragonhas a small prototype area which can accommodate an 8, 28, or 40-pinAVR, including connections to power and programming pins. There isno area for any additional circuitry, although this can be provided by athird-party product called the "Dragon Rider".

    JTAGICE mkI

    The JTAG In Circuit Emulator (JTAGICE) debugging tool supports on-chip debugging (OCD) of AVRs with aJTAG interface. The original JTAGICE mkI uses an RS-232 interface to a PC and can only program AVR's with aJTAG interface. The JTAGICE mkI is no longer in production, however it has been replaced by the JTAGICE mkII.

  • Atmel AVR 21

    JTAGICE mkIIThe JTAGICE mkII debugging tool supports on-chip debugging (OCD) of AVRs with SPI, JTAG, PDI, anddebugWIRE interfaces. The debugWire interface enables debugging using only one pin (the Reset pin), allowingdebugging of applications running on low pin-count microcontrollers.The JTAGICE mkII connects using USB, but there is an alternate connection via a serial port, which requires using aseparate power supply. In addition to JTAG, the mkII supports ISP programming (using 6-pin or 10-pin adapters).Both the USB and serial links use a variant of the STK500 protocol.

    JTAGICE3The JTAGICE3 updates the mkII with more advanced debugging capabilities and faster programming. It connectsvia USB and supports the JTAG, aWire, SPI, and PDI interfaces.[6] The kit includes several adapters for use withmost interface pinouts.

    AVR ONE!The AVR ONE! is a professional development tool for all Atmel 8-bit and 32-bit AVR devices with On-Chip Debugcapability. It supports SPI, JTAG, PDI, and aWire programming modes and debugging using debugWIRE, JTAG,PDI, and aWire interfaces.[7]

    Butterfly demonstration board

    Atmel ATmega169 in 64-pad MLF package onthe back of an Atmel AVR Butterfly board

    The very popular AVR Butterfly demonstration board is aself-contained, battery-powered computer running the Atmel AVRATmega169V microcontroller. It was built to show-off the AVRfamily, especially a new built-in LCD interface. The board includes theLCD screen, joystick, speaker, serial port, real time clock (RTC), flashmemory chip, and both temperature and voltage sensors. Earlierversions of the AVR Butterfly also contained a CdS photoresistor; it isnot present on Butterfly boards produced after June 2006 to allowRoHS compliance.[8] The small board has a shirt pin on its back so itcan be worn as a name badge.

    The AVR Butterfly comes preloaded with software to demonstrate thecapabilities of the microcontroller. Factory firmware can scroll your name, display the sensor readings, and show thetime. The AVR Butterfly also has a piezoelectric transducer that can be used to reproduce sounds and music.The AVR Butterfly demonstrates LCD driving by running a 14-segment, six alpha-numeric character display.However, the LCD interface consumes many of the I/O pins.The Butterfly's ATmega169 CPU is capable of speeds up to 8MHz, but it is factory set by software to 2MHz topreserve the button battery life. A pre-installed bootloader program allows the board to be re-programmed via astandard RS-232 serial plug with new programs that users can write with the free Atmel IDE tools.

    AT90USBKeyThis small board, about half the size of a business card, is priced at slightly more than an AVR Butterfly. It includesan AT90USB1287 with USB On-The-Go (OTG) support, 16MB of DataFlash, LEDs, a small joystick, and atemperature sensor. The board includes software which lets it act as a USB mass storage device (its documentation isshipped on the DataFlash), a USB joystick, and more. To support the USB host capability, it must be operated from abattery, but when running as a USB peripheral, it only needs the power provided over USB.

  • Atmel AVR 22

    Only the JTAG port uses conventional 2.54mm pinout. All the other AVR I/O ports require more compact 1.27mmheaders.The AVR Dragon can both program and debug since the 32KB limitation was removed in AVR Studio 4.18, and theJTAGICE mkII is capable of both programming and debugging the processor. The processor can also beprogrammed through USB from a Windows or Linux host, using the USB "Device Firmware Update" protocols.Atmel ships proprietary (source code included but distribution restricted) example programs and a USB protocolstack with the device.LUFA is a third-party free software (MIT license) USB protocol stack for the USBKey and other 8-bit USB AVRs.

    Raven wireless kitThe RAVEN kit supports wireless development using Atmel's IEEE 802.15.4 chipsets, for ZigBee and other wirelessstacks. It resembles a pair of wireless more-powerful Butterfly cards, plus a wireless USBKey; and costing about thatmuch (under $US100). All these boards support JTAG-based development.The kit includes two AVR Raven boards, each with a 2.4GHz transceiver supporting IEEE 802.15.4 (and a freelylicensed ZigBee stack). The radios are driven with ATmega1284p processors, which are supported by a customsegmented LCD display driven by an ATmega3290p processor. Raven peripherals resemble the Butterfly: piezospeaker, DataFlash (bigger), external EEPROM, sensors, 32kHz crystal for RTC, and so on. These are intended foruse in developing remote sensor nodes, to control relays, or whatever is needed.The USB stick uses an AT90USB1287 for connections to a USB host and to the 2.4GHz wireless links. These areintended to monitor and control the remote nodes, relying on host power rather than local batteries.

    Third-party programmersA wide variety of third-party programming and debugging tools are available for the AVR. These devices usevarious interfaces, including RS-232, PC parallel port, and USB. AVR Freaks [9] has a comprehensive list.

    Atmel AVR usage

    Atmel AVR Atmega328 28-pin DIP on anArduino Duemilanove board

    AVRs have been used in various automotive applications such assecurity, safety, powertrain and entertainment systems. Atmel hasrecently launched a new publication "Atmel Automotive Compilation"to help developers with automotive applications. Some current usagesare in BMW, Daimler-Chrysler and TRW.The Arduino physical computing platform is based on an ATmega328microcontroller (ATmega168 or ATmega8 in board versions older thanthe Diecimila). The ATmega1280 and ATmega2560, with more pinoutand memory capabilities, have also been employed to develop theArduino Mega platform. Arduino boards can be used with its languageand IDE, or with more conventional programming environments (C,assembler, etc.) as just standardized and widely available AVR platforms.

    USB-based AVRs have been used in the Microsoft Xbox hand controllers. The link between the controllers andXbox is USB.

  • Atmel AVR 23

    Atmel AVR Atmega8 28-pin DIP on a customdevelopment board

    Numerous companies produce AVR-based microcontroller boardsintended for use by hobbyists, robot builders, experimenters and smallsystem developers including: Cubloc, gnusb, BasicX, Oak Micros, ZXMicrocontrollers, and myAVR. There is also a large community ofArduino-compatible boards supporting similar users.

    Schneider Electric produces the M3000 Motor and Motion ControlChip, incorporating an Atmel AVR Core and an advanced motioncontroller for use in a variety of motion applications.

    FPGA clonesWith the growing popularity of FPGAs among the open source community, people have started developing opensource processors compatible with the AVR instruction set. The OpenCores website lists the following major AVRclone projects: pAVR, written in VHDL, is aimed at creating the fastest and maximally featured AVR processor, by

    implementing techniques not found in the original AVR processor such as deeper pipelining. avr_core, written in VHDL, is a clone aimed at being as close as possible to the ATmega103. Navr written in Verilog, implements all Classic Core instructions and is aimed at high performance and low

    resource usage. It does not support interrupts.

    References[1] http:/ / www. alfbogen. com[2] Since 1996, NTH has become part of the Norwegian University of Science and Technology (NTNU)[3] Field Programmable System Level Integrated Circuit (http:/ / www. atmel. com/ products/ other/ field_programmable_gate_array/ default.

    aspx)[4] Atmel Smart Card ICs (http:/ / www. atmel. com/ images/ doc1010. pdf)[5] JTAGICE Press Release, 2004. (http:/ / atmel. com/ dyn/ corporate/ view_detail. asp?ref=& FileName=JTEGICE. html&

    SEC_NAME=product)[6] JTAGICE3 Product Page (http:/ / www. atmel. com/ tools/ JTAGICE3. aspx)[7] AVR ONE! Product Page (http:/ / www. atmel. com/ tools/ AVRONE_. aspx)[8] AVR Butterfly (http:/ / www. atmel. com/ dyn/ products/ tools_card. asp?tool_id=3146)[9] http:/ / www. avrfreaks. net/

  • Atmel AVR 24

    Further reading Embedded C Programming and the Atmel AVR; Richard H Barnett, Sarah Cox, Larry O'Cull; 560 pages; 2006;

    ISBN 978-1-4180-3959-2. C Programming for Microcontrollers Featuring ATMEL's AVR Butterfly and WinAVR Compiler; Joe Pardue; 300

    pages; 2005; ISBN 978-0-9766822-0-2. Atmel AVR Microcontroller Primer : Programming and Interfacing; Steven F Barrett, Daniel Pack, Mitchell

    Thornton; 194 pages; 2007; ISBN 978-1-59829-541-2. Arduino : A Quick Start Guide; Maik Schmidt; 276 pages; 2011; ISBN 978-1-934356-66-1.

    External linksPrimary Sources Atmel AVR homepage (http:/ / www. atmel. com/ products/ avr/ ) AVR-Libc homepage (http:/ / www. nongnu. org/ avr-libc/ ) AVR Freaks community (http:/ / www. avrfreaks. net/ ) Atmel AVR Serial Port Programmer (http:/ / microembeded. blogspot. com/ 2011/ 04/

    avr-serial-port-programmer. html) Arduino community (http:/ / www. arduino. cc/ ) Atmel AVR (http:/ / www. dmoz. org/ Computers/ Hardware/ Components/ Processors/ AVR/ / ) at the Open

    Directory Project, numerous AVR links Why you need a clock source for the AVR? (http:/ / www. avrfreaks. net/ index. php?module=FreaksArticles&

    func=downloadArticle& id=21) AVR Basics (http:/ / www. robotplatform. com/ knowledge/ AVR Basics/ avr_basics. html) - AVR guide for

    beginners Simplest AVR programmer Using LPT Port (http:/ / makecircuits. com/ blog/

    2009-03-23-simplest-atmega8-programmer-using-lpt-port. html) Atmega8 Breadboard Tutorial (http:/ / www. protostack. com/ blog/ 2009/ 07/

    atmega8-breadboard-circuit-part-2-of-3-the-microcontroller/ ) AVR DIP-Package Pinout Diagrams: ATtiny44/45/84/85 (http:/ / www. flickr. com/ photos/ 28521811@N04/

    8451023182/ sizes/ l/ in/ photostream/ ), ATmega328P (http:/ / www. pighixxx. com/ pgdev/ Temp/arduino_atmega328_Web. png), ATmega644P (http:/ / www. flickr. com/ photos/ 28521811@N04/ 8449933887/sizes/ l/ in/ photostream/ ), ATmega1284P (http:/ / www. flickr. com/ photos/ 28521811@N04/ 8451021230/sizes/ l/ in/ photostream/ )

    AVR TQFP-Package Pinout Diagrams: ATmega328 (http:/ / www. flickr. com/ photos/ 28521811@N04/8449935217/ sizes/ l/ in/ photostream/ ), ATmega2560 (http:/ / www. flickr. com/ photos/ 28521811@N04/8451021492/ sizes/ l/ in/ photostream/ ), ATmega32U4 (http:/ / www. flickr. com/ photos/ 28521811@N04/8467610175/ sizes/ l/ in/ photostream/ )

  • Atmel AVR instruction set 25

    Atmel AVR instruction setThe Atmel AVR instruction set is the machine language for the Atmel AVR, a modified Harvard architecture 8-bitRISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the firstmicrocontroller families to use on-chip flash memory for program storage.

    Processor registersThere are 32 general-purpose 8-bit registers, R0R31. All arithmetic operations operate on registers; only load andstore instructions access RAM.The general-purpose registers are mapped to the first 32 bytes of RAM. The next 64-bytes of RAM are used for anumber of special-purpose registers. This I/O space has special addressing capabilities, so addresses within it areoften written as "0x00 (0x20)" through "0x3F (0x5F)" to show both the 6-bit I/O space address and the general RAMaddress.Additional I/O registers may be located beginning at address 96, and general-purpose RAM begins after that.A limited number of instructions operate on register pairs. The higher-numbered register of the pair is the mostsignificant.The last six registers are used as register pairs for memory addressing. When paired, they are known as X(R27:R26), Y (R29:R28) and Z (R31:R30). Postincrement and predecrement addressing modes are supported on allthree. Y and Z also support a six-bit displacement.Some instructions, generally those which allow an eight-bit immediate value, are limited to registers R16R31. Afew (late additions to the instruction set) are limited to eight registers, R16 through R23.Additional special-purpose registers are: 16- or 22-bit program counter 8-bit status register (I/O register 0x3F (0x5F)) 16-bit stack pointer (I/O registers 0x3E:0x3D (0x5E:0x5D)) 8-bit EIND register (I/O register 0x3C (0x5C)), high bits of Z register for indirect branches 8-bit RAMPZ register (I/O register 0x3B (0x5B)), high bits of Z register for LPM instructionsExcept for the program counter, the processor special-purpose registers are also mapped to RAM, in the I/O space.The status register bits are:

    C Carry flag. This is a borrow flag on subtracts.2. Z Zero flag. Set to 1 when an arithmetic result is zero.3. N Negative flag. Set to a copy of the most significant bit of an arithmetic result.4. V Overflow flag. Set in case of two's complement overflow.5. S Sign flag. Unique to AVR, this is always NV, and shows the true sign of a comparison.6. H Half carry. This is an internal carry from additions and is used to support BCD arithmetic.7.7. T Bit copy. Special bit load and bit store instructions use this bit.8. I Interrupt flag. Set when interrupts are enabled.

  • Atmel AVR instruction set 26

    Instruction timingArithmetic operations work on registers R0-R31 but not directly on RAM and take one clock cycle, except formultiplication and word-wide addition (ADIW and SBIW) which take two cycles.RAM and I/O space can be accessed only by copying to or from registers. Indirect access (including optionalpostincrement, predecrement or constant displacement) is possible through registers X, Y, and Z. All accesses toRAM takes two clock cycles. Moving between registers and I/O is one cycle. Moving eight or sixteen bit databetween registers or constant to register is also one cycle. Reading program memory (LPM) takes three cycles.

    Instruction listInstructions are 16 bits long, with some instructions requiring an additional 16-bit word for a large displacement."K6" refers to a 6-bit unsigned constant.There are two types of conditional branches: jumps to address and skips. Conditional branches (BRxx) can test anALU flag and jump to specified address. Skips (SBxx) test an arbitrary bit in a register or I/O and skip the nextinstruction if the test was true.

    AVR instruction set

    Arithmetic Bit & Others Transfer Jump Branch Call

    ADD Rd, RrADC Rd, RrADIW Rd+1:Rd,K6SUB Rd, RrSUBI Rd, K8SBC Rd, RrSBCI Rd, K8SBIW Rd+1:Rd,K6INC RdDEC RdAND Rd, RrANDI Rd, K8OR Rd, RrORI Rd, K8EOR Rd, Rr

    COM RdNEG RdCP Rd, RrCPC Rd, RrCPI Rd, K8SWAP RdLSR RdROR RdASR Rd

    BSET sBCLR sSBI A, bCBI A, bBST Rd, bBLD Rd, bNOPBREAKSLEEPWDR

    MOV Rd, RrMOVW Rd+1:Rd,Rr+1:RrIN Rd, AOUT A, RrPUSH RrPOP RrLDI Rd, K8LDS Rd, K16LD Rd, XLD Rd, -XLD Rd, X+LDD Rd, Y+K6LD Rd, -YLD Rd, Y+LDD Rd, Z+K6LD Rd, -ZLD Rd, Z+STS K16, RrST X, RrST -X, RrST X+, RrSTD Y+K6, RrST -Y, RrST Y+, RrSTD Z+K6, RrST -Z, RrST Z+, RrLPMLPM Rd, ZLPM Rd, Z+

    RJMPK12IJMPEIJMPJMP K22

    CPSE Rd,RrSBRC Rr, bSBRS Rr, bSBIC A, bSBIS A, bBRBC s, K7BRBS s, K7

    RCALLK12ICALLEICALLCALL K22RETRETI

  • Atmel AVR instruction set 27

    MUL Rd, RrMULS Rd, RrMULSU Rd, RrFMUL Rd, RrFMULS Rd, RrFMULSU Rd, Rr

    ELPMELPM Rd, ZELPM Rd, Z+SPM

    Instruction set inheritanceNot all instructions are implemented in all Atmel AVR controllers. This is the case of the instructions performingmultiplications, extended loads/jumps/calls, long jumps, and power control.

    Family Members Arithmetic Branches Transfers Bit-Wise

    Minimal Core AT90S1200ATtiny11ATtiny12ATtiny15ATtiny28

    ADDADCSUBSUBISBCSBCIANDANDIORORIEORCOMNEGSBRCBRINCDECTSTCLRSER

    RJMPRCALLRETRETICPSECPCPCCPISBRCSBRSSBICSBISBRBSBRBCBREQBRNEBRCSBRCCBRSHBRLOBRMIBRPLBRGEBRLTBRHSBRHCBRTSBRTCBRVSBRVC

    LDSTMOVLDIINOUTLPM (not in AT90S1200)

    SBICBILSLLSRROLRORASRSWAPBSETBCLRBSTBLDSECCLCSENCLNSEZCLZSEICLISESCLSSEVCLVSETCLTSEHCLHNOPSLEEP

    BRIEBRID

    WDR

  • Atmel AVR instruction set 28

    Classic Core upto 8K ProgramSpace

    AT90S2313AT90S2323ATtiny22AT90S2333AT90S2343AT90S4414AT90S4433AT90S4434AT90S8515AT90C8534AT90S8535ATtiny26

    new instructions:ADIWSBIW

    new instructions:IJMPICALL

    new instructions:LD (now 9 modes)LDDLDSST (9 modes)STDSTSPUSHPOP

    (nothing new)

    Classic Corewith up to 128K

    ATmega103ATmega603AT43USB320AT76C711

    (nothing new) new instructions:JMPCALL

    new instructions:ELPM

    (nothing new)

    Enhanced Corewith up to 8K

    ATmega8ATmega83ATmega85ATmega8515

    new instructions:MULMULSMULSUFMULFMULSFMULSU

    (nothing new) new instructions:MOVWLPM (3 modes)SPM

    (nothing new)

    Enhanced Corewith up to 128K

    ATmega16ATmega161ATmega163ATmega32ATmega323ATmega64ATmega128AT43USB355AT94(FPSLIC)AT90CANseriesAT90PWMseriesATmega48ATmega88ATmega168ATmega162ATtiny13ATtiny25ATtiny45ATtiny85ATtiny2313ATmega164ATmega324ATmega328ATmega644ATmega165ATmega169ATmega325ATmega3250ATmega645ATmega6450

    (nothing new) (nothing new) (nothing new) new instructions:BREAK

    ATmega406

  • Atmel AVR instruction set 29

    Enhanced Corewith up to 4M

    ATmega640ATmega1280ATmega1281ATmega2560ATmega2561

    (nothing new) new instructions:EIJMPEICALL

    (nothing new) (nothing new)

    XMEGA core ATxmegaseries

    new instructions:DES

    (nothing new) new instructions:(from second revisionsilicon - AU,B,C parts)XCHLASLACLAT

    (nothing new)

    Reduced Core ATtiny10ATtiny9ATtiny5ATtiny4

    (Identical to minimalcore, except for reducedCPU register set)

    (Identical to classic corewith up to 8K, except forreduced CPU register set)

    Identical to classic corewith up to 8K, with thefollowing exceptions:LPM (removed)LDD (removed)STD (removed)LD (also accessesprogram memory)LDS (different bitpattern)STS (different bit pattern)Reduced CPU register set

    (Identical to enhanced corewith up to 128K, except forreduced CPU register set)

    Instruction encodingBit assignments: rrrrr = Source register rrrr = Source register pair ddddd = Destination register dddd = Destination register pair hhhh = High register, R16R31 pp = Register pair, W, X, Y or Z y = Y/Z register pair bit (0=Z, 1=Y) s = Store/load bit (0=load, 1=store) c = Call/jump (0=jump, 1=call) aaaaaa = I/O space address aaaaa = I/O space address (first 32 only) bbb = Bit number B = Bit value kkkkkk = 6-bit unsigned constant KKKKKKKK = 8-bit constantThe Atmel AVR uses many split fields, where bits are not contiguous in the instruction word. The load/store withoffset instructions are the most extreme example where a 6-bit offset is broken into three pieces.

  • Atmel AVR instruction set 30

    Atmel AVR instruction set overview

    15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Instruction

    0 0 0 0 0 0 0 1 d d d d r r r r MOVW Move register pair

    0 0 0 0 0 0 1 d d d r r r Signed and fractional multiply (R16R23 only)

    0 0 0 0 0 1 r d d d d d r r r r 2-operand instructionsCPC, SBC, ADD, CPSE, CP,SUB. ADC, AND, EOR, OR, MOV0 0 0 0 1

    0 0 0 1

    0 0 1 0

    0 0 1 1 K K K K h h h h K K K K Register-immediate instructionsCPI, SBCI, SUBI, ORI, ANDI

    0 1

    1 0 k 0 k k s d d d d d y k k k LDD/STD to Z+k or Y+k

    1 0 0 1 0 0 s d d d d d LD/ST other

    1 0 0 1 0 1 0 d d d d d 0 1-operand instructions (COM, NEG, SWAP, etc.)

    1 0 0 1 0 1 0 0 B b b b 1 0 0 0 SEx/CLx Status register clear/set bit

    1 0 0 1 0 1 0 1 1 0 0 0 Misc instructions (RET, RETI, SLEEP, etc.)

    1 0 0 1 0 1 0 c 0 0 0 1 0 0 1 Indirect jump/call to Z or EIND:Z

    1 0 0 1 0 1 0 d d d d d 1 0 1 0 DEC Rd

    1 0 0 1 0 1 0 0 k k k k 1 0 1 1 DES round k

    1 0 0 1 0 1 0 k k k k k 1 1 c k JMP/CALL abs22

    1 0 0 1 0 1 1 k k p p k k k k ADIW/SBIW Rp,uimm6

    1 0 0 1 1 0 B a a a a a b b b I/O space bit operations

    1 0 0 1 1 1 r d d d d d r r r r MUL, unsigned: R1:R0 = RrRd

    1 0 k 0 k k s d d d d d y k k k See 10k0 above

    1 0 1 1 s a a d d d d d a a a a OUT/IN to I/O space

    1 1 0 c 12 bit signed offset Relative jump/call to PC 2simm12

    1 1 1 0 K K K K h h h h K K K K LDI Rh,K

    1 1 1 1 0 B 7-bit signed offset b b b Conditional branch on status register bit

    1 1 1 1 1 0 s d d d d d 0 b b b BLD/BST register bit to STATUS.T

    1 1 1 1 1 1 B d d d d d 0 b b b SBRC/SBRS skip if register bit equals B

    External links GNU Development Environment [1]

    Programming the AVR microcontroller with GCC [2] by Guido Socher A GNU Development Environment for the AVR Microcontroller [1] by Rich Neswold AVR Options [3] in GCC-AVR

    Atmel AVR instruction set PDF(155 pages) [4]

  • Atmel AVR instruction set 31

    References[1] http:/ / users. rcn. com/ rneswold/ avr/[2] http:/ / www. linuxfocus. org/ English/ November2004/ article352. shtml[3] http:/ / gcc. gnu. org/ onlinedocs/ gcc-3. 3. 5/ gcc/ AVR-Options. html[4] http:/ / www. atmel. com/ dyn/ resources/ prod_documents/ DOC0856. PDF

    Orthogonal instruction setIn computer engineering, an orthogonal instruction set is an instruction set architecture where all instruction typescan use all addressing modes. It is "orthogonal" in the sense that the instruction type and the addressing mode varyindependently. An orthogonal instruction set does not impose a limitation that requires a certain instruction to use aspecific register.

    Orthogonality in practiceIn many CISC computers, an instruction could access either registers or memory, usually in several different ways.This made the CISC machines easier to program, because rather than being required to remember thousands ofindividual instruction opcodes, an orthogonal instruction set allowed a programmer to instead remember just thirty toa hundred operation codes ("ADD", "SUBTRACT", "MULTIPLY", "DIVIDE", etc.) and a set of three to tenaddressing modes ("FROM REGISTER 0", "FROM REGISTER 1", "FROM MEMORY", etc.). The DEC PDP-11and Motorola 68000 computer architectures are examples of nearly orthogonal instruction sets, while the ARM11and VAX are examples of CPUs with fully orthogonal instruction sets.

    The PDP-11With the exception of its floating point instructions, the PDP-11 was very strongly orthogonal. Every integerinstruction could operate on either 1-byte or 2-byte integers and could access data stored in registers, stored as partof the instruction, stored in memory, or stored in memory and pointed to by addresses in registers. Even the PC andthe stack pointer could be affected by the ordinary instructions using all of the ordinary data modes. In fact,"immediate" mode (hardcoded numbers within an instruction, such as ADD #4, R1 (R1 = R1 + 4) was implementedas the mode "register indirect, autoincrement" and specifying the program counter (R7) as the register to usereference for indirection and to autoincrement.Since the PDP-11 was an octal-oriented (3-bit sub-byte) machine (addressing modes 0 - 7, registers R0 - R7), therewere (electronically) 8 addressing modes. Through the use of the Stack Pointer (R6) and Program Counter (R7) asreferenceable registers, there were 10 conceptual addressing modes available.

    The VAX-11The VAX-11 extended the PDP-11's orthogonality to all data types, including floating point numbers (althoughinstructions such as 'ADD' was divided into data-size dependent variants such as ADDB, ADDW, ADDL, ADDP,ADDF for add byte, word, longword, packed BCD and single-precision floating point, respectively). Like thePDP-11, the Stack Pointer and Program Counter were in the general register file (R14 and R15).The general form of a VAX 11 instruction would be:opcode [ operand ] [ operand ] ...Each component being one byte, the opcode a value in the range 0 - 255, and each operand consisting of two nibbles,the upper 4 bits specifying an addressing mode, and the lower 4 bits (usually) specifying a register number (R0 -R15).

  • Orthogonal instruction set 32

    Unlike the octal-oriented PDP-11, the VAX-11 was a hexadecimal-oriented machine (4-bit sub-byte). This resultedin 16 logical addressing modes (0-15), however, addressing modes 0-3 were "short immediate" for immediate data of6 bits or less (the 2 low-order bits of the addressing mode being the 2 high-order bits of the immediate data, whenprepended to the remaining 4 bits in that data-addressing byte). Since addressing modes 0-3 were identical, this made13 (electronic) addressing modes, but as in the PDP-11, the use of the Stack Pointer (R14) and Program Counter(R15) created a total of over 15 conceptual addressing modes (with the assembler program translating the sourcecode into the actual stack-pointer or program-counter based addressing mode needed).

    The MC68000Motorola's designers attempted to make the assembly language orthogonal while the underlying machine languagewas somewhat less so. Unlike PDP-11, the MC68000 used separate registers to store data and the addresses of datain memory.At the bit level, the person writing the assembler (or debugging machine code) would clearly see that symbolicinstructions could become any of several different op-codes. This compromise gave almost the same convenience asa truly orthogonal machine, and yet also gave the CPU designers freedom to use the bits in the instructions moreefficiently than a purely orthogonal approach might have.

    The 8080 and follow on designsThe 8-bit Intel 8080 (as well as the 8085 and 8051) microprocessor was basically a slightly extendedaccumulator-based design and therefore not orthogonal. An assembly-language programmer or compiler writer hadto be mindful of which operations were possible on each register: Most 8-bit operations could be performed only onthe 8-bit accumulator (the A-register), while 16-bit operations could be performed only on the 16-bitpointer/accumulator (the HL-register pair), whereas simple operations, such as increment, were possible on all seven8-bit registers. This was largely due to a desire to keep all opcodes one byte long and to maintain source codecompatibility with the original Intel 8008 (an LSI-implementation of the Datapoint 2200's CPU).The binary-compatible Z80 later added prefix-codes to escape from this 1-byte limit and allow for a more powerfulinstruction set. The same basic idea was employed for the Intel 8086, although, to allow for more radical extensions,binary-compatibility with the 8080 was not attempted here; instead the 8086 was designed as a more regular andfully 16-bit processor that was source-compatible with the 8008, 8080, and 8085. It maintained some degree ofnon-orthogonality for the sake of high code density (even though this was derided as being "baroque" by somecomputer scientists at the time). The 32-bit extension of this architecture that was introduced with the 80386, wassomewhat more orthogonal despite keeping all the 8086 instructions and their extended counterparts. However, theencoding-strategy used still shows many traces from the 8008 and 8080 (and Z80); for instance, single-byteencodings remain for certain frequent operations such as push and pop of registers and constants, and the primaryaccumulator, eax, employ shorter encodings than the other registers on certain types of operations; observations likethis are sometimes exploited for code optimization in both compilers and hand written code.

  • Orthogonal instruction set 33

    Into the RISC ageA fully orthogonal architecture may not be the most "bit efficient" architecture. In the late 1970s research at IBM(and similar projects elsewhere) demonstrated that the majority of these "orthogonal" addressing modes were ignoredby most programs. Perhaps some of the bits that were used to express the fully orthogonal instruction set couldinstead be used to express more virtual address bits or select from among more registers.In the RISC age, computer designers strove to achieve a balance that they thought better. In particular, most RISCcomputers, while still being highly orthogonal with regard to which instructions can process which data types, nowhave reverted to "load/store" architectures. In these architectures, only a very few memory reference instructions canaccess main memory and only for the purpose of loading data into registers or storing register data back into mainmemory; only a few addressing modes may be available, and these modes may vary depending on whether theinstruction refers to data or involves a transfer of control (jump). Conversely, data must be in registers before it canbe operated upon by the other instructions in the computer's instruction set. This trade off is made explicitly toenable the use of much larger register sets, extended virtual addresses, and longer immediate data (data storeddirectly within the computer instruction).

    References

    Open-source hardware

    The OSHW (Open Source Hardware) logosilkscreened on an unpopulated PCB

    Open-source hardware consists of physical artifacts of technologydesigned and offered by the open design movement. Both free andopen-source software (FOSS) as well as open-source hardware iscreated by this open-source culture movement and applies a likeconcept to a variety of components. The term usually means thatinformation about the hardware is easily discerned. Hardware design(i.e. mechanical drawings, schematics, bills of material, PCB layoutdata, HDL source code and integrated circuit layout data), in additionto the software that drives the hardware, are all released with the FOSSapproach.

    Since the rise of reconfigurable programmable logic devices, sharingof logic designs has been a form of open-source hardware. Instead of the schematics, hardware description language(HDL) code is shared. HDL descriptions are commonly used to set up system-on-a-chip systems either infield-programmable gate arrays (FPGA) or directly in application-specific integrated circuit (ASIC) designs. HDLmodules, when distributed, are called semiconductor intellectual property cores, or IP cores.

  • Open-source hardware 34

    Licenses

    The RepRap general-purpose 3D printer with theability to make copies of most of its own

    structural parts

    Rather than creating a new license, some open-source hardwareprojects simply use existing, free and open-source software licenses.[1]

    Additionally, several new licenses have been proposed. These licensesare designed to address issues specific to hardware designs.[2] In theselicenses, many of the fundamental principles expressed in open-sourcesoftware (OSS) licenses have been "ported" to their counterparthardware projects. Organizations tend to rally around a shared license.For example, Opencores prefers the LGPL or a Modified BSDLicense,[3] FreeCores insists on the GPL,[4] Open HardwareFoundation promotes "copyleft" or other permissive licenses",[5] theOpen Graphics Project uses a variety of licenses, including the MITlicense, GPL, and a proprietary license,[6] and the Balloon Projectwrote their own license.[7] New hardware licenses are often explained as the "hardware equivalent" of a well-knownOSS license, such as the GPL, LGPL, or BSD license.

    Despite superficial similarities to software licenses, most hardware licenses are fundamentally different: by nature,they typically rely more heavily on patent law than on copyright law. Whereas a copyright license may control thedistribution of the source code or design documents, a patent license may control the use and manufacturing of thephysical device built from the design documents. This distinction is explicitly mentioned in the preamble of theTAPR Open Hardware License:

    "... those who benefit from an OHL design may not bring lawsuits claiming that design infringes their patentsor other intellectual property."TAPR Open Hardware License,[8]

    Noteworthy licenses include: The TAPR Open Hardware License: drafted by attorney John Ackermann, reviewed by OSS community leaders

    Bruce Perens and Eric S. Raymond, and discussed by hundreds of volunteers in an open community discussion[9]

    Balloon Open Hardware License: used by all projects in the Balloon Project Although originally a software license, OpenCores encourages the LGPL Hardware Design Public License: written by Graham Seaman, admin. of Opencollector.org In March 2011 CERN released the CERN Open Hardware License (OHL) intended for use with the Open

    Hardware Repository[10] and other projects. The Solderpad License is a version of the Apache License version 2.0, amended by lawyer Andrew Katz to render

    it more appropriate for hardware use.

  • Open-source hardware 35

    Development

    The Arduino Diecimila

    Extensive discussion has taken place on ways to make open-sourcehardware as accessible as open-source software. Discussions focus onmultiple areas,[11] such as the level at which open-source hardware isdefined,[12] ways to collaborate in hardware development, as well as amodel for sustainable development by making open-source appropriatetechnology.[13][14] In addition there has been considerable work toproduce open-source hardware for scientific hardware using acombination of open-source electronics and 3-D printing.[15]

    One of the major differences between developing open-source softwareand developing open-source hardware is that hardware results intangible outputs, which cost money to prototype and manufacture. As a result, the phrase "free as in speech, not as inbeer",[16] more formally known as Gratis versus Libre, distinguishes between the idea of zero cost and the freedomto use and modify information. While open-source hardware faces challenges in minimizing cost and reducingfinancial risks for individual project developers, some community members have proposed models to address theseneeds.[17] Given this, there are initiatives to develop sustainable community funding mechanisms, such as the OpenSource Hardware Central Bank,[18] as well as tools like KiCad to make schematic development more accessible tomore users.

    Often vendors of chips and other electronic components will sponsor contests with the proviso that the participantsand winners must share their designs. Circuit Cellar magazine organizes some of these contests.

    Open source labsExamples of open source labs include: Boston Open Source Science Laboratory, Somerville, Massachusetts BYU Open Source Lab, Brigham Young University OSU Open Source Lab, Oregon State University Open Source Research Lab, University of Texas at El Paso Stanford Open Source Lab, Stanford University

    Business modelsOpen hardware companies are experimenting with different business models. Arduino, for example, has registeredtheir name as a trademark. Others may manufacture their designs, but they can't put the Arduino name on them. Thusthey can distinguish their products from others by appellation.[19] There are many applicable business models forimplementing some open-source hardware even in traditional firms. For example, to accelerate development andtechnical innovation the photovoltaic industry has experimented with partnerships, franchises, secondary supplierand completely open-source models.[20]

  • Open-source hardware 36

    References[1] From OpenCollector's "License Zone" (http:/ / opencollector. org/ hardlicense/ licenses. html): GPL used by Free Model Foundry and ESA

    Sparc; other licenses used by Free-IP Project, LART (defunct), GNUBook (defunct).[2] For a nearly comprehensive list of licenses, see OpenCollector's "license zone" (http:/ / opencollector. org/ hardlicense/ licenses. html)[3] Item "What license is used for OpenCores?" (http:/ / opencores. org/ opencores,faq#whatlicense), from Opencores.org FAQ, retrieved 14

    January 2013[4] FreeCores Main Page (http:/ / www. freecores. org/ wiki/ Main_Page), retrieved 25 November 2008[5] Open Hardware Foundation, main page (http:/ / www. linuxfund. org/ projects/ ogd1/ ), retrieved 25 November 2008[6] See "Are we going to get the 'source' for what is on the FPGA also?" in the Open Graphics Project FAQ (http:/ / wiki. opengraphics. org/

    tiki-index. php?page=FrequentlyAskedQuestions), retrieved 25 November 2008[7] Balloon License (http:/ / balloonboard. org/ licence. html), from balloonboard.org[8] TAPR Open Hardware License (http:/ / www. tapr. org/ ohl. html)[9] transcript of all comments (http:/ / technocrat. net/ d/ 2007/ 2/ 5/ 14355), hosted on technocrat.net[10] Open Hardware Repository (http:/ / www. ohwr. org/ )[11] (http:/ / www. opencollector. org/ Whyfree/ ), Writings on Open Source Hardware[12] (http:/ / blog. makezine. com/ archive/ 2007/ 04/ open_source_hardware_what. html) MAKE: Blog: Open source hardware, what is it?

    Here's a start...[13] (http:/ / www. halfbakery. com/ idea/ Open_20Source_20Hardware_20Initiative), Halfbakery: Open Source Hardware Initiative[14] J. M Pearce, C. Morris Blair, K. J. Laciak, R. Andrews, A. Nosrat and I. Zelenika-Zovko, "3-D Printing of Open Source Appropriate

    Technologies for Self-Directed Sustainable Development", Journal of Sustainable Development 3(4), pp. 17-29 (2010) (http:/ / www. ccsenet.org/ journal/ index. php/ jsd/ article/ view/ 6984)

    [15] Pearce, Joshua M. 2012. " Building Research Equipment with Free, Open-Source Hardware. (http:/ / www. sciencemag. org/ content/ 337/6100/ 1303. summary)"