Can't control DIR pin on stepper driver ST-M5045

I am controlling an ST-M5040 stepper motor driver with an Arduino Pro Mini. Mostly working ok, stepping fine, but having a bit of a prob controlling the Direction pin on the driver box. I have pin 11 (PORTBP3) set as an input (default, no PinMode). The diargram with the controller shows the control pins on it are going to an opto-isolator. The DIR pin is at around 3.8 volt and will cause the motor to reverse if I short it to ground.

When DIR- (DIR+ is VCC - 5V) on the contoller is tied to the Arduino, I can't get it to pull ground/LOW. With the controller wire disconnected, my button presses show pin 11 going from HIGH (4.9v), to LOW (0v) as coded. When I re-connect the controller to pin 11 (Via connector blocks), it will go to 4.9v, but when Arduino goes LOW, the pin shows the 3.8 volts on the contoller! AFAIK all my grounds and voltages are common, and have checked for other wiring errors.

I suspect I'm missing something in the setup of the Arduiono pins or a major ground/voltage setup This shouldn't be that hard to do!

Any clues as to where I've gone wrong would be of great help. NOT a coding issue - more of a config issue I'm gussing.

=Alan R.

Can you post a link to the specs for the stepper driver?

...R

HERE IS A tINY-url LINK TO A pdf ON THE DRIVER: http://tinyurl.com/k5h2tbo
i'M NOW THINKING i MAY NEED TO JUST TIE THE dir- LINE TO A SWITCH AND PULL IT HARD TO GROUND FOR REVERSING.

=a.

Robin2:
Can you post a link to the specs for the stepper driver?

...R

According to the specs that controller has 240 ohm resistor in series with its opto isolator
so you should not be seeing that error voltage on the pin.

I suspect one of two things:

  1. The spec is wrong and you are required to provide your own 240 ohm resistor.
  2. You have mis-wired something.

Harrzack:
I have pin 11 (PORTBP3) set as an input (default, no PinMode).

Have found the prob! It seems Pin 11 was a bad choice. :blush:

I saw a video by NYCCNC (John) using the same controller and his DIR- was hooked to pin 8. Changed to that pin and it works just fine - ENA- Also works from that pin as an OUTPUT.

I am using timer 1 so there may have been a subtle conflict going on there... Thanks to all who replied

=Alan R.

But timer1 doesn't talk to pin 11...

Ah yes, you do need to set it as an OUTPUT...