another L293D question

BotB

Member
but this time it's really stoopid...

Hey all, I'm new to PICs and recently purchased the 28X1 starter pack, I've got along superbly with simpler code for LED's and such but my main need is to controll motors... As such I purchased the L293D for the PICAXE board along with two little "toy" motors (the sort you get with the gears)...

Now I understand the code around making the motor go forwards and backwards...

start:
low 1
high 2
pause 1000
low 1
low 2
pause 1000
high 1
low 2
pause 1000
goto start:

but I've no idea what outputs to attach the motor too... I'm a complete novice with electronics so please bear with the dense question...

in short... what outputs do I attach the motor to?

Many thanks!
 

marcos.placona

Senior Member
The mottor will be connected to your L293D, and when it says low 1, that means (pin one low) and high two means (pin 2 high) and so on. To know the pin numbers, just go to the manual, and you'll see things like output 1, output 2 etc. Those are the pin numbers.

As you are sending data to the L293, you'll be using outputs. If you were receiving, you'd be using inputs

From this image:



You can see where you're gonna be connecting.

Any more questions please let us know, and we can even send you a more detailed example.
 

Rickharris

Senior Member
Good call Marcos - Just to underline for a beginner - The motor(s) is(are) connected to pins 3 and 6 and/or pins 14 and 11.

The signals from the picaxe are conected to pins 2 and 7 to control the left motor and pins 10 and 15 to control the right motor.

remember that the L293 is capable of providing around 1.2 Amps of current if you exceed that and the IC overheats it will cut out to protect itself - Many students wonder why their high current motor isn't working.
 

marcos.placona

Senior Member
With toy motors it should be fine. Even stalled they'll never go over 1 amp

It's important to understand why you are using the L293D, as one of the reasons is known (forward and reverse) and also to power the motor itself.

A picaxe can't really provide enough power to a motor, but the L293D will be able to provide all the power necessary
 

BotB

Member
indeed thank you for the information and diagrams but the L293D is connected to the project board...
This one to be exact


So what output pins on the board should I connect the motor to?

http://www.rev-ed.co.uk/docs/AXE020.pdf
This data sheet of the "28 pin project board" states the L293D runs through outputs 4 to 7... so does this mean that one wire from the motor needs to be on 4 and the other on 5?

I'm sorry it's real annoying of me to not understand but once I know then I'm fine...
 
Last edited:

BeanieBots

Moderator
The information is on page 4 of the pdf that you provided a link to.
It's the very last line on the page.

If you have a look at the board between the output connector and the power supply pads, you will see four pads labelled as two pairs "A" and "B".
You need to connect the two motors to the pads "A" and "B" respectively.

Motor "A" is controlled with outputs 4 & 5
Motor "B" is controlled with outpust 6 & 7
 

slurp

Senior Member
Don't forget the ENABLE pins.... these can disable you motor even if the input are correct for driving your motor. I usually hard wire these in the circuit or use a jumper to take them High or Low to suit what I'm testing but you could connnect them to another output if you want them under PICaxe (software) control.

Have a read through the data sheet for the L293D (you can find it via Google easily), some parts of it might be confusing at first but others will be useful. As you learn more of the information will become useful ;)

best regards,
colin
 

BotB

Member
Thanks alot for the help! I'm can't believe I never noticed those outputs "A and B"

Could you elaborate on these "ENABLE pins"?

So I simply connect the motor to either output A/B and use a code like:
High 4
Low 5
To controll the motors movement?

Many thanks... Why couldn't the manual just say this instead of confusing the hell outta me?
 

BeanieBots

Moderator
On the AXE020 the enable line is held high permanently. You will need to cut a track if you wish to control it.
Other than that, just set outputs 4,5,6 & 7 high/low accordingly to control your motors.

I agree that the manual is a little confusing regarding the L293D option:confused:
 

BotB

Member
Ah thanks!

And the manual is crazy! the index often leads you to the wrong pages... But I did learn alot from the fron sections explaining EEPROMS and all that... Quite interesting reading.
 

slurp

Senior Member
Sorry I was skim reading on the train... missed the kit bit, yes don't worry about the enable there (just remember something about it if you build other circuits ;) )

regards,
colin
 
Top