Getting auto reset to work with FTDI cables on Linux (MAC)


Update: please use avrdude 5.11 or later with “-c arduino” and your problems are gone!


Before you start, make sure you have the perl module Device::SerialPort installed ! On Debian based systems, you can easily do that by typing:

If it doesn’t work or you’re on a different flavour of linux, you can still use CPAN to pull in that module:

You may have to answer a few questions, but in doubt pressing ENTER is also OK. As CPAN might have to compile some C code, having gcc and depending libraries installed is mandatory.

Now back to the main topic:

Here’s just a little Perl script you can put into the “./hardware/tools” folder of your Arduino IDE. Rename “avrdude” to “avrdude_bin”. Create a file named “avrdude” in said folder and change its permissions to “rwx——” (0700). Now copy the following Perl code into it and save.

The script extracts the serial port from the string passed to avrdude by the IDE. Then it creates the reset pulse by changing the level of the RTS line. Then it just calls avrdude_bin as usual. This little hack is necessary as the IDE uses the DTR line to reset the Arduino. The FTDI cables break out the RTS line instead of DTR.

Hint for MAC users:

Depending on how the virtual serial port is named on your system, maybe something like /dev/cua.usbserial…. , you’ll have to adjust the REGEX which extracts the serial port from the avrdude call. This happens here:

Flashing the bootloader with the Arduino IDE:

This Perl script currently conflicts with that method, as the REGEX match can’t find a serial port in that case. You can still flash the bootloader by hand quite easily.

This entry was posted in Arduino., Electronics. and tagged , , , , . Bookmark the permalink.

4 Responses to Getting auto reset to work with FTDI cables on Linux (MAC)

  1. robert says:

    Another happy user, but using Python !

    Same post as above ;-)

  2. Pingback: Getting Started with Arduino – Chapter Ten « t r o n i x s t u f f

Comments are closed.