Possible ?? - hot connecting USB to PC with active sketch.

I have no idea if this is possible (but I hope it is :))

I want to put a bunch of a ADC readings into a storage array in ram (not EEPROM, too slow & not enough). Once the array is full the sketch will go into a wait state, awaiting a button press.

Here's the big question. With the sketch active, but in this wait state, can I plug in the usb cable to the PC. Then I press the button that tells the Arduino to upload the storage array values to the PC.

I just know the answer is going to be NO.

Cheers,

Keith.

If the USB cable is unplugged the Arduino serial port will not start.
When you plug the cable the Arduino will do a restart.

What are you trying to do?

Thanks very much Larry,

my query was an offshoot of a thread I currently have going Fast data logging for about half a second - Project Guidance - Arduino Forum

I thought the question would be very appropriate for this section, but I also got an answer in the above thread too.

Keith.

LarryD:
If the USB cable is unplugged the Arduino serial port will not start.
When you plug the cable the Arduino will do a restart.

One might try an external power supply for the arduino with a 100 ohm resistor installed to defeat the arduino reset.

Thanks a lot Zoomcat,

I've been doing lots of Googling about this matter and it seems many are having success with just a capacitor from RESET to GROUND. The capacitor basically keeps a "reserve of 5v" so the reset signal doesn't manage to pull the reset pin low enough to cause the reset.

Your solution would do exactly the same thing by keeping the 5v supplied.

My board (Freetronics Eleven - an Uno clone) also has a 2 pads with a tiny link between called RESET-EN. These pads are basically in the auto reset line (got the board schematic) so I could even cut that link, but I prefer not to. Either your method or the capacitor method will do me.

Cheers,

Keith.

Remember that you will need to re-enable the hardware reset in order to upload sketches to the Arduino.

You could use a leonardo or yun (may be over kill) or you can cut the restart line.

Mark

Thanks very much Pete & Mark,

I'm going to try the capacitor method first. It doesn't involve altering the board and to put everything back to normal I just pull out the capacitor.

Keith.