Shop OBEX P1 Docs P2 Docs Learn Events
Help with L293D — Parallax Forums

Help with L293D

mynet43mynet43 Posts: 644
edited 2009-07-27 17:58 in Propeller 1
I'm designing a circuit to use a single L293D chip to control up to two motors.

I'm considering Tim Moore's tb6612-2.spin object to drive the chip.

The documentation at the front of the code says:
L293D (e.g. PPDB), SN754410NE
IN1 is ch0, IN2 is ch1, EN0,1 is PWM1 for 1st motor
IN1 is ch2, IN2 is ch3, EN2,3 is PWM2 for 2nd motor
StbyPin set to -1
SLOW_PWM_SPEED should be used for L293D and SN754410NE

I need to connect L293D pins 1, 2, 7, 9, 10 and 15 to the Propeller. I know that the Prop pins must start at 0, 8, 16...

What I can't figure out is the pin order for the Prop. It looks like 1 and 9 should come first, since they're the PWM pins. It's not clear what the order of the rest of the pins should be.

He also refers to a sample routine called 4wdbot.spin, which I haven't been able to locate.

All I'm trying to do is to control speed and direction of the two motors. Does anyone have the pin mapping needed to make this work.

I'd also be happy with alternative code that's available.

Thanks for the help.

Jim

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2009-07-27 16:23
    Heres a complete example of a l293d using that object.

    I normally connect pin 0 and 1 to the 2 en and pin 2-5 to in1-4 but the requirement is that the enables are all connected within the same set of 8 pins (0-7, 8-15, 16-23, 24-31). Thats a requirement of pwmx8. You specifiy the 1st en pin and the offsets to the others.
    The IN pins can be connected to any pin.

    Post Edited (Timmoore) : 7/27/2009 4:38:26 PM GMT
  • mynet43mynet43 Posts: 644
    edited 2009-07-27 17:13
    Thanks Tim!

    That's a big help!

    It's not clear how you would specify the IN pins to any pin??

    Here's what I'm assuming, with ref to pin 0:

    Prop L293D

    0 to chip 1 en 1,2
    1 to chip 9 en 3,4
    2 to chip 2 1A
    3 to chip 10 3A
    4 to chip 7 2A
    5 to chip 15 4A

    Does this look right? If it does, I'll do it.

    Thanks again,

    Jim
  • TimmooreTimmoore Posts: 1,031
    edited 2009-07-27 17:43
    I normally do
    0 to chip 1 en 1,2
    1 to chip 9 en 3,4
    2 to chip 2 1A
    3 to chip 7 2A
    4 to chip 10 3A
    5 to chip 15 4A
    but yours would work as well. I just find my layout easier to remember.
  • mynet43mynet43 Posts: 644
    edited 2009-07-27 17:58
    Thanks Tim,

    I like yours better. I'll use it.

    Now that I see all of the code it makes much more sense.

    Thanks for the help.

    Jim
Sign In or Register to comment.