In a few projects i have, where i use the arduino to drive higher loads (stepper motors, high power LED etc) i can only upload the sketch if i disconnect the high power circuit completely.
E.g. using arduino nano to switch a MOSfet, a 24V 40W load goes through drain/source and only the gate and common gnd is connected to the arduino. With the LED power supply powered up i can only some times upload the sketch. Need to switch off the power entirely to upload. Makes prototyping and testing a bit annoying.
I am guessing there is some noise involved. Anyone know the reason and any good tips on how to fix it? Should i be filtering/smoothing some voltage lines or something something?