Determining the exact avrdude commands being executed.

I have a clone UNO board that has an lgt8f328p (atmega328p clone), and a ch340g usb to serial chip.

I want to program it in assembly language using avrasm2 + avrdude.

I do this on my genuine arduino using the following batch commands:

del main.hex
avrasm2 -fI -o main.hex main.avr
avrdude -C avrdude.conf -v -p atmega328p -c arduino -P COM16 -b 115200 -D -U flash:w:main.hex:i

However this didn't work on the clone board. I got the following error:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

I figured that my avrdude.conf file was wrong, so I downloaded the arduino ide in the hopes of getting it working and copying the correct configuration file over.

At first I got the same error in the arduino ide, until I changed the board over to "Arduino duemilanove or diecimila". Now sketches upload without a problem.

I copied the new avrdude.conf file over, but I still can't directly program it using avrdude. The error message is different now:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xed

I think I have the correct config file, but my avrdude command arguments are wrong.

The arduino ide is executing the correct avrdude command, with the correct arguments. I really need to know what command it's executing.

Solved. Just had to change bits per second to 57600 for some reason.

avrdude -C avrdude.conf -v -p atmega328p -c arduino -P COM16 -b 57600 -D -U flash:w:main.hex

This is usually problem with Chinese Nano boards, "the old bootloader" thing.