SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on the software and hardware for Atmel's STK standard.
By bryank
#83214
Id like to think that I am not an electronics n00b but I can't for the life of me program an atmega8l-8pu

My makefile is standard other than:
MCU = atmega8
AVRDUDE_PROGRAMMER = stk200 (I am using the AVR-PG2 programmer)
AVRDUDE_PORT = lpt1

Whenever I use avrdude to program the chip I get the infamous:
> "make.exe" program
avrdude -p atmega8 -P lpt1 -c stk200 -U flash:w:Testblink.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

AVRStudio4 and Ponyprog won't connect to my board either (I have used 2 windows XP computers with working parallel ports as I use them for my CNC machines).

My breadboarded circuit is shown below, am I missing something?
Image
Image
Image

Thanks in advance![/img]
By stevech
#83215
that chip's osc. fuses are set for internal osc. vs. external crystal?

PS: pix too big.
By bryank
#83216
the makefile and .c program were taken directly from http://www.sparkfun.com/commerce/tutori ... ials_id=93 so it should be wanting to use the internal osc. Im fine with using the internal osc. if I can get it to work. Otherwise what specifically are my options as the atmega8L version can only run up to 8MHz (making the details found in part 3 of the tutorial not applicable to me). Thanks!
By stevech
#83218
how are the fuses programmed in the chip you are using? If I recall correctly, all fuses are unprogrammed (1) in a "virgin" chip. If the clock source fuse bits are all ones, that corresponds to the choice of external crystal or resonator - which isn't present in your breadboard (is it?). Or is your chip programmed for internal osc?

From the mega8 datasheet:
Table 2. Device Clocking Options Select(1)
Device Clocking Option CKSEL3..0
External Crystal/Ceramic Resonator 1111 - 1010
External Low-frequency Crystal 1001
External RC Oscillator 1000 - 0101
Calibrated Internal RC Oscillator 0100 - 0001
External Clock 0000
Note: 1. For all fuses “1” means unprogrammed while “0” means programmed.
By bryank
#83219
I do not know yet how the fuses are programmed, my chips are blank so if it is looking for an external crystal/oscillator/resonator how should I set one up? I have 16MHz and 20MHz crystals on hand but like I said the L version of the chip can only run at 8MHz tops. Thanks a ton for your help thus far!

By chance does my answer somewhat lie in post ~5 of this thread? viewtopic.php?t=12789
User avatar
By Chupa
#83227
Im not familiar with AVRDUDE so unfortunately I cant help you.

but damn, thoes are some crisp photos. Might I ask what camera you used? Dont mean to derail this thread!
By bryank
#83229
haha some sub $150 Samsung 5mp from 2 years ago. I thought it sucked but thanks!

kk now back to helping me program this dang thing! it has to be the way the chip is hooked up as it doesn't matter which program, cable, computer etc. I use it simply fails to recognize
By sylvie369
#83241
No time to go through it wire by wire, but the second photo shows a yellow wire and a green wire coming from your power and ground rails and attached to nothing at all. Are those just spare parts, or were they meant to do something?

It also looks like the reset button is not connected to the AVR at all.

You might think about cleaning up a little of the rat's nest with one of these:

http://www.sparkfun.com/commerce/produc ... ts_id=8508
User avatar
By leon_heller
#83243
Schematic?

Leon
By bryank
#83249
the 1st and 3rd pictures show how my reset button is connected

the green and yellow wires are not connected to anything, there was another component there, I pulled it out and left the wires sit there

the schematic is this, as provided by SFE

Image[/img]
By stevech
#83268
I do not know yet how the fuses are programmed, my chips are blank so if it is looking for an external crystal/oscillator/resonator how should I set one up? I have 16MHz and 20MHz crystals on hand but like I said the L version of the chip can only run at 8MHz tops. Thanks a ton for your help thus far!
Well, as I said above, read the data sheet re the clock source for an unprogrammed chip. You'll need a crystal.
By n1ist
#83275
The default fuses are for the 1 MHz internal clock. Check your reset button - some have internal connections that will hold the chip in reset if they are installed 90 degrees off.
/mike
By bryank
#83292
I have since rewired and changed breadboards and chips...no luck. Anyone have any idea what could be wrong? I doubt its the programmer but that seems to be the only thing left.
By cpolley
#83305
I've never used a parallel port programmer, but perhaps it does not provide power to your mega8 ... many ISP programmers have 5V/GND lines but that's because they expect to SEE 5V/GND, not provide it. If you haven't already tried it, connect an external 5V source.
By bryank
#83306
An external power supply is connected (not shown in pictures) as this programmer draws its power from the target board.

I have read on some other sites that you can make a very simple programmer using 2 x 1k resistors and 5 wires directly wired to the pins of a DB25 connector. I am going to try that tomorrow as nothing else is working...