From a0351bdb737a4b432ac3e9d1740e292d910bf32b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Jul 2015 18:15:03 -0700 Subject: [PATCH 1/2] Remove STEPPER_RESET_FIX option --- Marlin/example_configurations/RigidBot/Configuration.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 16d56ca3e8..9112c06352 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -588,8 +588,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //============================================================================= // @section more -// RigidBot - Disable stepper drivers until voltage has stabilized -#define STEPPER_RESET_FIX // Custom M code points #define CUSTOM_M_CODES From 447dbd6fa56691cc6a15276770d01f0e80c1fbe2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 10 Jul 2015 18:15:24 -0700 Subject: [PATCH 2/2] Add STEPPER_RESET_PIN support --- Marlin/Conditionals.h | 1 + Marlin/Marlin_main.cpp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 637ea98a57..1c191a3bbd 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -442,6 +442,7 @@ #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1)) #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1)) #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1)) + #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0d4ddc9ecd..0bfba2c83b 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -579,6 +579,17 @@ void servo_init() { #endif } +/** + * Stepper Reset (RigidBoard, et.al.) + */ +#if HAS_STEPPER_RESET + void disableStepperDrivers() { + pinMode(STEPPER_RESET_PIN, OUTPUT); + digitalWrite(STEPPER_RESET_PIN, LOW); // drive it down to hold in reset motor driver chips + } + void enableStepperDrivers() { pinMode(STEPPER_RESET_PIN, INPUT); } // set to input, which allows it to be pulled high by pullups +#endif + /** * Marlin entry-point: Set up before the program loop * - Set up the kill pin, filament runout, power hold @@ -601,6 +612,11 @@ void setup() { setup_killpin(); setup_filrunoutpin(); setup_powerhold(); + + #if HAS_STEPPER_RESET + disableStepperDrivers(); + #endif + MYSERIAL.begin(BAUDRATE); SERIAL_PROTOCOLLNPGM("start"); SERIAL_ECHO_START; @@ -656,6 +672,10 @@ void setup() { SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan #endif + #if HAS_STEPPER_RESET + enableStepperDrivers(); + #endif + #ifdef DIGIPOT_I2C digipot_i2c_init(); #endif