I have a shield while has a common reset line with the Arduino. What I want to do is cause the wifi module on the shield to go through reset when I (in software) reset the Arduino, because it seems to have some issues with persistent state.
Is there a way to cause resetting the Arduino to pull the reset line low? Or do I have to make my own new shield where the reset line on the shield is connected to a pin I can control digitally? Since I already have 100 of these shields, that would obviously be a significantly worse option for me.
Is there a way to cause resetting the Arduino to pull the reset line low?
There has been many posting on this subject in the past. One can't just wire a output pin to the reset, as the pin will be defaulted to a input pin before there is enough time for a complete reset sequence. That leaves using extra external components to generate a proper reset pulse. like a 555 timer chip. You can use the software WDT to generate a internal reset condition for the AVR, but I don't think that actually pulls the reset line low for your shield board so you would have to add code in your setup function to output a output pin to the shield board, but that would require isolating the two reset signals.
One way would be to disable reset (reprogram the AtMega reset fuse). This would allow you to use the RESET pin as any other digital pin without actually resetting the microcontroller.
One way would be to disable reset (reprogram the AtMega reset fuse). This would allow you to use the RESET pin as any other digital pin without actually resetting the microcontroller.
But then you would probably have problems with utilizing the bootloader to upload code as the only way to sync up the bootloader to the Arduino IDE would be to manual cycle power to the chip at some perfect time?
If you're using an Arduino with a socketed chip then bend out the reset pin from the socket and connect an IO line to the reset signal.
The AVR datasheet cautions that this won't work reliably as an output pin will default to a input pin prior to the completion of the reset sequence. It's like crossing the beams.
But then you would probably have problems with utilizing the bootloader to upload code ...
Not really - we have just taken manual control of the RESET line.
Your sketch should check for high-to-low transitions on the RESET line (you can use pin change interrupts for this) and then activate the bootloader accordingly. Likewise you can choose to suppress this behavior whenever your sketch is initiating the high-to-low.
If you're using an Arduino with a socketed chip then bend out the reset pin from the socket and connect an IO line to the reset signal.
I meant just reset the shield, not the Arduino, the 328 won't be affected because the pin is out of the socket. A pullup resistor would be a good idea though..