The Noob:
Edit: Okay so I am still trying and now I have this problem.
Makefile is in this link because I get an error when post it here in it’s whole (I can post the first part of it if you want).
http://rapidshare.com/files/327101186/Makefile.html
I can’t download your Makefule. Rapidshare says I need to be a premium member…
Okay so the problem is this: I can compile my program but when I try to load it into my atmega168 using programmers notepad I get this error.
avrdude -p atmega168 -P lpt1 -c -U flash:w:blinky.hex
avrdude: Can’t find programmer id “-U”
The “-c” option to avrdude is used to specify the type of programmer hardware you’re using. But the name of the programmer hardware is missing in that command, so avrdude thinks you’ve specified “-c -U”, using “-U” as the name of the programmer hardware.
In this case, I think it needs to say “-c stk200” to indicate that you’re using an STK200-compatible programmer on a parallel port. Most likely there’s a place in the makefile that’s used to indicate the programmer type - some variable that needs to be set.
I downloaded “blink_1MHz.zip” from that tutorial and it does include a Makefile… And there’s a section of the tutorial that tells you how to customize it for your programmer:
If you’re using the AVR-PG2 (parallel port programmer) you edit like this:
AVRDUDE_PROGRAMMER = stk200
#AVRDUDE_PROGRAMMER = ponyser
com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = lpt1
#AVRDUDE_PORT = COM1
Also, it’s possible you’ll need to deal with the “giveio.sys” if you’re on Windows. Unfortunately it seems the link from the “Lecture 2” tutorial to information about how to use giveio.sys is broken… I’m a Linux user myself so I don’t really know all the details about using giveio.sys on Windows or what versions of Windows will require you to use it - I just understand the principles of system protection that make measures like that necessary… But try to fix the programmer type in your avrdude command and see if that works. If you get the “giveio” error then you may need to install giveio.sys.
Finally, I wanted to include a bit about my background with microcontrollers: I’m really only getting started with AVR’s myself, but I’ve been working with PICs for several years. So I’m no expert with AVRs but I’ll try to help you through this process.
I originally tried to program PICs with a cheap parallel port hardware, similar in principle to the STK200 clone you’re using - but I never could make it work. From what I’ve heard there’s a lot of variation in the electrical characteristics of PC parallel ports - some of them aren’t well-suited to driving circuits like cheap microcontroller programmers. There’s no reason yet to believe your STK200 clone won’t work for you - but if you fix the makefile, and avrdude succeeds at getting access to the parallel port, and you’ve made sure your ISP connection is correct but you still can’t program AVRs with it, then you might consider getting a better programmer.
My recommendation at this point, if you do wind up needing a new ISP programmer would be [USB Tiny ISP (I’ll probably buy one of these at some point) - I can’t recommend the [Sparkfun Clone of USB Tiny ISP - there’s a problem with their USB hardware implementation which, as far as I know, has not yet been fixed. It’s still way too early to give up on the programmer you’ve got, though, so it’s just something to think about.](http://www.sparkfun.com/commerce/product_info.php?products_id=9231)](USBtinyISP - Inexpensive USB AVR Programmer)