Content deleted Content added
→GPIO ports: expand heading |
m Undid revision 1305031493 by Bender the Bot (talk) bot error fixed |
||
(16 intermediate revisions by 7 users not shown) | |||
Line 1:
{{Short description|Family of microcontrollers}}
{{About|the series of AVR microcontrollers|the AVR instruction set|Atmel AVR instruction set}}
{{Confuse|automatic voltage regulator}}
[[File:Avr_logo.svg|right|thumb|AVR logo]]
Line 17 ⟶ 18:
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.<ref name="storyofavr" /> However, it is commonly accepted that AVR stands for '''A'''lf and '''V'''egard's '''R'''ISC processor.<ref>{{cite web|title=UNSW School of Computer Science and Engineering - General AVR Info|url=http://www.cse.unsw.edu.au/~pcb/avr/avr.html|url-status=dead|archive-url=https://web.archive.org/web/20120623131604/http://www.cse.unsw.edu.au/~pcb/avr/avr.html|archive-date=2012-06-23|access-date=2012-09-19|publisher=Cse.unsw.edu.au}}</ref> Note that the use of "AVR" in this article generally refers to the 8-bit RISC line of Atmel AVR microcontrollers.
The original AVR MCU was developed at a local [[Application-specific integrated circuit|ASIC]]
Among the first of the AVR line was the AT90S8515, which in a 40-pin DIP package has the same pinout as an [[Intel 8051|8051]] microcontroller, including the external multiplexed address and data bus. The polarity of the <span style="text-decoration: overline">RESET</span> line was opposite (8051's having an active-high RESET, while the AVR has an active-low <span style="text-decoration: overline">RESET</span>), but other than that the pinout was identical.
Line 188 ⟶ 189:
* PIN''x'': Input register, used to read an input signal. On some devices, this register can be used for pin toggling: writing a logic one to a PIN''x'' bit toggles the corresponding bit in PORT''x'', irrespective of the setting of the DDR''x'' bit.<ref>[http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf atmel.com]</ref>
Newer ATtiny
xmegaAVR have additional registers for push/pull, totem-pole and pullup configurations.
Line 201 ⟶ 202:
=== Program execution ===
Atmel's AVRs have a two-stage, single-level [[Pipeline (computing)|pipeline]] design
The AVR processors were designed with the efficient execution of [[Compiler|compiled]] [[C (programming language)|C]] code in mind and have several built-in pointers for the task.
Line 207 ⟶ 208:
=== Instruction set ===
{{Main|Atmel AVR instruction set}}
The [[Atmel AVR instruction set|AVR instruction set]] is more [[Orthogonal instruction set|orthogonal]] than those of most eight-bit microcontrollers, in particular the [[Intel 8051|8051 clones]] and [[PIC microcontroller]]s with which AVR
* [[Pointer register]]s X, Y, and Z have addressing capabilities that are different from each other.
Line 215 ⟶ 216:
* Accessing read-only data stored in the program memory (flash) requires special LPM instructions; the flash bus is otherwise reserved for instruction memory.
The mostly regular instruction set makes C (and even Ada) compilers fairly straightforward and efficient. [[GNU Compiler Collection|GCC]] has included AVR support for quite some time, and that support is widely used. [[LLVM]] also has rudimentary AVR support. In fact, Atmel solicited input from major developers of compilers for small microcontrollers, to determine the instruction set features that were most useful in a compiler for high-level languages.<ref name="codesign" />
Line 226 ⟶ 227:
=== Development ===
AVRs have a large following due to the free and inexpensive development tools available, including reasonably priced development boards and free development software. The AVRs are sold under various names that share the same basic core, but with different peripheral and memory combinations. Compatibility between chips in each family is fairly good, although I/O controller features may vary.
The Atmel AVR GNU C/C++ [[cross compiler]], "avr-gcc" and "avr-g++", is used in both WinAVR and Atmel Studio.<ref>
Microchip.
[https://www.microchip.com/en-us/tools-resources/develop/microchip-studio/gcc-compilers "Toolchains for AVR Microcontrollers (MCUs)"].
</ref><ref>
Timothy S Margush.
"Some Assembly Required: Assembly Language Programming with the AVR Microcontroller".
2016.
[https://www.google.com/books/edition/Some_Assembly_Required/n5E3EQAAQBAJ?gbpv=1&pg=PA539 "Chapter 14: Programming the AVR in C"].
p. 539
</ref><ref>
J. M. Hughes.
[https://www.google.com/books/edition/Arduino_A_Technical_Reference/7oMpDAAAQBAJ "Arduino: A Technical Reference"].
2016.
p. 127-131.
</ref><ref>
Joe Pardue.
[https://www.google.com/books/edition/C_Programming_for_Microcontrollers/jAzuNAAACAAJ "C Programming for Microcontrollers: Featuring ATMEL's AVR Butterfly and the Free WinAVR Compiler"].
2005.
</ref><ref>
Elliot Williams.
[https://www.google.com/books/edition/AVR_Programming/y7C2AgAAQBAJ "AVR Programming"].
2014.
</ref>
The Arduino team borrowed from WinAVR for the Windows version of the [[Arduino Software|Arduino software]].<ref>
Dale Wheat.
[https://www.google.com/books/edition/Arduino_Internals/U6EtJwBzY1oC "Arduino Internals"].
2011.
p. 227.
</ref>
See [[#External links|external links]] for sites relating to AVR development.
Line 238 ⟶ 269:
** 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 [[General Purpose Input/Output|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 [[in-system programming]] (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 4 KB
Line 290 ⟶ 321:
=== High-voltage serial ===
High-voltage serial programming (HVSP)<ref>{{cite web|url=http://support.atmel.no/knowledgebase/avrstudiohelp/mergedProjects/AVRDragon/AVRDragon_HVSP_Description.htm|title=HVSP_Description|publisher=Support.atmel.no|url-status=dead|archive-url=https://web.archive.org/web/20091012094540/http://support.atmel.no/knowledgebase/avrstudiohelp/mergedProjects/AVRDragon/AVRDragon_HVSP_Description.htm|archive-date=2009-10-12|access-date=2012-09-19}}</ref> is mostly the backup mode on smaller AVRs. An 8-pin AVR package does 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. The high voltage mode can also be used in some devices where the reset pin
=== High-voltage parallel ===
Line 299 ⟶ 330:
=== ROM ===
The AT90SC series of AVRs are available with a factory mask-ROM
=== aWire ===
Line 310 ⟶ 341:
=== debugWIRE ===
{{Main|debugWIRE}}
[[debugWIRE]] is Atmel's solution for providing on-chip debug capabilities via a single microcontroller pin. It is
=== JTAG ===
Line 462 ⟶ 493:
=== JTAGICE ===
The [[JTAG]] In Circuit Emulator (JTAGICE) debugging tool supports on-chip debugging (OCD) of AVRs with a JTAG interface. The original JTAGICE (sometimes retroactively referred to as JTAGICE mkI) uses an RS-232 interface to a PC and can only program
=== JTAGICE mkII ===
Line 515 ⟶ 546:
USB-based AVRs have been used in the Microsoft Xbox hand controllers. The link between the controllers and Xbox is USB.
Numerous companies produce AVR-based microcontroller boards intended for use by hobbyists, robot builders, experimenters and small system developers including: Cubloc,<ref>{{cite web|url=http://www.cubloc.com/|title=Comfile Technology|publisher=Comfile Technology, Inc.|access-date=13 January 2013|archive-date=17 January 2013|archive-url=https://web.archive.org/web/20130117112843/http://www.cubloc.com/|url-status=dead}}</ref> gnusb,<ref>{{cite web|url=
[[Schneider Electric]] used to produce the M3000 Motor and Motion Control Chip, incorporating an Atmel AVR Core and an advanced motion controller for use in a variety of motion applications but this has been discontinued.<ref>{{cite web|url=http://www.imshome.com/products/m3000.html|title=M3000 Motion controller on a chip|work=imshome.com|publisher=Schneider Electric Motion USA|url-status=dead|archive-url=https://web.archive.org/web/20091202120117/http://www.imshome.com/products/m3000.html|archive-date=2009-12-02|access-date=2011-08-02}}</ref>
|