Hoping to get some suggestions...
Once I run the DC motor sample code, the USB port locks up and I cannot upload new a sketch to the board.
The motor and sketch runs perfectly as expected, but port locks up and I need to reboot the computer in order to load another sketch. (Restarting IDE and resetting the Arduino doesn't seem to help.)
Details:
UNO board
6v DC motor
Power:
Arduino is powered with USB
Shield is powered externally with 9V (6 D-cell batteries in series and connected to ext_pwr)
No power jumper used.
Other misc info:
Servo tests work fine.
Led lights up strong.
//////////////Begin code////////////
#include <AFMotor.h>
AF_DCMotor motor(3, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
void setup() {
motor.setSpeed(200); // set the speed to 200/255
}
void loop() {
motor.run(FORWARD); // turn it on going forward
delay(1000);
//Serial.print("tock");
motor.run(BACKWARD); // the other way
delay(1000);
motor.run(RELEASE); // stopped
delay(5000);
}
///////////////End code////////////
Thanks in advance for any tips you might be able to provide.
- Randy
Motor shield - usb port locks up when I run the DC motor sample
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 3
- Joined: Wed May 23, 2012 12:06 pm
- adafruit_support_bill
- Posts: 88152
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor shield - usb port locks up when I run the DC motor sample
That is unusual. I have seen USB ports shutdown due to too much current draw. But with separate power supplies, there should be no problem with that. Does the Arduino continue to function normally?
The only other thing I can think of is noise. You have separate supplies so there is no direct coupling of noise. But motor leads make good "broadcast antennae" and the brush noise from a DC motor can be picked up by nearby wiring. You might try adding some noise suppression caps to the motor. See the bottom of the FAQ for details.
The only other thing I can think of is noise. You have separate supplies so there is no direct coupling of noise. But motor leads make good "broadcast antennae" and the brush noise from a DC motor can be picked up by nearby wiring. You might try adding some noise suppression caps to the motor. See the bottom of the FAQ for details.
-
- Posts: 3
- Joined: Wed May 23, 2012 12:06 pm
Re: Motor shield - usb port locks up when I run the DC motor sample
>Does the Arduino continue to function normally?
Yes. Seems to run the loop indefinitely.
>try adding some noise suppression caps to the motor.
I'll give that a try. Thanks for the tip.
- Randy
Yes. Seems to run the loop indefinitely.
>try adding some noise suppression caps to the motor.
I'll give that a try. Thanks for the tip.
- Randy
-
- Posts: 3
- Joined: Wed May 23, 2012 12:06 pm
Re: Motor shield - usb port locks up when I run the DC motor sample
Adding caps to motor worked! Thanks for the help.
Please be positive and constructive with your questions and comments.