Arduino L293B problem

Hi,
In the last two days I’m trying to understand this problem, googled a lot, tried various wiring but useless, so I turned to forum…

What problem?

Well, I got two L293B and two L293E chips, picked up one, and wired it in standard way as described in the datasheet for driving 2 motors. I put diods from GND to each motor output and from there to the motor VS. Then to test it, i connected Arduino digital 7 and 8 to in1 and in2, and digital 9 as pwm to en1. Finally connected motor power and motor wires to the chip…and…

The motor moves only in one direction! My test code is this:

void setup()
{
  digitalWrite(7, HIGH);
  digitalWrite(8 ,   LOW);
}

void loop()
{
  analogWrite(9, 250);
}

now if I replace 7 and 8 in digitalWrite() there, i.e. to reverse the motor, it stays moveless, while in on direction it moves ok, and in that direction pwm works fine!

Overall: in one direction everything seems correct, motor is controllable with pwm. In the other direction it stays moveless, as if nothing received!

What I next did?
Tried various scenarios, I changed my diods so if there is something wrong with them I figure it out but no problem. Then I replaced the chip itself switched between my L293E and L293B … all the same! clearly something wrong with my understanding, but what?!

Please help me, pointing out of the problem :slight_smile:

schema_Mine.TIF (41.6 KB)

I found a strange event by an experiment:

  1. I disconnected the motor, diods, only left chip and connections to Arduino and powers
  2. setup: my Arduino digital pins 7 and 8 are giving logic 0 and 1, and 9 is issuing pwm signal
  3. I measured motor outputs of L293: out1 gives 12v as it should be and the other 1v, ok
  4. I reversed and measured: I get both of outs on 1v, wrong!
  5. strange: I disconnected pin 8 and 7, which were set in software to high/low, and connected in1 and in2 to +5 and GND of Arduino instead

Now I get 12v on out1 and 1v on out2, and if I reverse in1 and in2 I get out1 and out2 reversed correctly!
After discunnecting from Arduino digital pins, things started to work ok!

Outcome: Arduino chip damaged?

?

If you change the mode of your pins (7, 8 and 9) to output, I trust you will see some progress.

http://www.arduino.cc/en/Reference/PinMode