I revised my circuit board to avoid any and all communication pins (not just 0 & 1, as I mentioned in my ) by adding jumpers. Requires an even hand, a Dremal, and desperately small drill bits (I could only find them at a Manhattan jewelry supply store) but workable as an ad-hoc solution.
To make sure all the solenoids were correctly firing, I created an array and iterated through it with a For() loop, turning the solenoids off and on.
int stringPins[] = {
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 28, 29, 32, 33, 36, 37 };for (int j = 0; j < firstPinDigit[thisPin]; j++){
Serial.print(stringPins[thisPin]);
Serial.println(" is the pin we are writing to");
digitalWrite(stringPins[thisPin], HIGH);
delay(timeDelayHigh);
digitalWrite(stringPins[thisPin], LOW);
delay(timeDelayLow);
It worked. Mostly. Sometimes, the Arduino still reset. I checked everything for potential shorts, and made absolutely sure I wasn't using any communication pins. Still, occasional resets persisted, often when I wrote "high" to pin 28. If I removed any Serial commands, the reset problem vanished.
While I was happy to have pinpointed the problem, I knew that getting rid of all serial commands would render any future programming debugging (and there will be plenty) unacceptably murky. Scouring the internet, I gathered that the consensus is that the autoreset problem is a derivative of a "feature" of new arduinos: when they detect that an effort to communicate with computer communication (you guessed it-- Serial) they reset themselves, so that the bootloader (their baked-in software that allows them to load new code) can run and download a new program to their memory. "They" being the Arduinos. I may be getting too close to mine. But I digress.
The next question is obvious: how does one temporarily disable this auto-reset functionality? I found forums full of fine folks looking for answers. The best solution I found came from senior member DCB over at http://www.arduino.cc/ who
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1213719666/all:
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.
Sounds like a plan to me. I'll drill holes for another jumper (what's another, anyhow?) and maybe add a switch to my board so that I can turn my auto-reset disabling function on & off, which could be useful since my circuit board (effectively a home-brew Arduino shield at this point) completely covers the manual "reset" switch.


Recent Comments