Learn Programming of AVR Microcontroller

So far we have seen, what microcontroller means? And what they are capable of? But now question is how you do get microcontroller to do something and answer is by programming. So let’s learn programming of AVR Microcontroller and understand nuts and bolts of the process. There are couples of things user need to do for getting microcontroller programmed,

  • Set up your computer for programming either on Windows or Linux (Install necessary compiler and flash tool)
  • Write program that tells chip what to do?
  • Compile program into machine code
  • Program the chip using programmer hardware, which transfers machine code into microcontroller
  • Test and Debug

AVR microcontroller has large number of fan followers due to free and inexpensive development tools available including reasonably priced development board and free development tools. In next part we will learn about software’s (Compiler) and Hardware (Programmer) and how one can make use of them to develop microcontroller based application. I recommend you please stick to article and follow in sequence to get better understanding about process.

Programming of AVR Microcontroller
Programming of AVR Microcontroller

Programming Tools

AVR microcontrollers are powerful enough to support high level programming language such as C efficiently. To write program in C for AVR or any other microcontroller we need a C compiler for that particular MCU. There are several c compiler which support AVR MCUs and in fact most of them are free for students and beginners. Those are listed below,

  • Atmel Studio 6
  • Eclipse
  • AVR-GCC  (GNU) Linux
  • WinAVR
  • AVRDude

You could choose any IDE from list to write your programs. Here in our tutorial we will be looking at Atmel Studio 6. Please follow video which will demonstrate you how to install and set up environment to start writing your first program.

AVR USB Programmer
AVR USB Programmer

A piece of hardware connected to the computer that programs AVR microcontroller is called AVR Programmer. Once you have done with writing & compiling your software application in AVR C. You need to load this output file which is hex file into microcontroller and that’s the role of programmer. There are several types of programmer available in market for example: AVR USB Programmer (USBasp), AVR Pocket Programmer (USB Tiny ISP), AVR ISP mkII, AVR ISP mkIII…..etc etc and so on…

If you are one like me then you might be interested In USBasp firmware based AVR USB Programmer which is open source and even you could make your own if you want.

Please follow the video provided down below which will walk you through all details about procedure to make things work.

I hope you will find this post educational and entertaining. In next tutorials, we will look at ready to go example with respect to each peripheral of ATmega32A Microcontroller.

About Umesh Lokhande

3 comments

  1. Hi
    Iam a beginer in micocontroller programming and iam very happy from the explanation in this wedsite iam trying o make the first program but after compiling and using miniPero 866 programmer still the microcontroller Atemega32a not working

    Thanks
    Alsadig

    • Thanks Alsadig for nice words concerning website. To be very honest, I haven’t had opportunity yet to work with miniPero 866 programmer. I am sorry to put any of my opinion in this regards.

      I wish you good luck with your project

  2. Rucha Deshmukh

    Hi! from where do I get the programmer module and power supply module, are they available in the market? If yes from where do I get them?

Leave a Reply

Your email address will not be published. Required fields are marked *

Login

Register | Lost your password?