Pages: [1]   Go Down
Author Topic: HOWTO avrdude+linux+diecimila  (Read 1990 times)
0 Members and 1 Guest are viewing this topic.
Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This short howto covers uploading from a terminal without using the arduino software at all.

1) howto reset diecimila, then upload with avrdude just like arduino software

stty 19200 raw ignbrk hup < /dev/arduino && avrdude -cstk500 -b19200 -pm168 -P/dev/arduino

The key here is the 'hup' attribute which tells linux to toggle the DTR pin when the port is opened and closed. The DTR pin going low when the port is opened is what causes the diecimila to reset, so this is perfect.

NOTE: some linux kernels in the 2.6.22+ range had a bug in the ft232 driver where DTR is never de-asserted on close. Symptoms are, even with above code, diecimila only resets the first time you program after plugging in. patch is available at http://lkml.org/lkml/2007/10/6/14 if you are affected.

I put both of the above in a script for easy reference. Replace /dev/arduino with /dev/ttyUSB0 or whatever it is on your system, or continue reading

2) howto ask udev to create a /dev/arduino symlink for you

I added

SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", NAME="%k", SYMLINK+="arduino", MODE="0660"

to /etc/udev/rules.d/10-local.rules

If you'd like it to create particular symlinks for particular arduinos, run

udevinfo -a -p /sys/bus/usb/drivers/ftdi_sio/* | grep serial

and add the first line to the above udev rule with appropriate commas. The rule might look like:
SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A1001Ncz", NAME="%k", SYMLINK+="arduino_1", MODE="0660"

which will create a /dev/arduino_1 symlink only for ft232R chips with that serial number.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just wanted to say thanks for posting this info.
Logged

Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just thought I'd add that I successfully reprogrammed the FT232RL on my diecimila to request 500mA from my USB port. See MProg tool from ftdichip.com. Unfortunately, I had to run it in virtualbox, ftdi_eeprom appariently doesn't support ft232R yet due to insufficient documentation from ftdi smiley-sad
Logged

Pages: [1]   Go Up
Jump to: