I am totally lost.
I placed a button on digital 5, with pull-down resistor, when button pressed it gets +5v.
I also have somewhat complicated sketch which on first button press reads sensor data into attached QuadRAM board, then (on next button press) copies RAM into SD file; it also communicates some data (file name, storage progress etc) on serial LCD.
SD card is located on Adafruit datalogger board.
Libraries loaded are SD, I2cMaster.
Sometimes (without changing anything!) it stops working: when I press the button, the board just reboots; moreover, it reboots with power shortage (!!) - I can see it when LCD backlight blinks. If I just keep the button pressed, all LEDs are down.
When the board gets into that strange mode - it stays there even if I upload some other simple sketch, even with switching power off and on several times. Then, after a while (I still cannot figure after what actions) it gets to normal.
From my experience when any device behaves that strange, it is most probably hardware problem.
But still, - can anybody come up with at least a hint, what could it be (besides faulty board)?
I have a feeling there is some "gray area" related to bootloader issues, when it switches to permanent reset loop or something. Can it be somehow related?
I do understand my description sounds very poor and messy and indeterminate. But so is the problem - it is intermittent and very unstable.