Thanks,
I'll try your solution when I get my stepper motors running. They seem to just vibrate, and I'm sure the wiring is correct as I had it working on a PIC16F877.
Cheers,
Sterling
Thanks,
I'll try your solution when I get my stepper motors running. They seem to just vibrate, and I'm sure the wiring is correct as I had it working on a PIC16F877.
Cheers,
Sterling
If your steppers are on PORTA or PORTB. ADCON1 will probably fix them too.
<br>
DT
I tried that:
DEFINE OSC 48
ADCON1 = $0F
' set variables:
x VAR BYTE
steps VAR WORD
stepArray VAR BYTE(4)
clear
TRISB = %11110000
PORTB = 255
Pause 1000
stepArray[0] = %00001010
stepArray[1] = %00000110
stepArray[2] = %00000101
stepArray[3] = %00001001
main:
if 1 = 1 then
steps = steps + 1
else
steps = steps - 1
endif
PORTB = stepArray[steps //4]
pause 2
GoTo main
you may wonder about some of the code. It was originally written for a button to determine the direction, but to make it less confusing, I just say 1=1 to get to the heart of the code. I could have taken it out, but it will go back in.
-Sterling
I figured as much.
When I look at this page ...
http://www.sas.org/E-Bulletin/2002-0...ctro/body.html
Your phase sequence seems to be different.
I guess it depends on which pin connects to which phase.
Might try a little more than 2ms delay to start too.
<br>
DT
I've monkeyed around with the delay, gone all the way up to 20ms.
I had this wiring working on another PIC, so I am pretty sure it should work, unless that program, written ASM was sending different bytes out the port.
I'll check, if I can decipher it.
Cheers,
Sterling
So I looked into the ASM code that sucessfully drove the motor, and made the BYTE output changes to match, but still no luck.
I'm wondering if it could have something to do with the chips high speed of 48MHz?
-Sterling
Bookmarks