Programming Arduino Mini Pro using FTDI borad WITHOUT arduino IDE

I want to program my Arduino Mini Pro 328 5V, with a standard FTDI board. I want to program the board via the FTDI header (RX, TX, CTS pins), not the ISP pins(MISO, MOSI, SCK). But i dont like using the Arduino IDE. I would prefer to use avrdude or some equivalent, and script it via my preferred IDE, currently Platform I/O + Atom.

I have sucsesfully programmed via Arduino IDE, but have failed using avrdude.

I have tried several variation of the following command, but have failed. My understanding is that arvdude with programmer ft232r uses the ISP pins not the FTDI header, and i am not sure how to get around this. I have tried -p ft232r, arduino-ft232r, and some other variations

avrdude -c ft232r -p m328p -e -U flash:w:Blink.cpp.hex -vvv
avrdude -c arduino-ft232r -p m328p -e -U flash:w:Blink.cpp.hex -vvv

thanks
ZyMOS

" My understanding is that arvdude with programmer ft232r uses the ISP pins not the FTDI header,"

That is incorrect - the FT232 is not a Programmer, just a USB to Serial adapter.

I've only programmed using the IDE, don't know how to help with the rest.

Do this:

  • File > Preferences > Show verbose output during: > Upload(check)
  • Sketch > Upload
  • After the upload completes scroll the black console window at the bottom of the IDE window up until you see the AVRDUDE command that successfully uploaded to your Pro Mini. Use that as a reference for the command you use in your script.

Thanks pert

for those interested the command given by Arduino IDE is
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/tmp/build9081096245698280394.tmp/Blink.cpp.hex:i

I have simpilfied the command to:
avrdude -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:ExampleHexFile.hex:i

I tried the programmer "arduino", but missed the "-D" and "-b" flags which upload fails without.

-D = Disable auto erase for flash.
-b = Baud rate

thanks
ZyMOS

ps
ft232r in bit-bang mode works as an uploader

Also for who ever is interested to get it to work in Platform I/O

add the following to "platformio.ini"

[env:pro16MHzatmega328]
platform = atmelavr
framework = arduino
board = pro16MHzatmega328


upload_protocol = arduino
upload_speed = 57600
upload_flags = -D
1 Like