Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: aruna1 on October 09, 2008, 09:51:27 AM

Title: driving 2 dc motors using single 16F877A help
Post by: aruna1 on October 09, 2008, 09:51:27 AM
is it possible to drive 2 DC motors using A 16F877A?(through L298) 16F877A has 2 PWM pins(pin 16 and 17) and L298 has 2 input pins per motor(total 4 inputs for bot motors) so is it possible to drive two motors or 16F877A can drive only one motor? ???
I have attached L298 data sheet here
Title: Re: driving 2 dc motors using single 16F877A help
Post by: Trumpkin on October 09, 2008, 10:12:02 AM
The l298 has 1 pwm pin per motor, enable A and enable B. (I think)
Title: Re: driving 2 dc motors using single 16F877A help
Post by: ArcMan on October 09, 2008, 11:34:32 AM
Yes it is possible.  I do it all the time.  The 877A has 2 PWM's, the L298 has 2 H-bridges.  Viola!

Make sure you study the L298 circuits.  Search previous posts for a picture of my L298 motor drive.  Don't forget the flyback diodes with the L298.

Title: Re: driving 2 dc motors using single 16F877A help
Post by: aruna1 on October 09, 2008, 12:40:49 PM
@trumpking and Arcman

I found what i was looking for.Thanks.

by the way is it possible to use 1N4007 as diodes of L298? ???
Title: Re: driving 2 dc motors using single 16F877A help
Post by: ArcMan on October 09, 2008, 01:25:55 PM
No.  1N4007's are standard recovery diodes.  You must use fast recovery diodes.
Title: Re: driving 2 dc motors using single 16F877A help
Post by: sysysy on November 26, 2010, 12:09:43 PM
Can anyone tell me what is the purpose of fly back diode use in l298 and motor circuit?
Title: Re: driving 2 dc motors using single 16F877A help
Post by: little-c on November 26, 2010, 02:29:11 PM
basicly, it stops current from going the wrong way. and therfore stuff frying.
Title: Re: driving 2 dc motors using single 16F877A help
Post by: Soeren on November 26, 2010, 11:06:45 PM
Hi,

Can anyone tell me what is the purpose of fly back diode use in l298 and motor circuit?
To stop the fly back voltage of course  :P

Motors are inductive. When you remove power from an inductor, it gives an inductive kick that can easily amount to hundreds of volts for very short periods and which is of the opposite polarity of what it was fed.
Relays and solenoids are other examples where inductive kick back occurs.

Diodes are often the next best way to handle this. It's easy, but a snubber circuit can be tailored for fastest switching, most power transferred switching etc. In some circuits, zener diodes are used for faster switching.

However, it's a bit pessimistic saying that it should always be high speed diodes and I think that statement reveals a person that has never made any actual measurements and spec'd up what's needed - a bit like those saying that any circuit using a 555 needs a 100nF cap on pin 5 (of which more than half probably don't even know or care what its purpose is).