Im trying to get my steppers to spin with the SKR 1.3V using the LPC1768 chip to spin its stepper motors but enabling xDIR, and xSTP does nothing, while just enable xEN with no code causes the motor to hold in place!
#include "mbed.h"
DigitalOut xEN(P2_1); //Pin 74 of LPC
int main(){
}
Not-initializing the xEN but still using the xDIR/xSTP pins will cause the motors to do nothing instead.
I’ve tried confirming what combination of enabling and disabling will make the motors spin with this:
#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
void spinattempt()
{
for(int i = 0; i < 3; i++){
xEN = 0;
thread_sleep_for(1000);
xEN = 1;
thread_sleep_for(1000);
}
xEN = 0;
for(int i = 0; i < 3; i++){
xDIR= 0;
thread_sleep_for(1000);
xDIR = 1;
thread_sleep_for(1000);
}
for(int i = 0; i < 3; i++){
xSTP = 0;
thread_sleep_for(1000);
xSTP = 1;
thread_sleep_for(1000);
}
}
int main() {
xEN = 0;
xDIR = 0;
xSTP = 0;
//Should keep spinning till I unplug the SKR V1.3
while(1) {
spinattempt();
}
}
but it does nothing. except hold the motor in place.
Is there something I need to do with the pin definitions or something else i’m missing?
SKR 1.3V schematic