Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC to ULN2803 to Stepper Motor Interface

Status
Not open for further replies.

jenny1985

New Member
Hi,
I connected a PIC16F84 to a ULN2803 5volt driver to a 5volt 6-wire stepper motor. The motor was running for about 20 seconds, then stopped and it will not start again. Even if I turn off power and turn it back on.
Here is my code to control / pulse the stepper motor.
Attached is my schematic. Any idea why it would quit and then not work again?
Jen


start

movlw 0x00
tris PORTA

loop
movlw b'00000101'
movwf PORTA
call DELAY_20
movlw b'00001001'
movwf PORTA
call DELAY_20
movlw b'00001010'
movwf PORTA
call DELAY_20
movlw b'00000110'
movwf PORTA
call DELAY_20
goto loop
 

Attachments

  • stepper.JPG
    stepper.JPG
    35.4 KB · Views: 21,291
The ULN2803 continuous collector current is 500ma - so you most likely didnt burn the transistors out..

The code looks fine, although im do not know which digital sequence is used to drive unipolar stepper.

Although I highly doubt it - could the stepper be out of range of the magnets (though i didnt even think this is possible)

If it made a full rotation then the above problem should not be consider^

I wish I could give some better insight.. im sure a more expierenced member will post soon.

Goodluck
 
You don't have current limiting resistors at the input to the ULN. The PIC can output 20mA minimum, the max is not specified. Perhaps the base-emitter junction is fried, use your diode checker to see if the ULN input still looks like a diode.
 
Sorry... Actually, yes I do have it grounded. I just neglected to put in the gnds on the schematic to speed things up for posting the picture. Yes, it was very weird, it worked for a while then stopped, I reprogrammed the PIC with some updated code and tried it again and it worked for about 20-30 seconds then stopped and didn't go again.
Any other ideas?
Jen
 
Last edited:
Got it!
MCLR needed to be tied high via 100 ohm resistor... and I had to lower my delay - it was a little too quick.

Thanks for all the help guys! You have proved to be a valuable resource!
 
i need program 180 degrees right and 180 degrees left in hex code to run stepper motor
i make project
please help me
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top