Introduction: Beginner's Guide - AVR Programming

Picture of 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

Picture of Build the Circuit

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

Step 3: Download the Code

Picture of 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:

#include

int main(void)
{
    DDRD = 0xff;
    while(1)
    {
        PORTD = 0b11100110;
    }
}

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

Step 4: Result

Picture of 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.

Comments

HarishN (author)2014-02-01

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

hoodkicks (author)2011-11-06

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

Marsh (author)2010-02-04

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.
 

cl97 (author)Marsh2010-02-04

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.

abell5 (author)cl972011-05-22

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?

tcase (author)cl972010-04-23

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...

Marsh (author)cl972010-02-04

I look forward to the updated version.

artstuck (author)2010-02-06

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

About This Instructable

46,755views

68favorites

License:

More by cl97:Beginner's Guide - AVR Programming
Add instructable to: