I have a few relays connected to outputs on a diecimila that flutter on and off for a second when the board resets. I suspect this is normal behavior during boot, but would like to find a workaround. Is there any way to hold these down until my code starts running, either in software or through a straightforward wiring change? At the moment, I am using every analog and digital pin, save TX and RX.
Thanks,
-Jim
I'm seeing the same symptoms in a different application so if you make any progress could you post it? I tried things like pull-ups and running the signals thru inverters but no joy. I suppose one possibility would be something like a tr-state buffer outboard of the arduino that would be gated by a long delay after reset but it seems like a lot of agony to go through.
Do you think it's something the hardware does or the bootloader - is the bootloader source available?
When a micro resets all the output pins are set to inputs for a short time until the program starts running again. With inputs you will find that the pin goes high impedance (or Tri state) or floats high if you have pull up resistors. Therefore if you are turning on a relay by setting the output pin low, or you are sourcing current through setting the output high it will change during reset.
To prevent this you need to make sure that the relay state you want to maintain can withstand the driver going high impedance. This means you should use a pull up (or pull down) and a relay driver that does not take very much current to switch it. So you can't drive relays (or lights) directly you need some sort of buffer / driver like a FET.
It makes the interface more complex but it stops the effect.