AVR Microcontrollers


     What are microcontrollers? Their name suggests what they are. Nowadays, they can be found in almost any complex electronic device - from portable music devices to home appliances to cars. They are programmable, cheap, small, can handle abuse, require almost zero power, and there are so many varieties to suit every need. This is what makes them so useful for robotics - they are like tiny affordable computers that you can put right onto your robot.
     A microcontroller has a CPU (microprocessor) in addition to a fixed amount of RAM, ROM, I/O ports, and a timer all on a single chip. In Other words, the processor, RAM, ROM, I/O ports and timers are all embedded together in one chip; therefore, the designer cannot add external memory, I/O, or timer to it. The fixed amount of on-chip ROM, RAM, and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical.

     There are five major 8-bit microcontrollers. They are: Freescale Semiconductor’s (formerly Motorola) 68HC08/68HC11, Intel’s 8051, Atmel’s AVR, Zilog’s Z8, and PIC from Microchip Technology. Each of the above microcontrollers has a unique instruction set; therefore, they are not compatible with each other. Programs written on one will not run on the others.

     The AVR is an 8-bit RISC single-chip microcontroller with Harvard architecture that comes with standard features such as on-chip program (code) ROM, data RAM, data EEPROM, timers and I/O ports. See Figure below.  Most AVRs have some additional features like ADC, PWM, and different kinds of serial interface such as USART, SPI, I2C (TWI), CAN, USB, and so on.
     The basic architecture of AVR was designed by two students of Norwegian Institute of Technology (NTH), Alf-Egil Bogen and Vegard Wollan, and then was bought and developed by Atmel in 1996. You may ask what AVR stands for; AVR can have different meanings for different people! Atmel says that is nothing more than a product name, but it might stand for Advanced Virtual RISC, or Alf and Vegard Risc (the names of the AVR designers).

     There are many kinds of AVR microcontroller with different properties. Except for AVR32, which is a 32-bit microcontroller, AVRs are all 8-bit microprocessors, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. One of the problems with AVR microcontrollers is that they are not all 100% compatible in terms of software when going from one family to another family. To run programs written for the ATtiny25 on a ATmega64, the program must be recompiled and possibly change some register locations before loading it into the ATmega64.


     Good with AVR is that it is open-source. Open in the sense that all details of a project are published and made public. Furthermore, most authors implicitly allows anyone to copy, modify, and sell for profit an open sourced project without having to pay anything in return.

     The idea was originally conceived for software codes only. But hardware designers saw a lot of good things happening with open sourcing, hence quickly followed suit. Some might argue that this model will likely result in inferior products, mainly due to the absence of a strong motivator – monetary reward. But skeptics were proven wrong in countless of instances. Projects that attracted the attention of large group of hobbyists became so successful, and have quality that rivals, if are not better than, those of commercially developed products. These projects are tested and improved by huge numbers of volunteers freely giving their time making suggestions and contributions. The now phenomenally popular Arduino prototyping platform makes a very good example.
_______________________________________________________________________
     Arduino was built by Massimo Banzi when his students complained that existing commercial microcontroller boards (at that time) were too expensive for their robot projects, not to mention they are a pain to program. Teaming with two other Italian geeks, Gianluca Martino, and David Cuartielles, they build the atmel AVR based programmable microcontroller platform with a matching IDE that made programming much easier.
_______________________________________________________________________
     The Gizduino board is based on the Arduino Duemilanove ATMega168 variant with some notable difference. Most noticeable is the extended pin connectors that allow the board to be mated with shields not just on top side of the board, but under it as well. You can permanently cut off the extended pins if you don’t find them useful or desirable. Cutting them off may present some mounting inconvenience with a number of shields being developed by e-Gizmo (e.g. Mobot Controller).

     Gizduino also uses a USB chip different that of the Arduino. A PL2303 chip is used instead of the FDTI chip used by the original Arduino hardware. This difference will be apparent only during the installations of device drivers, and is generally invisible to the user during actual usage.


Sources:
The AVR Microcontroller and Embedded System using Assembly and C
              by:Muhammad Ali Mazidi et. al.



Leave a Reply