×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Interfacing PIC to logic circuits

Interfacing PIC to logic circuits

Interfacing PIC to logic circuits

(OP)
I am using a PIC18F452 to run program controlling a stepper motor and i need to interface a driver circuit to supply the power needed to move the motor. The program works fine and the logic output from the PIC is good. My problems come at the power stage. I have tried the ULN2804A witch is a hex driver that can operate at 50v max and 500 mA max but i cant get any output from it. Then i tried to use the discret components approch. My goal was to inverts the logic signals from the PIC using a DM74LS04N and use it to controls tansistors but the inverter behavied weerdly (some of the pin had 0.88v, other were at 2.8v, other at 4.1). Could a PIC be unable to drive some type of inverter? I am developping on a breadboard, could the signal from the crystal cause noise on the circuit?

RE: Interfacing PIC to logic circuits

Sounds like this is a relatively small motor as far as power requirements. I am not familiar with interfacing to stepper motors but for standard type motors we almost always used a transistor driver to energize a relay (all on board with the electronics and this energizes a contactor). This affords you some isolation between the motor and the electronics. Some might even use an opto. There should be no reason to invert the logic to make this work (again, maybe steppers have some strange requirements but I dont see why this would be necessary).

You should be able to use normal NPN type transistors (depends on load) on each output of the PIC to drive the load (with appropriate resistors in the base).

RE: Interfacing PIC to logic circuits

If you just put resistor pullups (instead of the stepper coils) at the output of the ULN2804 do you see the expected waveforms?

Are you sure that you are working with the right type of stepper for your logic?  Unipolar vs bipolar coils?

Inverting the logic?  Since you have a PIC you can just invert the outputs from your program.

Too many things that you don't seem to master.  It sounds like a school project...

RE: Interfacing PIC to logic circuits

(OP)
I may still be at school, but this isnt a school project. :) With pullups the drivers output are fine. Forget about the inverter, i had to use the both signal, inverted and non-inverted, on the discret components circuit. Its hard to explain without showing you the circuit. The program use bipolar coniguration. Ill stick with the driver. The motor, witch come from a deceased printer, should make steps when i follow this sequence for its four "coils"
0101
0110
1010
1001
(repeat)

Thanks for the help

RE: Interfacing PIC to logic circuits

Czin:

Google for ""hook up stepper motors"" and things like it.
There are a huge number of sites that show schematics and explain EVERYthing about these buggers.  Here's just one of them from the Embedded Systems Programming an excellant engineering magazine.  Note: Figure 8.

http://www.embedded.com/story/OEG20030410S0057

The main thing you need to do is puzzle out what kind of stepper motor you've stumbled across otherwise you will let the smoke out of it and have a lot of frustration.

RE: Interfacing PIC to logic circuits

Hi,if I remember right the driver is just a darlington array, I cant be bothered to look it up, in which case you can't get bipolar drive, only unipolar. You will also need a fairly high drive voltage and a series resistor in each line to limit the current.

RE: Interfacing PIC to logic circuits

Hi-

For a bipolar stepper with the "defunct printer" stepper motor
class, you might wander over to the fine site:

http://www.cs.uiowa.edu/~jones/step/


For a bipolar design, you have to have an H bridge circuit.

By going to that link you can find both a circuit and
more importantly the theroy behind it.  For the stepper
that I implemented, I used good old 2N2222's and 2K
resistors. Ran it off 12 Volts and drove the logic with
a 16F648A PIC.  Runs just fine.

Fun project.

BTW, I'm not affiliated with the univ. of Iowa, nor
professor Jones.  He just has a great site for stepper
motors.

Oh, and noise from the crystal will NOT be a problem
with this.


Hope this helps!

  Cheers,

    Rich S.

RE: Interfacing PIC to logic circuits

(OP)
Thanks for the info guys i found what i was doing wrong. I was mess up between unipolar and bipolar. So with few change to my code i am now able to drive unipolar motor with a darlington driver and will soon be able to drive a bipolar with an H bridge.

RE: Interfacing PIC to logic circuits

Cool glad that you figured it out.  Just to clarify, you should have no problem running the gate of a FET directly from the PIC.  In fact, I am doing that right now with a circuit that I designed.  The PIC pins can usually sink between 10 and 25mA depending on which model you get.  I am passing 28V and about 4A through each FET when I turn it on (it's a high torque stepper motor).  Luckily for me I only have to have it on for about 2 seconds, so heat is not a big issue.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources