I need to program my ATMega64 with Arduino as an ISP and avrdude.

So i'm a bit stuck. I've got a big project and i need to program an ATMega64 but i don't know how to.

What i've done;
I've followed this video up to the last step.

My arduino duewatermelon is set up as an ISP programer using the Arduino ISP sketch and my atmega64 is on a breadboard and connected to the arduino board. I have my arduino connected on COM3.

What i need to do;
i need to upload a .hex file. The hex file and avrdude instructions for uploading with avrdude is found here http://mutable-instruments.net/ambika/build/firmware

What i need help with;
It's just not working. I can upload sketches to the arduino just fine and my duewatermelon has always had issues with drivers but i've sorted that out. But it seems like i'm getting similar issues with avrdude as i was getting with arudino before i had resolved my driver issues.

This could be due to the fact that the pins aren't connected properly but i'm certain they are or the sketch is wrong because there might be some things that need to be changed in there.

You need to learn "avrdude" You can find documentation on the web.
Eventually you'll need a command like:
avrdude -v -patmega64 -cstk500v1 -PCOM5 -b19200 -e -Uflash:w:myfile.hex
And probably additional commands to set the fuses appropriately.

There's a youtube video that takes you from having your arduino to putting your IC onto the bread board, hooking it up, to creating the makefile but it just says "then upload your hex file via avrdude and you're done"

I think avrdude is really complicated. I'm terrified of command lines and avrdude has so many parameters.

But one last question then i should be fine;
I need to upload the bootloader and the software onto the atmega64 so how do i do that? if i upload one hex then another won't the second upload just replace the first upload similar to how it works on arduino?

These are the instructions for how to upload the .hex files and this is also where i got the .hex file from

I think avrdude is really complicated.

Yes, it is. :frowning: There is a reason that the Arduino IDE is very popular, despite being "primitive." Since you're programming a non-Arduino chip, you have to learn some of the older, more complicated commands.

I'm terrified of command lines and avrdude has so many parameters.

If it's mainly the command line that scares you, there are some GUI "front-end" programs that work with avrdude that might help.
I don't think they really make things less complicated, but they at least provide click boxes and things for the options instead of making you type them correctly. You're using Windows?

I need to upload the bootloader and the software onto the atmega64 so how do i do that?

If you have a .hex file, there is no particular reason to upload a bootloader as well. (and yes, uploading a .hex file with ArduinoISP/AVRDude will erase whatever is currently present on the chip, including the bootloader.)
(besides, I don't think you have an atmega64 bootloader ...)

Why would they give me both the bootloader and software? just looking at the sight right now and they're uploading both in one command.

avrdude -B 1 -V -p m644p -c avrispmkII -P usb -U flash:w:ambika_controller.hex:i -U flash:w:ambika_controller_boot.hex:i -U lock:w:0x2f:m

-P would be COM3 and -c would be arduino correct?

And yes i am using windows BUT i should be fine using the commands on the website i've linked earlier.

they're uploading both in one command.

Hmm. That might work. You might be able to use the bootloader to upload subsequent sketches. Or THEIR bootloader might be more important than the Arduino bootloader.

Um. Atmega64, or Atmega644 ? Those are different chips. In particular, Arduino has been ported to the 644 ("Sanguino" and related boards), so it has more potential for future efforts.

-P would be COM3 and -c would be arduino correct?

"-P" value is dependent on where the ArudinoISP system shows up on your computer.
"-c" should be "arduino" if uploading through the arduino bootloaders, but "stk500v1" if uploading via ArduinoISP running ON an arduino. I think.

the website i've linked earlier.

It does use a different bootloader from Arduino...

Thanks for helping me west.

I have an arduino but i need to program this ATMega644pa (that's the actual chip), it's a totally different project and it does not have anything to do with arduino. I'm asking in these forums because i'm using arduino as my ISP as it's all i have on me at the moment.

It's still spitting out errors after changing -c to -c stk500v1

Can i just say fuck you to the arduinoISP idea and just connect the mega644 the arduino board's ISP pins? this would change -c to ft232r if i'm correct.
This is my board and the ISP pins are on the right.

You definitely need a "-b 19200" option (baud rate) in your avrdude command; the default is 115200bps.

Can you post a picture of your actual setup, and a list of the commands you're actually typing?
These posts (you're far from the only one!) that say things like "I'm following the tutorial at x" are pretty useless, since most of the time the problem is some error in following the instructions...

arvdude -B 100 -b 19200 -V -p m644p -c stk500v1 -P com3 -e -u -U efuse:w:0xfd:m -U hfuse:w:0xd2:m -U lfuse:w:0xff:m -U lock:w:0x2f:m

Still not working. :frowning:

my set up is;

pin Arduino board to ATMega644pa
pin 5v to 10
pin GND to 31
pin 10 to 9
pin 11 to 6
pin 12 to 7
pin 13 to 8

is there some way around replacing the capacitor that goes from reset to ground as the best i have is a 24uF.

is there some way around replacing the capacitor that goes from reset to ground as the best I have is a 24µF.

What's wrong with 24µF?

the duewatermelon needs a 10uF capacitor connecting reset to ground to prevent the arduino from auto resetting. I've only got a 10uF.

24µF is perfectly adequate. So is 47µF.

You must however connect it only after you have loaded the "Arduino as ISP" sketch, and remove it when you have finished using it as an ISP.

Thanks paul.

To be honest with you, the capacitor fell out ages ago and talking about it i put it back in and i got this message.

So i'm over the moon right now. I'm so close to plugging this chip in and being able to finally wrap up the first half of my project.

Both .hex files are in the same folder as avrdude.
It's just saying that the device signature is invalid. I couldn't wait and used -F anyways. It uploaded one of the hex files but not the other. I tried to write the fuses again thinking that it would take me back a step and i'm getting the device signature error again.