Beginner's Guide - AVR Programming




You will get this done in 30 min.


Step 1: Parts

1. 1 X  any type of circuit board
2. 1 X Atmel AVR Atmega16 microcontroller
3. 8 X 330 ohms Resistors
4. 8 X LEDs
5. 1 X AVR Programmer (just use for download the code, i used a STK500)

Step 2: Build the Circuit

It's very simple, just follow the diagram that i attached.

Step 3: Download the Code

Now you can download the code. I am using the AVR Studio to download the code. You may copy and past this code to AVR studio:


int main(void)
    DDRD = 0xff;
        PORTD = 0b11100110;

or you can download the teset1.hex that i already build.

Step 4: Result

You will see the result from the LEDs.
8 LEDs represent 8 bits: 11100110 (light up=1, off=0)

Step 5: Make the LEDs Flashing

It will be a  easy. You will only need to write a loop for it. The only thing you need to concern is the frequency, because our eyes may not see the light flashing in micro seconds.

This is my first write up, if any thing is not right please let me know.
Thank you very much.



    • Fandom Contest

      Fandom Contest
    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Classroom Science Contest

      Classroom Science Contest

    8 Discussions


    5 years ago on Introduction

    What does that header 6 mean. Are they pins from serial port(DB9 connector).


    7 years ago on Step 3

    Took me a while but i finally got it thanks. Your the Man!


    9 years ago on Step 5

    You've made a wide range of assumptions about the knowlege and skill level of the people viewing this. I wouldn't say you did anything wrong, but you certainly left out many details that would be helpful to the beginner.
    For instance, you said: "It's very simple, just follow the diagram that i attached." How would somone identify pin 1 of the chip? How does one know which way to connect the LEDs? These are things a beginner may or may not know. Most likely not.
    Then you say to download the code and paste it in to AVR studio. Then what? How does one write a loop for it? How does one get the code from the PC to the circuit?
    Its a good start, but if the purpose is to "instruct", this needs a lot more detail. A whole lot more. Take a step back and imagine that you know nothing about any of this.

    4 replies

    Reply 9 years ago on Step 5

    hi, thanks for pointing it out. i will update it when i have some extra time. i think i assume too much when i was writing this guide. what you said is right, people may not even know how to count the pins on the chip.
    Thank you very much again. i will try my best to provide more details for every steps.


    Reply 8 years ago on Step 5

    Thankyou for pointing this out.

    Quite simply, I am an electronics n00b.

    I took one look at that image and my jaw dropped off. I do suppose some beginners need a little knowledge, but could you lay it out in laymans terms?


    Reply 9 years ago on Introduction

    Actually, I agree, now, Im not sure about anyone else, but for me, learning the diagrams, and the symbols for each items is the hardest to understand... Unless I had been working with it for a very long time, I know I could build this, but I wouldnt understand what each symbol would mean,, or is that the learning process of doing it over, and over, and over, and over?

    I would love to learn more electronics... really bad.... I would also like to build and electric Riding lawn mower, and build a charging station in my garage...
    Thanks for the instructable...


    9 years ago on Introduction

    nice guide.. i think i'll start to learn about it. :) thanks