--- In l..., "Leon Heller" wrote: >
> ----- Original Message -----
> From: "soufeazie"
> To:
> Sent: Wednesday, December 06, 2006 2:46 PM
> Subject: [lpc2000] LPC2103 GPIO interfering with PWM
> > Hello, I am trying to control a small dc motor along with two servos
> > using an LPC2103. I am having a strange problem where the servos go
> > crazy when the dc motor is actuated. This dc motor is driven by an
> > h-bridge circuit, so it is controlled with 2 GPIO pins from the
> > microcontroller. I chose pin 8 and pin 9 because it didn't look
like
> > they interfered with the pins needed for PWM. Could someone please
> > suggest a possible cause for this problem? The code works fine when
> > the dc motor is not connected (even when motor(0) or motor(1) is
> > called). Any help would be much appreciated. Thank you in advance.
>
> Noise from the motor is probably getting onto the MCU supply. Try using a > separate supply.
>
> Leon
> Leon,
Thanks for the response. I should have mentioned that I am already
using two power supplies; a standard dc power supply (plugged into the
wall) is used to power the servos and dc motor, and I have a 5V
battery pack powering the microcontroller. Is it possible that noise
from the motor is affecting the servos through the common +5V power
connection? Maybe I will try running both the servos and the
microcontroller from the battery pack, and isolate the dc motor on the
wall power supply. Thanks for the suggestion.
----- Original Message -----
From: "soufeazie"
To:
Sent: Wednesday, December 06, 2006 2:46 PM
Subject: [lpc2000] LPC2103 GPIO interfering with PWM > Hello, I am trying to control a small dc motor along
with two servos
> using an LPC2103. I am having a strange problem where the servos go
> crazy when the dc motor is actuated. This dc motor is driven by an
> h-bridge circuit, so it is controlled with 2 GPIO pins from the
> microcontroller. I chose pin 8 and pin 9 because it didn't look like
> they interfered with the pins needed for PWM. Could someone please
> suggest a possible cause for this problem? The code works fine when
> the dc motor is not connected (even when motor(0) or motor(1) is
> called). Any help would be much appreciated. Thank you in advance.
Noise from the motor is probably getting onto the MCU supply. Try using a
separate supply.
Leon
Reply by soufeazie●December 6, 20062006-12-06
Hello, I am trying to control a small dc motor along with two servos
using an LPC2103. I am having a strange problem where the servos go
crazy when the dc motor is actuated. This dc motor is driven by an
h-bridge circuit, so it is controlled with 2 GPIO pins from the
microcontroller. I chose pin 8 and pin 9 because it didn't look like
they interfered with the pins needed for PWM. Could someone please
suggest a possible cause for this problem? The code works fine when
the dc motor is not connected (even when motor(0) or motor(1) is
called). Any help would be much appreciated. Thank you in advance.
----start of relevant code (this is not the entire program)-----
servo(1500, 1500);