Go Down

Topic: Due Digital and Analog pins go high during programming. (Read 345 times) previous topic - next topic

rstuart

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?

promacjoe

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.

rstuart

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.

rstuart

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.

zamperweenie

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!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy