3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Ghetto Programming: Getting started with AVR microprocessors on the cheap.

Step 9Program the Chip

Linux:
1) Get in the LED_Demo directory.
2) Cross your fingers.
3) Type "make"

Windows:
1) Open up LED_Demo.c with Programmer's Notepad.
2) Cross your fingers.
3) Select "Tools...Make Program"

Both:

Watch the log as the text goes scrolling by. There are two things you're looking out for here.

One is if the program compiled sucessfully. If there are no errors, it did. If it didn't, why? Did you mess around with my code?

Two is if the chip programmed sucessfully. For this, it writes the code in, then verifies the chip's memory. It should say "Contents Verified." If it says something about the parallel port or "giveio.sys", did you enable the parallel port back a couple steps ago?



Success? Yay! There's nothing like the sweet smell of blinking LED's in the morning.

« Previous StepDownload PDFView All StepsNext Step »
16 comments
Jun 11, 2011. 3:07 PMjld1 says:
I've downloaded the WinAVR just to try to play with C/C++. I don't have any uC right now but I plan to. I wrote a simple program using Programer's Notepad in C. I can't seem to compile the program? Please advise.

thanks
Joseph
Aug 17, 2010. 1:18 AMFunnymonk says:
Hello I think I've followed all of your instructions to the letter but there is no Make prgram button in tools for me. How do I fix this?
Aug 30, 2009. 7:16 AMgodofal says:
okay, i dont get it. i used your program, downloaded winAVR, loaded everything, put in the attiny13 chip, connected everything right, re-wrote the program for attiny13 (changing output ports) but it gives the error > Failed to create process: the system cannot find the given file. the last part is translated since im running the program in dutch... what is going on? and what can i do about it?
Aug 16, 2009. 12:20 AMjammil29 says:
thankyou for your instructable.
Jun 12, 2009. 8:01 PManmo says:
I have a no rule to make target program .stop What am I doing wrong ?
Nov 19, 2008. 11:45 PMluisnperez says:
Frustration! doesn't work , message:
*** No rule to make target `LED_Demo.o'. Stop
The programminf needs more detail, specially you mentioned to modify the txt file, but what line?
In windows there is no "Tools...Make Program"

Nov 25, 2008. 10:48 AMrearthur2003 says:
he should be using linux with the avrdude for windows user you can download winavr or the avr studio4
Jul 19, 2008. 7:15 AMpapalevies says:
So I have tried it in the past in Windows XP but it didn't work (maybe something to do with the parallel port being ring 0 in XP), but I recently switched to Ubuntu, so I gave it another shot. I shortened the cable (about 40cm now), made a small circuit to give it exactly 5V (using a L7805CV) and didn't use any resistors on the cable. This time everything went smoothly, avr-dude ended without any errors but the led just wouldn't turn on! To my amazement, as soon I removed the cable from the programmer in disappointment, the led started blinking! I don't know if it was supposed to be this way but the bottom line is it works! Now that I can program the 2313, my next project will be the USB programmer. Thank you!
Dec 7, 2007. 5:15 AMmrynit says:
i was getting this error

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1

To fix it i took off my 220 ohm resistor from pin 11.
Oct 16, 2007. 4:37 AMdadda says:
I tried to program atmega32 chip using a bsd programmer and winavr20070525 and got this error :
avrdude -p atmega32 -p lpt2 -c bsd -U flash:w:f:prateek.hex
avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.

make.exe: *** [program] Error 1

I checked the connections many times but they are right , where could the problem be ???
Oct 4, 2007. 4:08 AMdr_seltsam says:
The smell in the morning... Someone in the movie "Apocalypse Now" sayed a similar sentence ;-) By the way - a good explanation to the AVR Stuff! Thank you very much!
Jun 16, 2007. 3:13 PMpapalevies says:
I tried everything, the install_giveio.bat, even the link above and it returns the following error (after using the link above it only returned it when using Tools>Program, not on Make All, but still didn't work):

> "make.exe" program

Creating load file for EEPROM: main.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex main.elf main.eep || exit 0
c:\WinAVR-20070525\bin\avr-objcopy.exe: there are no sections to be copied!
avrdude -p attiny2313 -P com1 -c dasa -U flash:w:main.hex

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:01

The connections are triplechecked and I even tried different ones. Any clue what is wrong?
Jun 17, 2007. 4:53 AMMyself says:
Your commandline says you're using a DASA cable, but the instructable here is for a DAPA cable. Edit the makefile to reflect that, and you should be good.
Jun 17, 2007. 7:51 AMpapalevies says:
Nope, tryied that, same error.
I just noticed, in Make All it doesn't return an error code but it does return

Creating load file for EEPROM: main.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex main.elf main.eep || exit 0
c:\winavr-20070525\bin\avr-objcopy.exe: there are no sections to be copied!

is this an error? I am starting to believe it might be my parallel port. Is there a way to check it with a multimeter or something?
Jun 21, 2007. 11:40 PMdoctek says:
Obvious stuff: - Be sure to run install_giveio.bat as Administrator. - Do you have power ? (that is, plus 5Volts). - Is your cable short? (not sure of the limit, mine is less than one foot.) - Do you have resistors in all the signal lines? If so, you may try removing the ones on MISO and Gnd. - Finally, note that nothing happens if all goes well. You just get a return value of Zero. Then you disconnect your cable, be sure to hook up 5 volts, and the led should blink. I was unclear on this last detail; I thought blinking would happen once programming was done. - Good luck!
Jun 25, 2007. 12:28 PMkeiserw says:
I am having the same type of problem. It says:
avrdude -p attiny2313 -P lpt1 -c dapa -E reset -U flash:w:LED_Demo.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:00

My question is, do you hook up the 5v to the board while you are downloading it or does it receive power from the computer via the cable?
I have tried it both ways and get roughly the same error.
Any help would be greatly appreciated.
Jun 29, 2007. 12:18 AMdoctek says:
Plus 5 must be hooked up to down load. My setup has +5 on Pin 3 of the DAPA cable, so I just used that. If you have to supply external power, don't forget to hook up the ground pin as well (yes, I know it's obvious, but I mention it anyway.) Also, be sure you have the 2313 plugged in correctly. I tried it backwards - not a good thing, but the 2313 survived.
Feb 10, 2007. 1:28 AMjcgam69 says:
I got the error: avrdude: can't open device "giveio" avrdude: failed to open parallel port "lpt" To fix that problem run c:\winavr\bin\install_giveio.bat
Jan 27, 2007. 5:57 PMMyself says:
Okay, I can manually run avrdude and it finds my chip, so I know the cable's good and giveio is working. I can't get make to play nice, though. Programmer's Notepad and running "make all" manually at the prompt both result in:

make: *** No rule to make target `LED_Demo.o', needed by `LED_Demo.elf'. Stop.

I reinstalled winavr on c: and put your .c and makefile in c:\winavr\LED_demo\ and I still get this. What am I doing wrong?
Jan 27, 2007. 8:09 PMMyself says:
Addendum: Using the different Makefile given in http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=45491 I got everything working. Not sure why, I don't speak Gnu yet, but if you're stuck with the same error, poke at this for a while.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
95
Followers
7
Author:The Real Elliot