Arduino an Explanation – AVR @ Heart

I have been asked again and again by my friends and students to use Arduino or not and some people who are using AVR asked me if Arduino is better and some who were using Arduino asked the same about AVR. Well, here it goes, [this is all that I know, haven’t researched or confirm any of this while writing it – this became a bit longer than I had initially thought].

To understand what is Arduino, lets see how AVR works. To use AVR, usually the following is done in order.

  • Install ATMEL Studio on your PC if you dont have it.
  • Make a new project, select the AVR you like.
  • Write the CODE in the source file, standard C/C++ code works. If you want to use something special like LCDs or UART or something, proper Libraries make work easier otherwise that too can be one by using C code and referring to the datasheet.
  • Build/Compile/Make whatever, get the HEX file (look in the DEBUG folder).
  • Upload/Burn/Flash that Hex File to the AVR using a Programmer (a separate Hardware device – USBasp is the BEST).
  • Once the AVR is programmed with the HEX file, it needs to be on a circuit with power supply, reset circuitry, oscillator and any other component etc required by your project. Usually it is a Development Board, or an AVR on a breadboard or maybe a project PCB which has everything on it including a programming port (ICSP/ISP Connector).
  • It should WORK!

Hoping that you did everything above correctly from writing proper code to having the right controller IC to a working programmer and a working/tested circuit with your AVR IC in it and you should see your code working.

Usually mistakes happen in making that AVR circuit or the programmer doesn’t work or the connections from the programmer to the AVR are loose/broken, resulting in frustration and waste of time, usually new comers at this point think of leaving the AVR world and moving on.

This is where ARDUINO comes, Arduino is basically a prefabricated PCB aka circuit board with

  • an AVR Micro-controller (ATMega8/328/2560 etc) on it +
  • Power Supply circuitry +
  • Programmer Support (allows programming) +
  • Pins provided in easy to use connectors and numbered from 0 to 13 and A0 to A5 (talking about Uno here)
  • an easy to use Software ARDUINO IDE
  • easy to use code/language – basically it is just C/C++ functions, more about Arduino language here
  • One button/click program UPLOAD/test

So an Arduino looks very easy for any beginner to use, but KNOW that it has the same AVR micro-controller and the IDE supports C/C++ completely and you can still use any and all AVR registers directly, but that might break some of the Arduino functions.

So anyone using AVRs, I would suggest STICK with it and learn it properly unless you are stuck in a situation where you dont have the time to learn AVR now, then move to Arduino, do your task and then come back to AVR and learn it. [here I mean the ATMega series in general]

Those using Arduinos, it is OKAY to use it at any and all levels including and beyond B.E. anyone who says this is kid stuff does not know that it is the same AVR as any other – it is upto the programmer to write powerful code for it.

As For myself, I use Arduinos to prototype faster, this includes using Arduino hardware and shields and the Arduino IDE/code – however after basic prototyping I move my projects to custom made AVR boards, sometimes with the same arduino code and sometimes I optimize the code properly and either rewrite it completely in Atmel Studio using the standard C/C++ and my own custom libraries or mix my code with the Arduino code.







One response to “Arduino an Explanation – AVR @ Heart”

  1. ameeen Avatar

    Kerdia comment, acha likha he masha Allah. Allah ilm men berkat de…

comment bhi kar hi dain.. :P

This site uses Akismet to reduce spam. Learn how your comment data is processed.