Not sure this is relevant, but was able to prevent this reset by setting the DTR within a perl script I was using. Hopefully this will help somebody with a similar problem talking to the Arduino with perl.
-Dave
#!/usr/bin/perl
use strict;
use Device::SerialPort;
my $port = Device::SerialPort->new("/dev/ttyUSB0");
$port->databits(8);
$port->baudrate(9600);
$port->parity("none");
$port->stopbits(1); $port->dtr_active(0);
Also, regardless of the solution we find, does anyone want to write up a tutorial on unsoldering the auto-reset capacitor? It could fit nicely in the board setup and configuration section of the playground, and then I can move it over to the hacking page on the main site.
I could rig something up, as I removed it recently on my board.
Also it's still quite easy to get code uploaded onto the arduino, at least with the bootloader flashed to my chips.
I wrote a manual for the device I built, so there's a working procedure for that.
We should also add all the other known options to disable DTR that currently work, like the perl code mentioned here and stty settings in linux.
Edit: just started a stub: ( Building and Modifying Arduino type boards ... )
ladyada: have you used libftdi? Does it run under Windows? Do you know if the bit bang pins default to inputs or outputs (or if the mode persists through power loss)? It could be a problem if you had to explicitly set the bit bang pin used for reset to an input every time you powered up the board. Also, reading through the documentation, it wasn't clear to me which function actually set the states of the bit bang pins (I didn't spend much time on it); do you know?
Do you know if the bit bang pins default to inputs or outputs (or if the mode persists through power loss)? It could be a problem if you had to explicitly set the bit bang pin used for reset to an input every time you powered up the board. Also, reading through the documentation, it wasn't clear to me which function actually set the states of the bit bang pins (I didn't spend much time on it); do you know?
The pins can be set to bit-bang mode through the FTDI programming tool. It needs to be burned once into eeprom only once through the programming tool.
See MPROG from http://www.ftdichip.com/Resources/Utilities.htm
Right, but the question is whether or not we can toggle an individual bitbang pin on every upload, from the Arduino IDE. And, if you're not using the Arduino IDE whether you'll need to explicitly set the pin to an input, say, to un-reset the ATmega. Anyone know any more?
it doesn't have to, for windows theres already a library
Do you know if the bit bang pins default to inputs or outputs (or if the mode persists through power loss)?
no, i haven't used it so i dont know. According to the app note for bit bang mode:
when the bitbang mode is enabled thru the driver, the direction is also set.
Also, reading through the documentation, it wasn't clear to me which function actually set the states of the bit bang pins (I didn't spend much time on it); do you know?
FT_SetBitMode CBUS Bit Bang mode is enabled using the FT_SetBitMode command. A
value of 0x20 will enable it and a value of 0x00 will reset the device mode.
Note that the CBUS pins must also be configured for CBUS Bit Bang in the
FT232R EEPROM.
FT_SetBitMode also provides the means to write data to the CBUS pins.
The upper nibble of the Mask parameter controls which pins are inputs or
outputs, while the lower nibble controls which of the outputs are high or low.
FT_GetBitMode FT_GetBitMode returns the instantaneous value of the pins. A single byte
will be returned where the lower nibble contains the current values of the
pins, both those which are inputs and those which are outputs.
For example:
Set all pins to output with bit 0 high: FT_SetBitMode(Handle, 0xF1, 0x20)
FYI, I just tried another little experiment (modified)
I took a 110 ohm resistor and connected the arduino 5v pin to the reset pin, jumper style. They are close together.
Guess what? No more com port resets
Remove the jumper resistor and com port resets resume.
The 110 ohm resistor is just enough to keep the reset pin high (2.38v) when the ftdi chip tries to pull it low, and limits the current through the ftdi pins to 24ma*.
It also limits the current through the reset switch to 45ma.
for reference:
I don't know that I would trust it with an isp conected either. But it seems to be a simple "jumper style" solution, just have to make the jumper out of a 110 ohm resistor with some nice thick leads that fit the in the headers nicely.
*24ma is the limit on the ftdi rts/dtr pins, if I'm reading the datasheet right. Don't go below 110 ohms. I think you can go up to 124 ohms before it will start resetting anyway.
also, a 47 ohm resistor between 3.3v and reset seems to prevent serial resets. It's a more common value and leaves the 5v pin open.
But if you hit the reset switch it it will draw 70 ma from the ftdi 3.3V port while the switch is closed, and the datasheet lists 50ma max. I tapped my reset button a few times with this configuration and the magic smoke stayed put, and upload still worked when I pulled out the resistor, but I can't really recommend the 47 ohm if you are planning on using the reset switch.
So with the resistor mod we come back to previuos versions without autoreset...uhm...I would have both features...autoreset is a smart feature that I'd miss it...
Was wondering if applyng the following mods to bootloader I can have autoreset only on at upload of sketch: