This is an old revision of the document!
AVR est une série de micro-contrôleurs 8-bits RISC fabriqués par Atmel. Les micro-contrôleurs AVR suivent une architecture Harcard et par conséquent sépare le programme de la mémorisation des données. Le programme est stocké en interne grâce à la mémoire flash, les données sont stockées dans une mémoire physique (SRAM) et mémoire EEPROM. La fréquence du contrôleur est habituellement au dessus de 16 MHz et les performances dépassent le 1 MIPS par cycles de 1-megahertz.
La production de microcontrôleurs AVR a commencé en 1997 et à ce jour AVR est un des contrôleurs les plus populaire avec des ingénieurs électroniques indépendants. Grâce aux outils de développement bon marché, la diversité de périphériques dans un package simple et une consommation électrique basse est devenue le succès initial. Aujourd'hui, il y a une autre raison de choisir AVR : la quantité massive d'informations et de classes de travaux dirigés créées au cours des dernières années. La technologie AVR vieillit inévitablement, mais reste compétitive, Atmel fait aussi des nouveaux microcontrôleurs AVR avec des périphériques plus à jour et des bus de 16- et 32 bits, d'abord dont ceux de la série XMEGA compatible 8-bits et le dernier de la toute nouvelle série AVR32.
Basé sur le type de la demande(l'application), il y a plusieurs types de microcontrôleurs AVR, chacun avec une configuration différente. La plupart de l'AVRS appartient à la série megaAVR, qui a une grande mémoire(souvenir) de programme. Pour équilibrer la série megaAVR, il y a aussi la série tinyAVR, qui a des paquets plus petits et moins de caractéristiques(fonctions). En plus de ceux-là, il y a aussi la série différente de microcontrôleurs conçus spécifiquement pour contrôler USB, PEUT, à cristaux liquides, ZigBee, l'automatique, allumant(éclairant) et des dispositifs à piles. Based on the type of the application, there are several types of AVR microcontrollers, each with a different configuration. Most of the AVRs belong to the megaAVR series, which have a large program memory. To balance the megaAVR series, there is also the tinyAVR series, which have smaller packages and less features. In addition to those, there are also different series of microcontrollers designed specifically for controlling USB, CAN, LCD, ZigBee, automatics, lighting and battery-powered devices.
The following text describes the main features of megaAVR series microcontrollers, using one of the most popular controllers in this series, ATmega128 as an example. This controller is also in the HomeLab kit. Generally, all the AVR series microcontrollers' register names, meanings and usage is reglemented in a way which able the examples also to be used with other controllers by making only slight changes. The main differences are in the peripherals. The code samples of this introduction are written in assembler and C, using AVR LibC.
Like all other controllers, the AVR is also packaged in some standard shell. The traditional casing is DIP (also called DIL). DIP is a so-called casing on legs - all the pins extrude as legs, about 5 mm in length, from the black plastic casing. DIP casing is a sensible choice for hobby applications and prototypes, because there are cheap sockets available for it, so the microcontroller can easily be replaced, should it happen to malfunction or die. The legs are also the down-side of the DIP casing, because it requires holes to be drilled in the circuit board.
The surface mount casings (SMT, also called SMD) are much more compact, because their pins are designed to be soldered straight to the board without the need to penetrate it. SMT microchips are in thin, coin-sized rectangular casings with pins about 1 mm long. A more precise hand and better tools are required for soldering SMT chips.
AVRs are available in both DIP and SMT casings. The layout of the pins is designed as logical and electrically even as possible. For example, on larger chips, the ground and supply pins are located on several sides of the microcontroller, the pins for an external oscillator are near the ground pin, the bus pins are in numerical order, the communication pins are next to each other etc. AVRs digital pins are compatible with TTL/CMOS standard voltage levels. At 5 V supply voltage, 0 to 1 V means logical zero, which is also called zero, null, 0, low, ground, or GND. At the same supply voltage, 3 to 5.5 V means logical one, also called one, 1, high. This type of wide voltage ranges only apply to the inputs - the output voltage on a pin with no load is still 0 V or near supply voltage, depending on the state of the pin. The allowed analog voltage level on the ADC channels is 0 to 5.5 V.
To better understand the following examples on ATmega128, there is a pinout schematic of ATmega128 (SMT package) below. Next to each pin, is a text with its number, primary function and secondary (alternate) function in brackets. Supply pins are GND and VCC. AVCC and AREF are analog-to-digital converter's supply and reference voltage pins. XTAL1 and XTAL2 are for connecting an external crystal oscillator, resonator or clock generator. Pins PB0 to PG4 mark the bits of input-output buses. The secondary functions of pins are discussed in the corresponding chapters.