L293 Driver not stopping

**Completely **

Completely

 

Grab your oscilloscope and

Grab your oscilloscope and get another trace of that enable line, this time with no L293 installed. I’ve used L293/298s many times and never had anything this weird happen when all pins were being driven…

Could it be flyback from motors?

Could it be flyback from motors? L293 doesn’t have internal flyback diodes like L293D and your schematic doesn’t have them. Here’s a quote from the datasheet (http://www.datasheetcatalog.org/datasheet/texasinstruments/l293.pdf):
"On the L293, external high-speed output clamp diodes should be used for inductive transient suppression."

I haven’t used L293s myself so I cannot tell how it affects your system if you don’t have flyback diodes (I have only used L293Ds). Anyway it could be worth trying to add flyback diodes if you don’t already have them. Block diagram on the page 2 of the datasheet shows how to connect them.

 

Oh sorry it is a

Oh sorry it is a L293D.

Question are the pull down resistors needed on the input pins?

Could capacitors help?

The pull-down resistors

The pull-down resistors ensure that the inputs go logic low when there’s nothing driving them. In your case every input pin is connected to an output on your Atmega, so they’re not really required.
Capacitors can help filter out noise on the signal lines, but unless the lines between the Atmega and L293D are really long there shouldn’t be much noise picked up anyway. Also your Atmega outputs are driving the lines directly, which would suppress any minor electrical noise you might pick up.

What sort of power supply arrangement are you using? A photo of your setup might anwer some questions if you can post one (or a few even).

So this is my full

full.jpg

So this is my full schematic, as it currently stand. I've removed the pull down resistors from the forward and enable pins just coz i was messing with caps etc, and they don't seem to make much difference.

The holes out on the right are where optocouplers go but I removed them to make sure they weren't screwing me.

Another interesting point is that when I program with the serial the motors start running. This usually means I have to take the motor driver out to program.. which I imagine can't be right.

The schematic’s been scaled

The schematic’s been scaled down too much (probably by LMR) to make out the pin names etc… but the general layout looks ok.

Would it be possible to get an actual photo of the hardware too?

The power supply is 4x1.5V

The power supply is 4x1.5V batteries in series. However they’ve long since run out so I’m now running off a variable DC power supply at 6V. Sorry I don’t have a camera on me, but full circuit has been posted.

 

What’s the current rating of

What’s the current rating of the variable supply?
If the current draw of the Atmega + motors, etc, exceeds the rated supply then you’ll usually get continuous resets on your microcontroller, which causes some weird behaviour.

ah… I think the max is 3V.

ah… I think the max is 3V. However when I’m using it for the robot, its says 0.44A

its a Topward dual track dc power supply 6303D

Sorry i meant 3A.Also does

Sorry i meant 3A.

Also does solder flux conduct?

I have a spray remover… but not sure how to use it.

Do you just spray it on and get a cloth to wipe away?

 

So after some cleaning with

So after some cleaning with the spray and a brush, i can now get either motor going!

However I cannot get two… when I ask for two only one goes

Nice! Solder flux normally

Nice! Solder flux normally doesn’t conduct, but it can traps little bits of metal debris from soldering that will create a short.

The problem with only one motor going at a time is probably code related, since the two drivers inside the L293D don’t have many common internal connections where they can interfere with each other.

I take it back they both

I take it back they both seem to work, although with minor faults. Like when i add power everything goes 4 a second.

However working motors is all i need because ive only got 3 days to do all the code for the actual turning etc.

Thanks for your help, and sorry for taking so much time for what appears to have been an amateur mistake…

Adding pull-down resistors

Adding pull-down resistors back onto your enable lines should stop this. The PORTD pins default to inputs on reset, so the enable lines aren’t pulled low until the Atmega starts up and gets to the line where you set DDRD - this allows the motors to turn on briefly when power is first connected.

This time maybe use some smaller resistors, it looks like the ones you used are 47kΩ, which is quite a weak pull-down. I usually use something in the 10-20k range when working with ~5V logic.

And no problem about the help, debugging stuff is always good practice for both parties, although I feel vindicated in my earlier suggestion that there was a short circuit on the L293 =D