I have an arduino mega 1280 that i use to control lights and gauges on a bus dashboard,
it's connected to the computer via a 2 foot usb cable directly to one of the USB ports (i.e. not via a hub or anything) no external power in to the arduino,
I have the arduino plugged into a large shield i made, every digital and analog pin except for 6 of the analog pins go through a 500 ohm resistor to the base of a 2N2222 transistor,
Emitter to earth, and collector to a screw terminal,
The 6 analog pins that do not go through the resistors and transistors go straight to screw terminals, as i connect an LCD to those pins,
The bus dashboard's lights and gauges are fed 24 volts from a bench psu, earth tied to the arduino's via the shield, and the arduino simply puts a pin high to turn on a light, or alters a pins PWM to vary a gauge reading,
It all works ok, however since about 2 weeks ago i have found that every day when i start up the computer, start the bus driving simulator and try to connect to the arduino, nothing happens,
If i re-program the arduino with it's script, it will then connect to the bus sim fine and work, and i can shut the computer down, come back in a few hours and it's still working,
But leave it overnight, and it seems to be loosing the programming, my mother board keeps power to the usb ports for charging mice and things, this is annoying as the trackIR led's stay on all night, so i've taken to switching the computer off at the wall, but the arduino lost it's programming when i left the computer on at the wall or off,
TOne thing i have noticed is that one of the gauges that is connected to analog pin 13 flicks when programming the board,
i deliberately left analog pin 0 and 1 empty as i believe they are tied to the serial port, but even if i disconnect pin 13, and re-assign the gauge to pin 10, whilst no other gauges flicker whilst programming, the arduino is still loosing it's programming over night.
Any ideas to what may be happening?
Is it possible to read the program from an arduino to the computer so i can see if it is still present in the morning? thinking something may just be blocking comms until i re-program the board,
and i will try unplugging the arduino from the shield, but is it known for a shield to ever cause an arduino to loose it's program???