Due Digital and Analog pins go high during programming.

While the Arduino PC program is uploading a program to the Due, both the Digital and the Analog lines go high. This is very inconvenient since there are vehicle motors connected to these lines. In other words I have to disconnect the motors while the Due is is having programs uploaded to it. Am I missing something?

What kind of motor controller are you using, And are you using pull-up resistors.

During a reset, it is common for a microcontroller pin to go to the high impedance state. the use of pull up resistors could mimic a high level output. a level shifter can also be responsible.

You can put a power switchIn line with the motor controller power to prevent the motor from coming on during programming.

But for the best advice, we would need to know what you are using, and how you are using it.

No. There are no pull up resistors or level shifters. There are, in fact, pull down resistors on most of the lines. I have lights as well as motor control lines connected to these outputs. All of them go high during programming and, for a short period, during boot. If I run the standard "blink" program, which leaves the lines in a high-impedance and, as expected, the lights and motors do not turn on when the program is running. During the upload however, the lines still go high and the motors and lights still turn on. Here is another clue: all of the lines also go high when the reset button is pressed. None of this happens when my system is connected to an Uno or a Mega.

I already have a switch which disables the motors. I sometimes forget to flip the switch and the results are rather unpleasant.

Unless some other revelation appears soon, I will probably put an inverter and some OR logic in between my Due and the controllers to prevent this from happening. I find it hard to believe that the board does this, so I was hoping that there was something I was missing.

I will post this solution in the hope that it will help someone else with the same issue. It appears to me that during the "reset" state--which includes uploading programs from the Arduino development environment, pressing the reset button and, for a short period during startup/boot--these pins go into a state which is neither high-impedance nor low-impedance but is high enough to be regarded as high by most logic. A pull-down resistor is the solution. I used a 2.7k resistor tied from the pin to ground. This is large enough to pull the level to a reliably low logic level but small enough to not tax the source-current limits for even the low-current pins.

You're a life saver! I was having the same problem and your fix worked, albeit with a 4.7k resistor.

So how exactly does this work? You mention it "pulls" it to a low level. Does this mean it diverts the current towards ground or lower the voltage on startup? Or something like that?

Thanks again!

Yes. The pull-down resistor provides a path to ground -- thereby draining any residual pin charge from the output pins.

I have experienced the exact same thing with both the atmega2560 and atmega328p. it ruined two big motor controllers for me so be very careful! sadly there is no way I can add an addidional pull down for every logic line as it is a custom pcb.

Yes. The pull-down resistor provides a path to ground -- thereby draining any residual pin charge from the output pins.

it is NOT residual charge. It is the defined behaviour of the SAM3X
See Datasheet section 31.5.1:

After reset, all of the pull-ups are enabled, i.e. PIO_PUSR resets at the value 0x0

The reason, why the 4.7k works is because of the Pull-Up being ~100k (+/- 50k)