Wednesday, February 23, 2011

KICK START TO GROW WITH AVR

Selecting a Microcontroller

There are two family of microcontroller that are extremely popular among hobbyist. The “PIC” series from Microchip and “AVR” series from Atmel. Both these chips are wonder of modern microelectronics. PIC had ruled for a long time but now AVR is also getting in serious competition.

>>Speed and ease of use.

I prefer AVRs because one major reason. They are fast. When a PIC and an AVR is running with same frequency lets say 12 MHz, then the AVR is actually executing four times faster than the PIC ! Yes 4 times faster. This is because the PIC requires 4 cycle to perform a single execute cycle while the AVR execute most of the instruction in 1 clock cycle. In addition, I like the AVR architecture because of its consistency. It makes using the most advanced feature of AVR very easy to use. These chips are easily available and they are cheap.

>>Free “C” compiler.

One more important thing, generally microcontroller programs are written in assembly language for efficiency. Which you may know is a very low level and unstructured language. Therefore, to achieve a small thing lots of code need to be written and the programmer cannot concentrate on program logic. This makes the things harder. However, mid to high end AVR mcus are powerful enough to support high level language such as C efficiently. To write programs in ‘c’ for AVR or any other microcontroller we need a c compiler for that MCU. Generally these compilers are priced so high that they are out of reach of hobbyist and small company. But fortunately for AVR mcus there is a very high quality ‘c’ compiler for free. It is GNU C compiler. It is extremely popular and it has a large user base. It is part of the free and open source software revolution that we are witnessing (like Linux, PHP, Apache, OpenOffice.org etc). Providing excellent software at no cost. They are the dedicated work of programmers around the globe.

Therefore, the tools you need are  
Hardware
  • A PC running Winxp or Better.
  • An In-System programmer (ISP): This is the device which connects your mcu to your PC .You can easily make a serial or parallel port programmer. You can also make a USB programmer (little complicated).
  • A Target Board: It is nothing but your project which has an ISP header so that programmer can be connected and detached easily. In most simple case, it has a MCU with its power supply, a few basic connections, and ISP header(Port which is used for programming).
  • Last but not the least an AVR MCU.
Software
 Install these softwares and write ur first embedded program................HAVE A GOOD DAY