Browse Source

Add stepper MS3 support

Co-Authored-By: TheLongAndOnly <thelongandonly@users.noreply.github.com>
pull/1/head
Scott Lahteine 6 years ago
parent
commit
45e738876a
  1. 14
      Marlin/src/gcode/control/M350_M351.cpp
  2. 34
      Marlin/src/inc/Conditionals_post.h
  3. 244
      Marlin/src/module/stepper.cpp
  4. 2
      Marlin/src/module/stepper.h
  5. 87
      Marlin/src/pins/pins.h
  6. 36
      Marlin/src/pins/pinsDebug_list.h
  7. 3
      Marlin/src/pins/pins_RURAMPS4D_11.h

14
Marlin/src/gcode/control/M350_M351.cpp

@ -41,17 +41,21 @@ void GcodeSuite::M350() {
/** /**
* M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B * M351: Toggle MS1 MS2 pins directly with axis codes X Y Z E B
* S# determines MS1 or MS2, X# sets the pin high/low. * S# determines MS1, MS2 or MS3, X# sets the pin high/low.
*/ */
void GcodeSuite::M351() { void GcodeSuite::M351() {
if (parser.seenval('S')) switch (parser.value_byte()) { if (parser.seenval('S')) switch (parser.value_byte()) {
case 1: case 1:
LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1); LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1, -1);
if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1); if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1, -1);
break; break;
case 2: case 2:
LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte()); LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte(), -1);
if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte()); if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte(), -1);
break;
case 3:
LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, -1, parser.value_byte());
if (parser.seenval('B')) stepper.microstep_ms(4, -1, -1, parser.value_byte());
break; break;
} }
stepper.microstep_readings(); stepper.microstep_readings();

34
Marlin/src/inc/Conditionals_post.h

@ -236,25 +236,36 @@
#define MAX_AUTORETRACT 99 #define MAX_AUTORETRACT 99
#endif #endif
// MS1 MS2 Stepper Driver Microstepping mode table // MS1 MS2 MS3 Stepper Driver Microstepping mode table
#define MICROSTEP1 LOW,LOW #if DISABLED(MICROSTEP_CUSTOM)
#define MICROSTEP1 LOW,LOW,LOW
#if ENABLED(HEROIC_STEPPER_DRIVERS) #if ENABLED(HEROIC_STEPPER_DRIVERS)
#define MICROSTEP128 LOW,HIGH #define MICROSTEP128 LOW,HIGH,LOW
#else #else
#define MICROSTEP2 HIGH,LOW #define MICROSTEP2 HIGH,LOW,LOW
#define MICROSTEP4 LOW,HIGH #define MICROSTEP4 LOW,HIGH,LOW
#endif #endif
#define MICROSTEP8 HIGH,HIGH #define MICROSTEP8 HIGH,HIGH,LOW
#ifdef __SAM3X8E__ #ifdef __SAM3X8E__
#if MB(ALLIGATOR) #if MB(ALLIGATOR)
#define MICROSTEP16 LOW,LOW #define MICROSTEP16 LOW,LOW,LOW
#define MICROSTEP32 HIGH,HIGH #define MICROSTEP32 HIGH,HIGH,LOW
#else #else
#define MICROSTEP16 HIGH,HIGH #define MICROSTEP16 HIGH,HIGH,LOW
#endif #endif
#else #else
#define MICROSTEP16 HIGH,HIGH #define MICROSTEP16 HIGH,HIGH,LOW
#endif #endif
#endif
#define HAS_MICROSTEP1 defined(MICROSTEP1)
#define HAS_MICROSTEP2 defined(MICROSTEP2)
#define HAS_MICROSTEP4 defined(MICROSTEP4)
#define HAS_MICROSTEP8 defined(MICROSTEP8)
#define HAS_MICROSTEP16 defined(MICROSTEP16)
#define HAS_MICROSTEP32 defined(MICROSTEP32)
#define HAS_MICROSTEP64 defined(MICROSTEP64)
#define HAS_MICROSTEP128 defined(MICROSTEP128)
/** /**
* Override here because this is set in Configuration_adv.h * Override here because this is set in Configuration_adv.h
@ -828,6 +839,7 @@
#define HAS_Z3_ENABLE (PIN_EXISTS(Z3_ENABLE)) #define HAS_Z3_ENABLE (PIN_EXISTS(Z3_ENABLE))
#define HAS_Z3_DIR (PIN_EXISTS(Z3_DIR)) #define HAS_Z3_DIR (PIN_EXISTS(Z3_DIR))
#define HAS_Z3_STEP (PIN_EXISTS(Z3_STEP)) #define HAS_Z3_STEP (PIN_EXISTS(Z3_STEP))
#define HAS_Z3_MICROSTEPS (PIN_EXISTS(Z3_MS1))
// Extruder steppers and solenoids // Extruder steppers and solenoids
#define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
@ -1003,7 +1015,7 @@
#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) #define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE))
// Digital control // Digital control
#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS) #define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS)
#define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))

244
Marlin/src/module/stepper.cpp

@ -2504,53 +2504,136 @@ void Stepper::report_positions() {
*/ */
void Stepper::microstep_init() { void Stepper::microstep_init() {
#if HAS_X_MICROSTEPS
SET_OUTPUT(X_MS1_PIN); SET_OUTPUT(X_MS1_PIN);
SET_OUTPUT(X_MS2_PIN); SET_OUTPUT(X_MS2_PIN);
#if PIN_EXISTS(X_MS3)
SET_OUTPUT(X_MS3_PIN);
#endif
#endif
#if HAS_X2_MICROSTEPS
SET_OUTPUT(X2_MS1_PIN);
SET_OUTPUT(X2_MS2_PIN);
#if PIN_EXISTS(X2_MS3)
SET_OUTPUT(X2_MS3_PIN);
#endif
#endif
#if HAS_Y_MICROSTEPS #if HAS_Y_MICROSTEPS
SET_OUTPUT(Y_MS1_PIN); SET_OUTPUT(Y_MS1_PIN);
SET_OUTPUT(Y_MS2_PIN); SET_OUTPUT(Y_MS2_PIN);
#if PIN_EXISTS(Y_MS3)
SET_OUTPUT(Y_MS3_PIN);
#endif
#endif
#if HAS_Y2_MICROSTEPS
SET_OUTPUT(Y2_MS1_PIN);
SET_OUTPUT(Y2_MS2_PIN);
#if PIN_EXISTS(Y2_MS3)
SET_OUTPUT(Y2_MS3_PIN);
#endif
#endif #endif
#if HAS_Z_MICROSTEPS #if HAS_Z_MICROSTEPS
SET_OUTPUT(Z_MS1_PIN); SET_OUTPUT(Z_MS1_PIN);
SET_OUTPUT(Z_MS2_PIN); SET_OUTPUT(Z_MS2_PIN);
#if PIN_EXISTS(Z_MS3)
SET_OUTPUT(Z_MS3_PIN);
#endif
#endif
#if HAS_Z2_MICROSTEPS
SET_OUTPUT(Z2_MS1_PIN);
SET_OUTPUT(Z2_MS2_PIN);
#if PIN_EXISTS(Z2_MS3)
SET_OUTPUT(Z2_MS3_PIN);
#endif
#endif
#if HAS_Z3_MICROSTEPS
SET_OUTPUT(Z3_MS1_PIN);
SET_OUTPUT(Z3_MS2_PIN);
#if PIN_EXISTS(Z3_MS3)
SET_OUTPUT(Z3_MS3_PIN);
#endif
#endif #endif
#if HAS_E0_MICROSTEPS #if HAS_E0_MICROSTEPS
SET_OUTPUT(E0_MS1_PIN); SET_OUTPUT(E0_MS1_PIN);
SET_OUTPUT(E0_MS2_PIN); SET_OUTPUT(E0_MS2_PIN);
#if PIN_EXISTS(E0_MS3)
SET_OUTPUT(E0_MS3_PIN);
#endif
#endif #endif
#if HAS_E1_MICROSTEPS #if HAS_E1_MICROSTEPS
SET_OUTPUT(E1_MS1_PIN); SET_OUTPUT(E1_MS1_PIN);
SET_OUTPUT(E1_MS2_PIN); SET_OUTPUT(E1_MS2_PIN);
#if PIN_EXISTS(E1_MS3)
SET_OUTPUT(E1_MS3_PIN);
#endif
#endif #endif
#if HAS_E2_MICROSTEPS #if HAS_E2_MICROSTEPS
SET_OUTPUT(E2_MS1_PIN); SET_OUTPUT(E2_MS1_PIN);
SET_OUTPUT(E2_MS2_PIN); SET_OUTPUT(E2_MS2_PIN);
#if PIN_EXISTS(E2_MS3)
SET_OUTPUT(E2_MS3_PIN);
#endif
#endif #endif
#if HAS_E3_MICROSTEPS #if HAS_E3_MICROSTEPS
SET_OUTPUT(E3_MS1_PIN); SET_OUTPUT(E3_MS1_PIN);
SET_OUTPUT(E3_MS2_PIN); SET_OUTPUT(E3_MS2_PIN);
#if PIN_EXISTS(E3_MS3)
SET_OUTPUT(E3_MS3_PIN);
#endif
#endif #endif
#if HAS_E4_MICROSTEPS #if HAS_E4_MICROSTEPS
SET_OUTPUT(E4_MS1_PIN); SET_OUTPUT(E4_MS1_PIN);
SET_OUTPUT(E4_MS2_PIN); SET_OUTPUT(E4_MS2_PIN);
#if PIN_EXISTS(E4_MS3)
SET_OUTPUT(E4_MS3_PIN);
#endif
#endif #endif
#if HAS_E5_MICROSTEPS #if HAS_E5_MICROSTEPS
SET_OUTPUT(E5_MS1_PIN); SET_OUTPUT(E5_MS1_PIN);
SET_OUTPUT(E5_MS2_PIN); SET_OUTPUT(E5_MS2_PIN);
#if PIN_EXISTS(E5_MS3)
SET_OUTPUT(E5_MS3_PIN);
#endif
#endif #endif
static const uint8_t microstep_modes[] = MICROSTEP_MODES; static const uint8_t microstep_modes[] = MICROSTEP_MODES;
for (uint16_t i = 0; i < COUNT(microstep_modes); i++) for (uint16_t i = 0; i < COUNT(microstep_modes); i++)
microstep_mode(i, microstep_modes[i]); microstep_mode(i, microstep_modes[i]);
} }
void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2) { void Stepper::microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3) {
if (ms1 >= 0) switch (driver) { if (ms1 >= 0) switch (driver) {
case 0: WRITE(X_MS1_PIN, ms1); break; #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS
case 0:
#if HAS_X_MICROSTEPS
WRITE(X_MS1_PIN, ms1);
#endif
#if HAS_X2_MICROSTEPS
WRITE(X2_MS1_PIN, ms1);
#endif
break;
#endif
#if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS
case 1:
#if HAS_Y_MICROSTEPS #if HAS_Y_MICROSTEPS
case 1: WRITE(Y_MS1_PIN, ms1); break; WRITE(Y_MS1_PIN, ms1);
#endif
#if HAS_Y2_MICROSTEPS
WRITE(Y2_MS1_PIN, ms1);
#endif
break;
#endif #endif
#if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS
case 2:
#if HAS_Z_MICROSTEPS #if HAS_Z_MICROSTEPS
case 2: WRITE(Z_MS1_PIN, ms1); break; WRITE(Z_MS1_PIN, ms1);
#endif
#if HAS_Z2_MICROSTEPS
WRITE(Z2_MS1_PIN, ms1);
#endif
#if HAS_Z3_MICROSTEPS
WRITE(Z3_MS1_PIN, ms1);
#endif
break;
#endif #endif
#if HAS_E0_MICROSTEPS #if HAS_E0_MICROSTEPS
case 3: WRITE(E0_MS1_PIN, ms1); break; case 3: WRITE(E0_MS1_PIN, ms1); break;
@ -2572,12 +2655,38 @@ void Stepper::report_positions() {
#endif #endif
} }
if (ms2 >= 0) switch (driver) { if (ms2 >= 0) switch (driver) {
case 0: WRITE(X_MS2_PIN, ms2); break; #if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS
case 0:
#if HAS_X_MICROSTEPS
WRITE(X_MS2_PIN, ms2);
#endif
#if HAS_X2_MICROSTEPS
WRITE(X2_MS2_PIN, ms2);
#endif
break;
#endif
#if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS
case 1:
#if HAS_Y_MICROSTEPS #if HAS_Y_MICROSTEPS
case 1: WRITE(Y_MS2_PIN, ms2); break; WRITE(Y_MS2_PIN, ms2);
#endif
#if HAS_Y2_MICROSTEPS
WRITE(Y2_MS2_PIN, ms2);
#endif #endif
break;
#endif
#if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS
case 2:
#if HAS_Z_MICROSTEPS #if HAS_Z_MICROSTEPS
case 2: WRITE(Z_MS2_PIN, ms2); break; WRITE(Z_MS2_PIN, ms2);
#endif
#if HAS_Z2_MICROSTEPS
WRITE(Z2_MS2_PIN, ms2);
#endif
#if HAS_Z3_MICROSTEPS
WRITE(Z3_MS2_PIN, ms2);
#endif
break;
#endif #endif
#if HAS_E0_MICROSTEPS #if HAS_E0_MICROSTEPS
case 3: WRITE(E0_MS2_PIN, ms2); break; case 3: WRITE(E0_MS2_PIN, ms2); break;
@ -2598,70 +2707,165 @@ void Stepper::report_positions() {
case 8: WRITE(E5_MS2_PIN, ms2); break; case 8: WRITE(E5_MS2_PIN, ms2); break;
#endif #endif
} }
if (ms3 >= 0) switch (driver) {
#if HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS
case 0:
#if HAS_X_MICROSTEPS && PIN_EXISTS(X_MS3)
WRITE(X_MS3_PIN, ms3);
#endif
#if HAS_X2_MICROSTEPS && PIN_EXISTS(X2_MS3)
WRITE(X2_MS3_PIN, ms3);
#endif
break;
#endif
#if HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS
case 1:
#if HAS_Y_MICROSTEPS && PIN_EXISTS(Y_MS3)
WRITE(Y_MS3_PIN, ms3);
#endif
#if HAS_Y2_MICROSTEPS && PIN_EXISTS(Y2_MS3)
WRITE(Y2_MS3_PIN, ms3);
#endif
break;
#endif
#if HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS
case 2:
#if HAS_Z_MICROSTEPS && PIN_EXISTS(Z_MS3)
WRITE(Z_MS3_PIN, ms3);
#endif
#if HAS_Z2_MICROSTEPS && PIN_EXISTS(Z2_MS3)
WRITE(Z2_MS3_PIN, ms3);
#endif
#if HAS_Z3_MICROSTEPS && PIN_EXISTS(Z3_MS3)
WRITE(Z3_MS3_PIN, ms3);
#endif
break;
#endif
#if HAS_E0_MICROSTEPS && PIN_EXISTS(E0_MS3)
case 3: WRITE(E0_MS3_PIN, ms3); break;
#endif
#if HAS_E1_MICROSTEPS && PIN_EXISTS(E1_MS3)
case 4: WRITE(E1_MS3_PIN, ms3); break;
#endif
#if HAS_E2_MICROSTEPS && PIN_EXISTS(E2_MS3)
case 5: WRITE(E2_MS3_PIN, ms3); break;
#endif
#if HAS_E3_MICROSTEPS && PIN_EXISTS(E3_MS3)
case 6: WRITE(E3_MS3_PIN, ms3); break;
#endif
#if HAS_E4_MICROSTEPS && PIN_EXISTS(E4_MS3)
case 7: WRITE(E4_MS3_PIN, ms3); break;
#endif
#if HAS_E5_MICROSTEPS && PIN_EXISTS(E5_MS3)
case 8: WRITE(E5_MS3_PIN, ms3); break;
#endif
}
} }
void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) { void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) {
switch (stepping_mode) { switch (stepping_mode) {
#if HAS_MICROSTEP1
case 1: microstep_ms(driver, MICROSTEP1); break; case 1: microstep_ms(driver, MICROSTEP1); break;
#if ENABLED(HEROIC_STEPPER_DRIVERS) #endif
case 128: microstep_ms(driver, MICROSTEP128); break; #if HAS_MICROSTEP2
#else
case 2: microstep_ms(driver, MICROSTEP2); break; case 2: microstep_ms(driver, MICROSTEP2); break;
#endif
#if HAS_MICROSTEP4
case 4: microstep_ms(driver, MICROSTEP4); break; case 4: microstep_ms(driver, MICROSTEP4); break;
#endif #endif
#if HAS_MICROSTEP8
case 8: microstep_ms(driver, MICROSTEP8); break; case 8: microstep_ms(driver, MICROSTEP8); break;
#endif
#if HAS_MICROSTEP16
case 16: microstep_ms(driver, MICROSTEP16); break; case 16: microstep_ms(driver, MICROSTEP16); break;
#if MB(ALLIGATOR) #endif
#if HAS_MICROSTEP32
case 32: microstep_ms(driver, MICROSTEP32); break; case 32: microstep_ms(driver, MICROSTEP32); break;
#endif #endif
#if HAS_MICROSTEP64
case 64: microstep_ms(driver, MICROSTEP64); break;
#endif
#if HAS_MICROSTEP128
case 128: microstep_ms(driver, MICROSTEP128); break;
#endif
default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break; default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break;
} }
} }
void Stepper::microstep_readings() { void Stepper::microstep_readings() {
SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); SERIAL_PROTOCOLLNPGM("MS1,MS2,MS3 Pins");
SERIAL_PROTOCOLPGM("X: "); SERIAL_PROTOCOLPGM("X: ");
#if HAS_X_MICROSTEPS
SERIAL_PROTOCOL(READ(X_MS1_PIN)); SERIAL_PROTOCOL(READ(X_MS1_PIN));
SERIAL_PROTOCOLLN(READ(X_MS2_PIN)); SERIAL_PROTOCOL(READ(X_MS2_PIN));
#if PIN_EXISTS(X_MS3)
SERIAL_PROTOCOLLN(READ(X_MS3_PIN));
#endif
#endif
#if HAS_Y_MICROSTEPS #if HAS_Y_MICROSTEPS
SERIAL_PROTOCOLPGM("Y: "); SERIAL_PROTOCOLPGM("Y: ");
SERIAL_PROTOCOL(READ(Y_MS1_PIN)); SERIAL_PROTOCOL(READ(Y_MS1_PIN));
SERIAL_PROTOCOLLN(READ(Y_MS2_PIN)); SERIAL_PROTOCOL(READ(Y_MS2_PIN));
#if PIN_EXISTS(Y_MS3)
SERIAL_PROTOCOLLN(READ(Y_MS3_PIN));
#endif
#endif #endif
#if HAS_Z_MICROSTEPS #if HAS_Z_MICROSTEPS
SERIAL_PROTOCOLPGM("Z: "); SERIAL_PROTOCOLPGM("Z: ");
SERIAL_PROTOCOL(READ(Z_MS1_PIN)); SERIAL_PROTOCOL(READ(Z_MS1_PIN));
SERIAL_PROTOCOLLN(READ(Z_MS2_PIN)); SERIAL_PROTOCOL(READ(Z_MS2_PIN));
#if PIN_EXISTS(Z_MS3)
SERIAL_PROTOCOLLN(READ(Z_MS3_PIN));
#endif
#endif #endif
#if HAS_E0_MICROSTEPS #if HAS_E0_MICROSTEPS
SERIAL_PROTOCOLPGM("E0: "); SERIAL_PROTOCOLPGM("E0: ");
SERIAL_PROTOCOL(READ(E0_MS1_PIN)); SERIAL_PROTOCOL(READ(E0_MS1_PIN));
SERIAL_PROTOCOLLN(READ(E0_MS2_PIN)); SERIAL_PROTOCOL(READ(E0_MS2_PIN));
#if PIN_EXISTS(E0_MS3)
SERIAL_PROTOCOLLN(READ(E0_MS3_PIN));
#endif
#endif #endif
#if HAS_E1_MICROSTEPS #if HAS_E1_MICROSTEPS
SERIAL_PROTOCOLPGM("E1: "); SERIAL_PROTOCOLPGM("E1: ");
SERIAL_PROTOCOL(READ(E1_MS1_PIN)); SERIAL_PROTOCOL(READ(E1_MS1_PIN));
SERIAL_PROTOCOLLN(READ(E1_MS2_PIN)); SERIAL_PROTOCOL(READ(E1_MS2_PIN));
#if PIN_EXISTS(E1_MS3)
SERIAL_PROTOCOLLN(READ(E1_MS3_PIN));
#endif
#endif #endif
#if HAS_E2_MICROSTEPS #if HAS_E2_MICROSTEPS
SERIAL_PROTOCOLPGM("E2: "); SERIAL_PROTOCOLPGM("E2: ");
SERIAL_PROTOCOL(READ(E2_MS1_PIN)); SERIAL_PROTOCOL(READ(E2_MS1_PIN));
SERIAL_PROTOCOLLN(READ(E2_MS2_PIN)); SERIAL_PROTOCOL(READ(E2_MS2_PIN));
#if PIN_EXISTS(E2_MS3)
SERIAL_PROTOCOLLN(READ(E2_MS3_PIN));
#endif
#endif #endif
#if HAS_E3_MICROSTEPS #if HAS_E3_MICROSTEPS
SERIAL_PROTOCOLPGM("E3: "); SERIAL_PROTOCOLPGM("E3: ");
SERIAL_PROTOCOL(READ(E3_MS1_PIN)); SERIAL_PROTOCOL(READ(E3_MS1_PIN));
SERIAL_PROTOCOLLN(READ(E3_MS2_PIN)); SERIAL_PROTOCOL(READ(E3_MS2_PIN));
#if PIN_EXISTS(E3_MS3)
SERIAL_PROTOCOLLN(READ(E3_MS3_PIN));
#endif
#endif #endif
#if HAS_E4_MICROSTEPS #if HAS_E4_MICROSTEPS
SERIAL_PROTOCOLPGM("E4: "); SERIAL_PROTOCOLPGM("E4: ");
SERIAL_PROTOCOL(READ(E4_MS1_PIN)); SERIAL_PROTOCOL(READ(E4_MS1_PIN));
SERIAL_PROTOCOLLN(READ(E4_MS2_PIN)); SERIAL_PROTOCOL(READ(E4_MS2_PIN));
#if PIN_EXISTS(E4_MS3)
SERIAL_PROTOCOLLN(READ(E4_MS3_PIN));
#endif
#endif #endif
#if HAS_E5_MICROSTEPS #if HAS_E5_MICROSTEPS
SERIAL_PROTOCOLPGM("E5: "); SERIAL_PROTOCOLPGM("E5: ");
SERIAL_PROTOCOL(READ(E5_MS1_PIN)); SERIAL_PROTOCOL(READ(E5_MS1_PIN));
SERIAL_PROTOCOLLN(READ(E5_MS2_PIN)); SERIAL_PROTOCOLLN(READ(E5_MS2_PIN));
#if PIN_EXISTS(E5_MS3)
SERIAL_PROTOCOLLN(READ(E5_MS3_PIN));
#endif
#endif #endif
} }

2
Marlin/src/module/stepper.h

@ -413,7 +413,7 @@ class Stepper {
#endif #endif
#if HAS_MICROSTEPS #if HAS_MICROSTEPS
static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2); static void microstep_ms(const uint8_t driver, const int8_t ms1, const int8_t ms2, const int8_t ms3);
static void microstep_mode(const uint8_t driver, const uint8_t stepping); static void microstep_mode(const uint8_t driver, const uint8_t stepping);
static void microstep_readings(); static void microstep_readings();
#endif #endif

87
Marlin/src/pins/pins.h

@ -427,12 +427,18 @@
#ifndef X_MS2_PIN #ifndef X_MS2_PIN
#define X_MS2_PIN -1 #define X_MS2_PIN -1
#endif #endif
#ifndef X_MS3_PIN
#define X_MS3_PIN -1
#endif
#ifndef Y_MS1_PIN #ifndef Y_MS1_PIN
#define Y_MS1_PIN -1 #define Y_MS1_PIN -1
#endif #endif
#ifndef Y_MS2_PIN #ifndef Y_MS2_PIN
#define Y_MS2_PIN -1 #define Y_MS2_PIN -1
#endif #endif
#ifndef Y_MS3_PIN
#define Y_MS3_PIN -1
#endif
#ifndef Z_MS1_PIN #ifndef Z_MS1_PIN
#define Z_MS1_PIN -1 #define Z_MS1_PIN -1
#endif #endif
@ -448,18 +454,27 @@
#ifndef E0_MS2_PIN #ifndef E0_MS2_PIN
#define E0_MS2_PIN -1 #define E0_MS2_PIN -1
#endif #endif
#ifndef E0_MS3_PIN
#define E0_MS3_PIN -1
#endif
#ifndef E1_MS1_PIN #ifndef E1_MS1_PIN
#define E1_MS1_PIN -1 #define E1_MS1_PIN -1
#endif #endif
#ifndef E1_MS2_PIN #ifndef E1_MS2_PIN
#define E1_MS2_PIN -1 #define E1_MS2_PIN -1
#endif #endif
#ifndef E1_MS3_PIN
#define E1_MS3_PIN -1
#endif
#ifndef E2_MS1_PIN #ifndef E2_MS1_PIN
#define E2_MS1_PIN -1 #define E2_MS1_PIN -1
#endif #endif
#ifndef E2_MS2_PIN #ifndef E2_MS2_PIN
#define E2_MS2_PIN -1 #define E2_MS2_PIN -1
#endif #endif
#ifndef E2_MS3_PIN
#define E2_MS3_PIN -1
#endif
#ifndef E3_MS1_PIN #ifndef E3_MS1_PIN
#define E3_MS1_PIN -1 #define E3_MS1_PIN -1
#endif #endif
@ -907,19 +922,21 @@
#define X2_STEP_PIN _EPIN(E_STEPPERS, STEP) #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP)
#define X2_DIR_PIN _EPIN(E_STEPPERS, DIR) #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR)
#define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE) #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
#if E_STEPPERS >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP)
#error "No E stepper plug left for X2!"
#endif
#endif
#ifndef X2_CS_PIN #ifndef X2_CS_PIN
#define X2_CS_PIN _EPIN(E_STEPPERS, CS) #define X2_CS_PIN _EPIN(E_STEPPERS, CS)
#endif #endif
#if E_STEPPERS > MAX_EXTRUDERS || !PIN_EXISTS(X2_ENABLE) #ifndef X2_MS1_PIN
#error "No E stepper plug left for X2!" #define X2_MS1_PIN _EPIN(E_STEPPERS, MS1)
#endif #endif
#ifndef X2_MS2_PIN
#define X2_MS2_PIN _EPIN(E_STEPPERS, MS2)
#endif #endif
#undef _X2_PINS #ifndef X2_MS3_PIN
#define __X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN, #define X2_MS3_PIN _EPIN(E_STEPPERS, MS3)
#ifdef X2_CS_PIN
#define _X2_PINS __X2_PINS X2_CS_PIN,
#else
#define _X2_PINS __X2_PINS
#endif #endif
#define Y2_E_INDEX INCREMENT(E_STEPPERS) #define Y2_E_INDEX INCREMENT(E_STEPPERS)
#else #else
@ -932,19 +949,21 @@
#define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP)
#define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR)
#define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
#if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_STEP)
#error "No E stepper plug left for Y2!"
#endif
#endif
#ifndef Y2_CS_PIN #ifndef Y2_CS_PIN
#define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS) #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS)
#endif #endif
#if Y2_E_INDEX > MAX_EXTRUDERS || !PIN_EXISTS(Y2_ENABLE) #ifndef Y2_MS1_PIN
#error "No E stepper plug left for Y2!" #define Y2_MS1_PIN _EPIN(Y2_E_INDEX, MS1)
#endif #endif
#ifndef Y2_MS2_PIN
#define Y2_MS2_PIN _EPIN(Y2_E_INDEX, MS2)
#endif #endif
#undef _Y2_PINS #ifndef Y2_MS3_PIN
#define __Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN, #define Y2_MS3_PIN _EPIN(Y2_E_INDEX, MS3)
#ifdef Y2_CS_PIN
#define _Y2_PINS __Y2_PINS Y2_CS_PIN,
#else
#define _Y2_PINS __Y2_PINS
#endif #endif
#define Z2_E_INDEX INCREMENT(Y2_E_INDEX) #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
#else #else
@ -957,19 +976,21 @@
#define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
#define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
#define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
#if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_STEP)
#error "No E stepper plug left for Z2!"
#endif
#endif
#ifndef Z2_CS_PIN #ifndef Z2_CS_PIN
#define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS) #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS)
#endif #endif
#if Z2_E_INDEX > MAX_EXTRUDERS || !PIN_EXISTS(Z2_ENABLE) #ifndef Z2_MS1_PIN
#error "No E stepper plug left for Z2!" #define Z2_MS1_PIN _EPIN(Z2_E_INDEX, MS1)
#endif #endif
#ifndef Z2_MS2_PIN
#define Z2_MS2_PIN _EPIN(Z2_E_INDEX, MS2)
#endif #endif
#undef _Z2_PINS #ifndef Z2_MS3_PIN
#define __Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN, #define Z2_MS3_PIN _EPIN(Z2_E_INDEX, MS3)
#ifdef Z2_CS_PIN
#define _Z2_PINS __Z2_PINS Z2_CS_PIN,
#else
#define _Z2_PINS __Z2_PINS
#endif #endif
#define Z3_E_INDEX INCREMENT(Z2_E_INDEX) #define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
#else #else
@ -981,19 +1002,21 @@
#define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP)
#define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR) #define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR)
#define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE) #define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE)
#if Z3_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z3_STEP)
#error "No E stepper plug left for Z3!"
#endif
#endif
#ifndef Z3_CS_PIN #ifndef Z3_CS_PIN
#define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS) #define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS)
#endif #endif
#if Z3_E_INDEX > 4 || !PIN_EXISTS(Z3_ENABLE) #ifndef Z3_MS1_PIN
#error "No E stepper plug left for Z3!" #define Z3_MS1_PIN _EPIN(Z3_E_INDEX, MS1)
#endif #endif
#ifndef Z3_MS2_PIN
#define Z3_MS2_PIN _EPIN(Z3_E_INDEX, MS2)
#endif #endif
#undef _Z3_PINS #ifndef Z3_MS3_PIN
#define __Z3_PINS Z3_STEP_PIN, Z3_DIR_PIN, Z3_ENABLE_PIN, #define Z3_MS3_PIN _EPIN(Z3_E_INDEX, MS3)
#ifdef Z3_CS_PIN
#define _Z3_PINS __Z3_PINS Z3_CS_PIN,
#else
#define _Z3_PINS __Z3_PINS
#endif #endif
#endif #endif

36
Marlin/src/pins/pinsDebug_list.h

@ -268,6 +268,9 @@
#if PIN_EXISTS(E0_MS2) #if PIN_EXISTS(E0_MS2)
REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN) REPORT_NAME_DIGITAL(__LINE__, E0_MS2_PIN)
#endif #endif
#if PIN_EXISTS(E0_MS3)
REPORT_NAME_DIGITAL(__LINE__, E0_MS3_PIN)
#endif
#if PIN_EXISTS(E0_STEP) #if PIN_EXISTS(E0_STEP)
REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, E0_STEP_PIN)
#endif #endif
@ -289,6 +292,9 @@
#if PIN_EXISTS(E1_MS2) #if PIN_EXISTS(E1_MS2)
REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN) REPORT_NAME_DIGITAL(__LINE__, E1_MS2_PIN)
#endif #endif
#if PIN_EXISTS(E1_MS3)
REPORT_NAME_DIGITAL(__LINE__, E1_MS3_PIN)
#endif
#if PIN_EXISTS(E1_STEP) #if PIN_EXISTS(E1_STEP)
REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, E1_STEP_PIN)
#endif #endif
@ -310,6 +316,9 @@
#if PIN_EXISTS(E2_MS2) #if PIN_EXISTS(E2_MS2)
REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN) REPORT_NAME_DIGITAL(__LINE__, E2_MS2_PIN)
#endif #endif
#if PIN_EXISTS(E2_MS3)
REPORT_NAME_DIGITAL(__LINE__, E2_MS3_PIN)
#endif
#if PIN_EXISTS(E2_STEP) #if PIN_EXISTS(E2_STEP)
REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, E2_STEP_PIN)
#endif #endif
@ -881,6 +890,9 @@
#if PIN_EXISTS(X_MS2) #if PIN_EXISTS(X_MS2)
REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN) REPORT_NAME_DIGITAL(__LINE__, X_MS2_PIN)
#endif #endif
#if PIN_EXISTS(X_MS3)
REPORT_NAME_DIGITAL(__LINE__, X_MS3_PIN)
#endif
#if PIN_EXISTS(X_STEP) #if PIN_EXISTS(X_STEP)
REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, X_STEP_PIN)
#endif #endif
@ -893,6 +905,15 @@
#if PIN_EXISTS(X2_ENABLE) #if PIN_EXISTS(X2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(X2_MS1)
REPORT_NAME_DIGITAL(__LINE__, X2_MS1_PIN)
#endif
#if PIN_EXISTS(X2_MS2)
REPORT_NAME_DIGITAL(__LINE__, X2_MS2_PIN)
#endif
#if PIN_EXISTS(X2_MS3)
REPORT_NAME_DIGITAL(__LINE__, X2_MS3_PIN)
#endif
#if PIN_EXISTS(X2_STEP) #if PIN_EXISTS(X2_STEP)
REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, X2_STEP_PIN)
#endif #endif
@ -920,6 +941,9 @@
#if PIN_EXISTS(Y_MS2) #if PIN_EXISTS(Y_MS2)
REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN) REPORT_NAME_DIGITAL(__LINE__, Y_MS2_PIN)
#endif #endif
#if PIN_EXISTS(Y_MS3)
REPORT_NAME_DIGITAL(__LINE__, Y_MS3_PIN)
#endif
#if PIN_EXISTS(Y_STEP) #if PIN_EXISTS(Y_STEP)
REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, Y_STEP_PIN)
#endif #endif
@ -932,6 +956,15 @@
#if PIN_EXISTS(Y2_ENABLE) #if PIN_EXISTS(Y2_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN) REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN)
#endif #endif
#if PIN_EXISTS(Y2_MS1)
REPORT_NAME_DIGITAL(__LINE__, Y2_MS1_PIN)
#endif
#if PIN_EXISTS(Y2_MS2)
REPORT_NAME_DIGITAL(__LINE__, Y2_MS2_PIN)
#endif
#if PIN_EXISTS(Y2_MS3)
REPORT_NAME_DIGITAL(__LINE__, Y2_MS3_PIN)
#endif
#if PIN_EXISTS(Y2_STEP) #if PIN_EXISTS(Y2_STEP)
REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, Y2_STEP_PIN)
#endif #endif
@ -962,6 +995,9 @@
#if PIN_EXISTS(Z_MS2) #if PIN_EXISTS(Z_MS2)
REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN) REPORT_NAME_DIGITAL(__LINE__, Z_MS2_PIN)
#endif #endif
#if PIN_EXISTS(Z_MS3)
REPORT_NAME_DIGITAL(__LINE__, Z_MS3_PIN)
#endif
#if PIN_EXISTS(Z_STEP) #if PIN_EXISTS(Z_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN) REPORT_NAME_DIGITAL(__LINE__, Z_STEP_PIN)
#endif #endif

3
Marlin/src/pins/pins_RURAMPS4D_11.h

@ -119,9 +119,6 @@
//#define E3_MS1_PIN ? //#define E3_MS1_PIN ?
//#define E3_MS2_PIN ? //#define E3_MS2_PIN ?
//#define E3_MS3_PIN ? //#define E3_MS3_PIN ?
//#define Z2_MS1_PIN ? // shared with E3_MS1_PIN
//#define Z2_MS2_PIN ? // shared with E3_MS2_PIN
//#define Z2_MS3_PIN ? // shared with E3_MS3_PIN
#if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) #if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#define Z_MIN_PROBE_PIN 49 #define Z_MIN_PROBE_PIN 49

Loading…
Cancel
Save