0
\$\begingroup\$

Edit: setting the Wait time to 0.1 causes it to make music, yay?

I've managed to get the steppers to react to xSTP with this code:

#include "mbed.h"

DigitalOut xEN(P2_1); //Pin 74 of LPC
DigitalOut xSTP(P2_2); //Pin 73 of LPC
DigitalOut xDIR(P2_6); //Pin 67 of LPC

//DigitalOut yEN(P2_8); //Pin 65 of LPC
//DigitalOut ySTP(P0_19); //Pin 59 of LPC
//DigitalOut yDIR(P0_20); //Pin 58 of LPC

int main() {

xDIR = 0;
xEN = 0;
for(int i = 0; i < 100; i++){

        xSTP = 1;
        wait(1);
        xSTP = 0;
        wait(1);
    }

}

but now the motor just holds torque, but don't move. It does however make a slight vibration every 1 second though

I'm trying to get the SKR V1.3 board here: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.3/hardware/SKR-V1.3-SCH.pdf

to send 1 second pulses on xSTP and ySTP to get my stepper motors moving, using the MBED framework's LPC1768 pin definitions. They work with Merlin G-code instructions but im trying to get them to work with mbed. Is there something im missing?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ How about you temporarily start over with an empty program, disconnect the stepper driver, and just try to make those GPIOs both blip on and off at a slow enough rate that you can tell they are working with an LED or multimeter or whatever test equipment you have handy (eg, a scope would be great if you have one, but...) \$\endgroup\$ – Chris Stratton Oct 19 '20 at 22:38
  • \$\begingroup\$ Why did you remove the firmware and micro controller tag? This involves the LPC1768 chip. \$\endgroup\$ – dragonking3002 Oct 20 '20 at 19:44
  • \$\begingroup\$ That this involves firmware or a microcontroller is useless and thus merely tag pollution - why would anyone reading those tags be interested in this question? Your issue is perhaps with a stepper motor, but really with not understanding how to get mbed style program to do what you want, so those are the tags that are possibly meaningful. \$\endgroup\$ – Chris Stratton Oct 21 '20 at 18:53
0
\$\begingroup\$

The awnser was much simpler then expected....

I felt the steppers move very very slightly when I first turned them on so I set the wait interval to 0.001 instead of 1 to see if that was the problem and the steppers now spin without issue........

#include "mbed.h"

DigitalOut xEN(P2_1); //Pin 74 of LPC
DigitalOut xSTP(P2_2); //Pin 73 of LPC
DigitalOut xDIR(P2_6); //Pin 67 of LPC

//DigitalOut yEN(P2_8); //Pin 65 of LPC
//DigitalOut ySTP(P0_19); //Pin 59 of LPC
//DigitalOut yDIR(P0_20); //Pin 58 of LPC

int main() {

xDIR = 0;
xEN = 0;
for(int i = 0; i < 20000; i++){

        xSTP = 1;
        wait(0.001);
        xSTP = 0;
        wait(0.001);
    }

}
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.