First of all, I'm a newbie regarding electronics&robotics so please bear with me.

I have been working as a programmer for a few years but I just got interested in playing with microcontrollers.

Can anyone recommend a book/tutorial for building a development board based on ATMEGA16-16PI .

As of yesterday I own a breadboard and a atmega16 microcontroller.

Where do I go from here?


  • \$\begingroup\$ Wow! Same case here, except I got me an ATMega 162. \$\endgroup\$ – AndrejaKo Feb 3 '11 at 10:27

I wanted to do something with microcontrollers for some time now, but it wasn't until yesterday that I collected enough courage to actually buy one.

Since you said that you're absolute beginner, here are some very basic pointers.

First site you may want to visit it Atmel's website for the microcontroller you have. Here it is. There, you'll need to visit the documentation section and get the 2 datasheets. You should read the summary and take a look at the datasheet. While you can read the whole datasheet, I think it may be better to just keep it as a reference. You might want to download AVR Instruction Set and keep it as a reference too, but to me at least, it looks more interesting to assembly fans and compiler writers.

By now you should have an idea of what the device you have is capable of. Next step would be to set up the needed toolchain. On the site I linked, go to tools section and look under design software. There you'll find a link to AVR Studio 4, which is one of the available programming environments. Some of the other IDEs are WinAVR, IAR Embedded Workbench for AVR(non-free, but there's a program size limited demo), ImageCraft, CodeVisionAVR, CrossWorks for AVR.

For a beginner, AVR Studio and WinAVR seem to be the easiest to obtain.

After that, you can start programming. There's a simulator in AVR Studio, so you can try out and debug programs before you burn them on the controller.

Next step which needs to be overcome is how to get program from your computer to the microcontroller. On the tools page, you'll find a list of officially blessed development boards and programmers and debuggers. Problem with them is that they are usually too expensive for a beginner. On the other hand, they should work without any problems and there's a lot of documentation on how to use them.

If you want to save some money, but suffer potential headaches, you can get one of the many alternative programmers. Just search for AVR programmer and you'll get countless results. Unfortuantley, I can't recommend you any specific programmer, since I'm looking for one too.

The other option is to build one yourself. There are countless schematics available for AVR programmers and many of them can be very cheap to make. On the other hand, there's the problem with finding specific parts (some programmers need Russian transistors, which are now difficult to obtain and then you'll have to look for compatible replacements and so on) and that you have to build it yourself. Still, building a programmer yourself can be a good learning experience.

After you have a programmer, you'll need a circuit which can power up the controller and provide the basics. You should know by now that AVRs run on 5 volts, so that's what you'll need. There are lots and lots of examples on the Internet for basic boards, so again search. Some sites with programmer schematics will have most basic target boards too. For most basic system, you'll need a 5 V source and that's pretty much it, as ATMega 16 has its own clock source. If you can't make a basic board, feel free to ask for specific instruction.

Next step is to make a basic program which will do something. For microcontrollers, hello world programs are a bit more complicated and are a good project for a bit more advanced users. Instead, the most basic program will turn on an LED. After that comes flashing LED and after that button controlled LED and so on. Circuits for such project are very simple. In addition to the most basic AVR board, you may only need one resistor and LED. I think that ATMega 16 can source enough current to power a LED, but I'm not 100% sure. You can always check the datasheet. If you're feeling a bit more advanced, you could make a circuit which will use a transistor to control the LED.

In the end, here are some interesting links for beginners:

http://www.avrfreaks.net/ They have a nice forum and they have a list of projects which could be interesting.

Here are several interesting tutorials:

Another interesting thing worth mentioning is Arduino. It's an electronics prototyping platform which is based on AVR microcontrollers. The plus side of them seems to be that you'll be able to skip the background stuff, such as getting a programmer, getting a basic board for the microcontroller and so on. There's an IDE for Arduinos and a simple programming language too. The minus side of them is that you'll be able to skip the background stuff, such as getting a programmer, getting a basic board for the microcontroller and so on. There’s also the problem with the fact that there's an IDE for Arduinos and a simple programming language too.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.