Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.arch.embedded > #26299
| From | "engineergc" <116985@EmbeddedRelated> |
|---|---|
| Newsgroups | comp.arch.embedded |
| References | <nNWdnYfD--B_FkXFnZ2dnUU7-LvNnZ2d@giganews.com> |
| Subject | Re: L298 PWM Problem |
| Message-ID | <NcOdnT0VesiSDUXFnZ2dnUU7-RXNnZ2d@giganews.com> (permalink) |
| Date | 2017-03-26 23:07 -0500 |
>Dear all;
>
>I try to turn 2 motors with pwm by using L298N motor driver card and
MSP430G2553. I tried some codes, but right motor does not work. When I
give direct energy from a supply to right motor without using motor
driver or micrroprocessor it can turn. So, problem is not in motor. But,
when I tried
>to turn both motors by using MSP430 launchpad and L298N only one motor
can turn (the motor that is driven by IN1 and IN2. I added code to below.
I can not find my error. Could you
>help me please?
>
>#include <msp430.h>
>
>int main(void) {
> WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
> DCOCTLÊLDCO_1MHZ;
> BCSCTL1ÊLBC1_1MHZ;
> P1DIR |= BIT6; //Set pin 1.6 to the output direction.
> P1SEL |= BIT6; //Select pin 1.6 as our PWM output.
> TA0CCR0 = 255; //Set the period in the Timer A0 Capture/Compare
0
>register to 255
> TA0CCTL1 = OUTMOD_7;
> TA0CCR1 = 255;
> TA0CTL = TASSEL_2 + MC_1; //TASSEL_2 selects SMCLK as the clock
>source, and MC_1 tells it to count up to the value in TA0CCR0.
>
> P1DIR|=BIT1+BIT2+BIT3+BIT4;
> P1OUT|=BIT1+BIT3;
> P1OUT&=~(BIT2+BIT4);
>
>}
>BIT1=IN1;
>BIT2=IN2;
>BIT3.=IN3;
>BIT5=IN4;
>
> Both enable pins are connected P1.6 PWM output. I hope you can
>provide information. Regards.
>---------------------------------------
>Posted through http://www.EmbeddedRelated.com
---------------------------------------
Posted through http://www.EmbeddedRelated.com
Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
L298 PWM Problem "engineergc" <116985@EmbeddedRelated> - 2017-03-26 22:49 -0500
Re: L298 PWM Problem "engineergc" <116985@EmbeddedRelated> - 2017-03-26 23:07 -0500
Re: L298 PWM Problem Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2017-03-27 14:39 +0300
Re: L298 PWM Problem Tim Wescott <tim@seemywebsite.com> - 2017-03-27 11:49 -0500
Re: L298 PWM Problem "engineergc" <116985@EmbeddedRelated> - 2017-03-29 06:15 -0500
Re: L298 PWM Problem Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2017-03-29 14:34 +0300
Re: L298 PWM Problem "engineergc" <116985@EmbeddedRelated> - 2017-03-29 07:00 -0500
Re: L298 PWM Problem "engineergc" <116985@EmbeddedRelated> - 2017-03-29 07:04 -0500
Re: L298 PWM Problem Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2017-03-29 18:58 +0300
Re: L298 PWM Problem Tim Wescott <tim@seemywebsite.com> - 2017-03-29 11:19 -0500
Re: L298 PWM Problem Tim Wescott <tim@seemywebsite.com> - 2017-03-29 11:32 -0500
Re: L298 PWM Problem Tim Wescott <tim@seemywebsite.com> - 2017-03-27 11:50 -0500
Re: L298 PWM Problem Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2017-03-27 21:12 +0300
Re: L298 PWM Problem "engineergc" <116985@EmbeddedRelated> - 2017-03-29 05:52 -0500
Re: L298 PWM Problem "engineergc" <116985@EmbeddedRelated> - 2017-03-29 06:22 -0500
csiph-web