I’m trying to upload the program from [here to my ATmega168 but I’m having trouble. Every time I try to upload it to the board ‘make all’ goes fine, but ‘make program’ gives me the error
avrdude -p atmega168 -P /dev/ttyS0 -c ponyser -U flash:w:blink_1MHz.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: *** [program] Error 1
I’m running Linux and I’m fairly certain that my serial port is /dev/ttyS0. I’ve checked all my wires and everything is hooked up firmly, and there’s 4.96 V running through all the various power/ground wires. The wires are definitely hooked up to the programmer and ATmega correctly. Does anyone know what the problem might be?
Yes0:
I’m trying to upload the program from [here to my ATmega168 but I’m having trouble. Every time I try to upload it to the board ‘make all’ goes fine, but ‘make program’ gives me the error
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: *** [program] Error 1
I'm running Linux and I'm fairly certain that my serial port is /dev/ttyS0. I've checked all my wires and everything is hooked up firmly, and there's 4.96 V running through all the various power/ground wires. The wires are definitely hooked up to the programmer and ATmega correctly. Does anyone know what the problem might be?
Thanks![/quote]</QUOTE>
Two possibilities come to mind.
First, if you set the chip fuses that configure it for use with a crystal for its clock source, then the chip won't work (even for serial programming) without the crystal present.
Second, if you disabled the reset line to get an extra I/O pin, then the programmer can't use that pin to reset the chip and put it into programming mode. I don't really know the solution to this one...](https://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=93)
I’ve never got it to run before, so I haven’t messed with the pin settings or fuses or anything.
e: I just tried the other ATmega168 (I’d ordered two in case something like this happened…) and it worked. I don’t know if the other one wasn’t in properly or I did something to fry it, but whatever.
and it used the internal clock at 8 MHz like it’s supposed to, but when I tried setting it to E6 to use my external oscillator it stopped responding. Did I screw up the fuses, or could it be that my crystal isn’t in right?
An external crystal won’t work if you’ve screwed up the fuse settings, you need an external oscillator. You’ll find plenty of info on AVR Freaks about the problem.
actually, your mileage will vary as to whether an external crystal or resonator will work with the wrong fuse settings, it should be good enough to resurrect the fuses. If not you’ll have to use a HV programming method.
for the initial guy, if you’ve never set the fuses on it then its going to be in slow mode for programming, you haven’t set a baudrate in your command line instruction, use -B 4800 for an unprogrammed chip.
The problem is according to the tutorial, and everything I find online, the value I set the fuse to is correct for an Atmega168 running on a 16 MHz external crystal. I have no idea why it’s not working, unless that’s not the right fuse or my crystal circuit isn’t correct.
I just played around with my M8 fuses, and eventually it refused to communicate… .
Used old trick, with applying square wave to xtal1 pin I succeeded to communicate with my mega.
Square wave was taken from my Scope’s calibration output.
As most of posts suggest 1MHz or something like that, my scope’s calibration pins provide 1kHz 5v square. so I just gave it a shot. Programmed fine the first try, with my quickly built SiProg programmer and either avrdude or ponyprog…