From d3466e8fb3ca9a5a184fe402cc29bf973f8c8d5e Mon Sep 17 00:00:00 2001 From: thisiskeithb Date: Thu, 24 Sep 2020 05:27:19 -0700 Subject: [PATCH 1/7] Initial SKR E3 Turbo support --- Marlin/src/core/boards.h | 1 + .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 266 ++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 3 files changed, 269 insertions(+) create mode 100644 Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e27448b0220b..9e0451486e63 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -223,6 +223,7 @@ #define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed) +#define BOARD_BTT_SKR_E3_TURBO 2015 // BigTreeTech SKR E3 Turbo (Power outputs: Hotend0, Hotend1, Fan, Bed) // // LPC1769 ARM Cortex M3 diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h new file mode 100644 index 000000000000..80b5bd4a4827 --- /dev/null +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -0,0 +1,266 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "BTT SKR E3 Turbo" +#endif + +// Onboard I2C EEPROM +#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB (AT24C32) + +// +// Servos +// +#define SERVO0_PIN P1_23 + +// +// TMC StallGuard DIAG pins +// +#define X_DIAG_PIN P1_29 // X-STOP +#define Y_DIAG_PIN P1_28 // Y-STOP +#define Z_DIAG_PIN P1_27 // Z-STOP +#define E0_DIAG_PIN P1_26 // E0DET +#define E1_DIAG_PIN P1_25 // E1DET + +// +// Limit Switches +#define X_STOP_PIN X_DIAG_PIN +#define Y_STOP_PIN Y_DIAG_PIN +#define Z_STOP_PIN Z_DIAG_PIN + +// +// Z Probe +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN P1_22 +#endif + +// +// Filament Runout Sensor +// +#define FIL_RUNOUT_PIN P1_26 // E0DET +#define FIL_RUNOUT2_PIN P1_25 // E1DET + +// +// Power Supply Control +// +#ifndef PS_ON_PIN + #define PS_ON_PIN P1_21 +#endif + +// LED driving pin +#define NEOPIXEL_PIN P1_24 + +// +// Power Loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN P1_20 // PWRDET +#endif + +// +// Steppers +// +#define X_STEP_PIN P1_04 +#define X_DIR_PIN P1_08 +#define X_ENABLE_PIN P1_00 +#ifndef X_CS_PIN + #define X_CS_PIN P1_01 +#endif + +#define Y_STEP_PIN P1_14 +#define Y_DIR_PIN P1_15 +#define Y_ENABLE_PIN P1_09 +#ifndef Y_CS_PIN + #define Y_CS_PIN P1_10 +#endif + +#define Z_STEP_PIN P4_29 +#define Z_DIR_PIN P4_28 +#define Z_ENABLE_PIN P1_16 +#ifndef Z_CS_PIN + #define Z_CS_PIN P1_17 +#endif + +#define E0_STEP_PIN P2_06 +#define E0_DIR_PIN P2_07 +#define E0_ENABLE_PIN P0_04 +#ifndef E0_CS_PIN + #define E0_CS_PIN P0_05 +#endif + +#define E1_STEP_PIN P2_11 +#define E1_DIR_PIN P2_12 +#define E1_ENABLE_PIN P0_21 +#ifndef E1_CS_PIN + #define E1_CS_PIN P0_22 +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + + // + // Software serial + // + #define X_SERIAL_TX_PIN P1_01 + #define X_SERIAL_RX_PIN P1_01 + + #define Y_SERIAL_TX_PIN P1_10 + #define Y_SERIAL_RX_PIN P1_10 + + #define Z_SERIAL_TX_PIN P1_17 + #define Z_SERIAL_RX_PIN P1_17 + + #define E0_SERIAL_TX_PIN P0_05 + #define E0_SERIAL_RX_PIN P0_05 + + #define E1_SERIAL_TX_PIN P0_22 + #define E1_SERIAL_RX_PIN P0_22 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// TMC Low Power Standby pins +// +#define X_STDBY_PIN P3_26 +#define Y_STDBY_PIN P3_25 +#define Z_STDBY_PIN P1_18 +#define E0_STDBY_PIN P1_19 +#define E1_STDBY_PIN P2_13 + +// +// Temperature Sensors +// +#define TEMP_0_PIN P0_24 +#define TEMP_1_PIN P0_23 +//#define TEMP_2_PIN P1_30 // Onboard thermistor +#define TEMP_BED_PIN P0_25 + +// +// Heaters / Fans +// +#define HEATER_0_PIN P2_03 // EXTRUDER 0 +#define HEATER_1_PIN P2_04 // EXTRUDER 1 +#define HEATER_BED_PIN P2_05 // BED +#define FAN_PIN P2_01 +#define FAN1_PIN P2_02 + +// +// USB connect control +// +//#define USB_CONNECT_PIN P2_09 +//#define USB_CONNECT_INVERTING false + +/** + * _____ + * 5V | 1 2 | GND + * (LCD_EN) P0_18 | 3 4 | P0_17 (LCD_RS) + * (LCD_D4) P0_15 | 5 6 P0_20 (BTN_EN2) + * RESET | 7 8 | P0_19 (BTN_EN1) + * (BTN_ENC) P0_16 | 9 10| P2_08 (BEEPER) + * ----- + * EXP + */ + +#define EXPA1_03_PIN P0_18 +#define EXPA1_04_PIN P0_17 +#define EXPA1_05_PIN P0_15 +#define EXPA1_06_PIN P0_20 +#define EXPA1_07_PIN -1 +#define EXPA1_08_PIN P0_19 +#define EXPA1_09_PIN P0_16 +#define EXPA1_10_PIN P2_08 + +#if HAS_SPI_LCD + + #if ENABLED(CR10_STOCKDISPLAY) + + #define BEEPER_PIN EXPA1_10_PIN + + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN + + #define LCD_PINS_RS EXPA1_04_PIN + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN + + #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! + + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_E3_TURBO.h' for details. Comment out this line to continue." + + #define LCD_PINS_RS EXPA1_05_PIN + #define LCD_PINS_ENABLE EXPA1_09_PIN + #define LCD_PINS_D4 EXPA1_04_PIN + #define LCD_PINS_D5 EXPA1_06_PIN + #define LCD_PINS_D6 EXPA1_08_PIN + #define LCD_PINS_D7 EXPA1_10_PIN + #define ADC_KEYPAD_PIN P1_23 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! + + #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) + + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN + + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN + #define FORCE_SOFT_SPI + #define LCD_BACKLIGHT_PIN -1 + + #else + + #error "Only ZONESTAR_LCD, MKS_MINI_12864, ENDER2_STOCKDISPLAY, and CR10_STOCKDISPLAY are currently supported on the BTT_SKR_E3_TURBO." + + #endif + +#endif // HAS_SPI_LCD + +// +// SD Support +// +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SD_DETECT_PIN P2_00 + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #define SS_PIN P0_06 +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "SD CUSTOM_CABLE is not compatible with SKR E3 Turbo." +#endif + +#define ON_BOARD_SPI_DEVICE 1 // SPI1 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index bf95c8731239..0ccdadadde4c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -421,6 +421,8 @@ #include "lpc1769/pins_BTT_SKR_V1_4_TURBO.h" // LPC1769 env:LPC1769 #elif MB(MKS_SGEN_L_V2) #include "lpc1769/pins_MKS_SGEN_L_V2.h" // LPC1769 env:LPC1769 +#elif MB(BTT_SKR_E3_TURBO) + #include "lpc1769/pins_BTT_SKR_E3_TURBO.h" // LPC1769 env:LPC1769 // // Due (ATSAM) boards From 86cde4059df587d1fda5e81e8c7ca02ef69f7d72 Mon Sep 17 00:00:00 2001 From: thisiskeithb Date: Thu, 24 Sep 2020 01:39:48 -0700 Subject: [PATCH 2/7] TMC Low Power Standby A future PR will be submitted for this feature. --- Marlin/src/MarlinCore.cpp | 18 +++++++++++ Marlin/src/inc/Conditionals_post.h | 48 ++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index e11439861bd4..8f6358667d20 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -888,6 +888,24 @@ void stop() { */ void setup() { + // TMC Low Power Standby pins need to be set as early as possible or they won't be usable + TERN_(HAS_X_TMC_STDBY,SET_INPUT_PULLDOWN(X_STDBY_PIN)); + TERN_(HAS_X2_TMC_STDBY,SET_INPUT_PULLDOWN(X2_STDBY_PIN)); + TERN_(HAS_Y_TMC_STDBY,SET_INPUT_PULLDOWN(Y_STDBY_PIN)); + TERN_(HAS_Y2_TMC_STDBY,SET_INPUT_PULLDOWN(Y2_STDBY_PIN)); + TERN_(HAS_Z_TMC_STDBY,SET_INPUT_PULLDOWN(Z_STDBY_PIN)); + TERN_(HAS_Z2_TMC_STDBY,SET_INPUT_PULLDOWN(Z2_STDBY_PIN)); + TERN_(HAS_Z3_TMC_STDBY,SET_INPUT_PULLDOWN(Z3_STDBY_PIN)); + TERN_(HAS_Z4_TMC_STDBY,SET_INPUT_PULLDOWN(Z4_STDBY_PIN)); + TERN_(HAS_E0_TMC_STDBY,SET_INPUT_PULLDOWN(E0_STDBY_PIN)); + TERN_(HAS_E1_TMC_STDBY,SET_INPUT_PULLDOWN(E1_STDBY_PIN)); + TERN_(HAS_E2_TMC_STDBY,SET_INPUT_PULLDOWN(E2_STDBY_PIN)); + TERN_(HAS_E3_TMC_STDBY,SET_INPUT_PULLDOWN(E3_STDBY_PIN)); + TERN_(HAS_E4_TMC_STDBY,SET_INPUT_PULLDOWN(E4_STDBY_PIN)); + TERN_(HAS_E5_TMC_STDBY,SET_INPUT_PULLDOWN(E5_STDBY_PIN)); + TERN_(HAS_E6_TMC_STDBY,SET_INPUT_PULLDOWN(E6_STDBY_PIN)); + TERN_(HAS_E7_TMC_STDBY,SET_INPUT_PULLDOWN(E7_STDBY_PIN)); + #if ENABLED(MARLIN_DEV_MODE) auto log_current_ms = [&](PGM_P const msg) { SERIAL_ECHO_START(); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index c9a29b351cbb..4942a5d9048f 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1336,6 +1336,9 @@ #if PIN_EXISTS(X_MS1) #define HAS_X_MS_PINS 1 #endif +#if PIN_EXISTS(X_STDBY) + #define HAS_X_TMC_STDBY 1 +#endif #if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)) #define HAS_X2_ENABLE 1 @@ -1349,6 +1352,9 @@ #if PIN_EXISTS(X2_MS1) #define HAS_X2_MS_PINS 1 #endif +#if PIN_EXISTS(X2_STDBY) + #define HAS_X2_TMC_STDBY 1 +#endif #if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)) #define HAS_Y_ENABLE 1 @@ -1362,6 +1368,9 @@ #if PIN_EXISTS(Y_MS1) #define HAS_Y_MS_PINS 1 #endif +#if PIN_EXISTS(Y_STDBY) + #define HAS_Y_TMC_STDBY 1 +#endif #if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)) #define HAS_Y2_ENABLE 1 @@ -1375,6 +1384,9 @@ #if PIN_EXISTS(Y2_MS1) #define HAS_Y2_MS_PINS 1 #endif +#if PIN_EXISTS(Y2_STDBY) + #define HAS_Y2_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)) #define HAS_Z_ENABLE 1 @@ -1388,6 +1400,9 @@ #if PIN_EXISTS(Z_MS1) #define HAS_Z_MS_PINS 1 #endif +#if PIN_EXISTS(Z_STDBY) + #define HAS_Z_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)) #define HAS_Z2_ENABLE 1 @@ -1401,6 +1416,9 @@ #if PIN_EXISTS(Z2_MS1) #define HAS_Z2_MS_PINS 1 #endif +#if PIN_EXISTS(Z2_STDBY) + #define HAS_Z2_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)) #define HAS_Z3_ENABLE 1 @@ -1414,6 +1432,9 @@ #if PIN_EXISTS(Z3_MS1) #define HAS_Z3_MS_PINS 1 #endif +#if PIN_EXISTS(Z3_STDBY) + #define HAS_Z3_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4)) #define HAS_Z4_ENABLE 1 @@ -1427,6 +1448,9 @@ #if PIN_EXISTS(Z4_MS1) #define HAS_Z4_MS_PINS 1 #endif +#if PIN_EXISTS(Z4_STDBY) + #define HAS_Z4_TMC_STDBY 1 +#endif // Extruder steppers and solenoids #if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)) @@ -1444,6 +1468,9 @@ #if PIN_EXISTS(SOL0) #define HAS_SOLENOID_0 1 #endif +#if PIN_EXISTS(E0_STDBY) + #define HAS_E0_TMC_STDBY 1 +#endif #if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)) #define HAS_E1_ENABLE 1 @@ -1460,6 +1487,9 @@ #if PIN_EXISTS(SOL1) #define HAS_SOLENOID_1 1 #endif +#if PIN_EXISTS(E1_STDBY) + #define HAS_E1_TMC_STDBY 1 +#endif #if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)) #define HAS_E2_ENABLE 1 @@ -1476,6 +1506,9 @@ #if PIN_EXISTS(SOL2) #define HAS_SOLENOID_2 1 #endif +#if PIN_EXISTS(E2_STDBY) + #define HAS_E2_TMC_STDBY 1 +#endif #if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)) #define HAS_E3_ENABLE 1 @@ -1492,6 +1525,9 @@ #if PIN_EXISTS(SOL3) #define HAS_SOLENOID_3 1 #endif +#if PIN_EXISTS(E3_STDBY) + #define HAS_E3_TMC_STDBY 1 +#endif #if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)) #define HAS_E4_ENABLE 1 @@ -1508,6 +1544,9 @@ #if PIN_EXISTS(SOL4) #define HAS_SOLENOID_4 1 #endif +#if PIN_EXISTS(E4_STDBY) + #define HAS_E4_TMC_STDBY 1 +#endif #if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)) #define HAS_E5_ENABLE 1 @@ -1524,6 +1563,9 @@ #if PIN_EXISTS(SOL5) #define HAS_SOLENOID_5 1 #endif +#if PIN_EXISTS(E5_STDBY) + #define HAS_E5_TMC_STDBY 1 +#endif #if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)) #define HAS_E6_ENABLE 1 @@ -1540,6 +1582,9 @@ #if PIN_EXISTS(SOL6) #define HAS_SOLENOID_6 1 #endif +#if PIN_EXISTS(E6_STDBY) + #define HAS_E6_TMC_STDBY 1 +#endif #if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)) #define HAS_E7_ENABLE 1 @@ -1556,6 +1601,9 @@ #if PIN_EXISTS(SOL7) #define HAS_SOLENOID_7 1 #endif +#if PIN_EXISTS(E7_STDBY) + #define HAS_E7_TMC_STDBY 1 +#endif // // Trinamic Stepper Drivers From 7323f1ce0e50672f582cc39faa0dbd419be768c6 Mon Sep 17 00:00:00 2001 From: thisiskeithb Date: Thu, 24 Sep 2020 11:01:50 -0700 Subject: [PATCH 3/7] Update USB_CONNECT_PIN --- Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 80b5bd4a4827..143504f0e338 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -176,7 +176,7 @@ // // USB connect control // -//#define USB_CONNECT_PIN P2_09 +//#define USB_CONNECT_PIN P0_29 //#define USB_CONNECT_INVERTING false /** From 49fab1778db12537adb0871bbb2f5cc16d6a3ce2 Mon Sep 17 00:00:00 2001 From: thisiskeithb Date: Thu, 24 Sep 2020 05:27:19 -0700 Subject: [PATCH 4/7] Initial SKR E3 Turbo support --- Marlin/src/core/boards.h | 1 + .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 266 ++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 3 files changed, 269 insertions(+) create mode 100644 Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e27448b0220b..9e0451486e63 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -223,6 +223,7 @@ #define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed) #define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed) +#define BOARD_BTT_SKR_E3_TURBO 2015 // BigTreeTech SKR E3 Turbo (Power outputs: Hotend0, Hotend1, Fan, Bed) // // LPC1769 ARM Cortex M3 diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h new file mode 100644 index 000000000000..80b5bd4a4827 --- /dev/null +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -0,0 +1,266 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "BTT SKR E3 Turbo" +#endif + +// Onboard I2C EEPROM +#define I2C_EEPROM +#define MARLIN_EEPROM_SIZE 0x1000 // 4KB (AT24C32) + +// +// Servos +// +#define SERVO0_PIN P1_23 + +// +// TMC StallGuard DIAG pins +// +#define X_DIAG_PIN P1_29 // X-STOP +#define Y_DIAG_PIN P1_28 // Y-STOP +#define Z_DIAG_PIN P1_27 // Z-STOP +#define E0_DIAG_PIN P1_26 // E0DET +#define E1_DIAG_PIN P1_25 // E1DET + +// +// Limit Switches +#define X_STOP_PIN X_DIAG_PIN +#define Y_STOP_PIN Y_DIAG_PIN +#define Z_STOP_PIN Z_DIAG_PIN + +// +// Z Probe +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN P1_22 +#endif + +// +// Filament Runout Sensor +// +#define FIL_RUNOUT_PIN P1_26 // E0DET +#define FIL_RUNOUT2_PIN P1_25 // E1DET + +// +// Power Supply Control +// +#ifndef PS_ON_PIN + #define PS_ON_PIN P1_21 +#endif + +// LED driving pin +#define NEOPIXEL_PIN P1_24 + +// +// Power Loss Detection +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN P1_20 // PWRDET +#endif + +// +// Steppers +// +#define X_STEP_PIN P1_04 +#define X_DIR_PIN P1_08 +#define X_ENABLE_PIN P1_00 +#ifndef X_CS_PIN + #define X_CS_PIN P1_01 +#endif + +#define Y_STEP_PIN P1_14 +#define Y_DIR_PIN P1_15 +#define Y_ENABLE_PIN P1_09 +#ifndef Y_CS_PIN + #define Y_CS_PIN P1_10 +#endif + +#define Z_STEP_PIN P4_29 +#define Z_DIR_PIN P4_28 +#define Z_ENABLE_PIN P1_16 +#ifndef Z_CS_PIN + #define Z_CS_PIN P1_17 +#endif + +#define E0_STEP_PIN P2_06 +#define E0_DIR_PIN P2_07 +#define E0_ENABLE_PIN P0_04 +#ifndef E0_CS_PIN + #define E0_CS_PIN P0_05 +#endif + +#define E1_STEP_PIN P2_11 +#define E1_DIR_PIN P2_12 +#define E1_ENABLE_PIN P0_21 +#ifndef E1_CS_PIN + #define E1_CS_PIN P0_22 +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + + // + // Software serial + // + #define X_SERIAL_TX_PIN P1_01 + #define X_SERIAL_RX_PIN P1_01 + + #define Y_SERIAL_TX_PIN P1_10 + #define Y_SERIAL_RX_PIN P1_10 + + #define Z_SERIAL_TX_PIN P1_17 + #define Z_SERIAL_RX_PIN P1_17 + + #define E0_SERIAL_TX_PIN P0_05 + #define E0_SERIAL_RX_PIN P0_05 + + #define E1_SERIAL_TX_PIN P0_22 + #define E1_SERIAL_RX_PIN P0_22 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// TMC Low Power Standby pins +// +#define X_STDBY_PIN P3_26 +#define Y_STDBY_PIN P3_25 +#define Z_STDBY_PIN P1_18 +#define E0_STDBY_PIN P1_19 +#define E1_STDBY_PIN P2_13 + +// +// Temperature Sensors +// +#define TEMP_0_PIN P0_24 +#define TEMP_1_PIN P0_23 +//#define TEMP_2_PIN P1_30 // Onboard thermistor +#define TEMP_BED_PIN P0_25 + +// +// Heaters / Fans +// +#define HEATER_0_PIN P2_03 // EXTRUDER 0 +#define HEATER_1_PIN P2_04 // EXTRUDER 1 +#define HEATER_BED_PIN P2_05 // BED +#define FAN_PIN P2_01 +#define FAN1_PIN P2_02 + +// +// USB connect control +// +//#define USB_CONNECT_PIN P2_09 +//#define USB_CONNECT_INVERTING false + +/** + * _____ + * 5V | 1 2 | GND + * (LCD_EN) P0_18 | 3 4 | P0_17 (LCD_RS) + * (LCD_D4) P0_15 | 5 6 P0_20 (BTN_EN2) + * RESET | 7 8 | P0_19 (BTN_EN1) + * (BTN_ENC) P0_16 | 9 10| P2_08 (BEEPER) + * ----- + * EXP + */ + +#define EXPA1_03_PIN P0_18 +#define EXPA1_04_PIN P0_17 +#define EXPA1_05_PIN P0_15 +#define EXPA1_06_PIN P0_20 +#define EXPA1_07_PIN -1 +#define EXPA1_08_PIN P0_19 +#define EXPA1_09_PIN P0_16 +#define EXPA1_10_PIN P2_08 + +#if HAS_SPI_LCD + + #if ENABLED(CR10_STOCKDISPLAY) + + #define BEEPER_PIN EXPA1_10_PIN + + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN + + #define LCD_PINS_RS EXPA1_04_PIN + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN + + #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! + + #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_E3_TURBO.h' for details. Comment out this line to continue." + + #define LCD_PINS_RS EXPA1_05_PIN + #define LCD_PINS_ENABLE EXPA1_09_PIN + #define LCD_PINS_D4 EXPA1_04_PIN + #define LCD_PINS_D5 EXPA1_06_PIN + #define LCD_PINS_D6 EXPA1_08_PIN + #define LCD_PINS_D7 EXPA1_10_PIN + #define ADC_KEYPAD_PIN P1_23 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! + + #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) + + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN + + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN + #define FORCE_SOFT_SPI + #define LCD_BACKLIGHT_PIN -1 + + #else + + #error "Only ZONESTAR_LCD, MKS_MINI_12864, ENDER2_STOCKDISPLAY, and CR10_STOCKDISPLAY are currently supported on the BTT_SKR_E3_TURBO." + + #endif + +#endif // HAS_SPI_LCD + +// +// SD Support +// +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SD_DETECT_PIN P2_00 + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #define SS_PIN P0_06 +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "SD CUSTOM_CABLE is not compatible with SKR E3 Turbo." +#endif + +#define ON_BOARD_SPI_DEVICE 1 // SPI1 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index bf95c8731239..0ccdadadde4c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -421,6 +421,8 @@ #include "lpc1769/pins_BTT_SKR_V1_4_TURBO.h" // LPC1769 env:LPC1769 #elif MB(MKS_SGEN_L_V2) #include "lpc1769/pins_MKS_SGEN_L_V2.h" // LPC1769 env:LPC1769 +#elif MB(BTT_SKR_E3_TURBO) + #include "lpc1769/pins_BTT_SKR_E3_TURBO.h" // LPC1769 env:LPC1769 // // Due (ATSAM) boards From 96152b4a9baafc0a65325a1bf522d0ec2820fbf3 Mon Sep 17 00:00:00 2001 From: thisiskeithb Date: Thu, 24 Sep 2020 01:39:48 -0700 Subject: [PATCH 5/7] TMC Low Power Standby A future PR will be submitted for this feature. --- Marlin/src/MarlinCore.cpp | 18 +++++++++++ Marlin/src/inc/Conditionals_post.h | 48 ++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index e11439861bd4..8f6358667d20 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -888,6 +888,24 @@ void stop() { */ void setup() { + // TMC Low Power Standby pins need to be set as early as possible or they won't be usable + TERN_(HAS_X_TMC_STDBY,SET_INPUT_PULLDOWN(X_STDBY_PIN)); + TERN_(HAS_X2_TMC_STDBY,SET_INPUT_PULLDOWN(X2_STDBY_PIN)); + TERN_(HAS_Y_TMC_STDBY,SET_INPUT_PULLDOWN(Y_STDBY_PIN)); + TERN_(HAS_Y2_TMC_STDBY,SET_INPUT_PULLDOWN(Y2_STDBY_PIN)); + TERN_(HAS_Z_TMC_STDBY,SET_INPUT_PULLDOWN(Z_STDBY_PIN)); + TERN_(HAS_Z2_TMC_STDBY,SET_INPUT_PULLDOWN(Z2_STDBY_PIN)); + TERN_(HAS_Z3_TMC_STDBY,SET_INPUT_PULLDOWN(Z3_STDBY_PIN)); + TERN_(HAS_Z4_TMC_STDBY,SET_INPUT_PULLDOWN(Z4_STDBY_PIN)); + TERN_(HAS_E0_TMC_STDBY,SET_INPUT_PULLDOWN(E0_STDBY_PIN)); + TERN_(HAS_E1_TMC_STDBY,SET_INPUT_PULLDOWN(E1_STDBY_PIN)); + TERN_(HAS_E2_TMC_STDBY,SET_INPUT_PULLDOWN(E2_STDBY_PIN)); + TERN_(HAS_E3_TMC_STDBY,SET_INPUT_PULLDOWN(E3_STDBY_PIN)); + TERN_(HAS_E4_TMC_STDBY,SET_INPUT_PULLDOWN(E4_STDBY_PIN)); + TERN_(HAS_E5_TMC_STDBY,SET_INPUT_PULLDOWN(E5_STDBY_PIN)); + TERN_(HAS_E6_TMC_STDBY,SET_INPUT_PULLDOWN(E6_STDBY_PIN)); + TERN_(HAS_E7_TMC_STDBY,SET_INPUT_PULLDOWN(E7_STDBY_PIN)); + #if ENABLED(MARLIN_DEV_MODE) auto log_current_ms = [&](PGM_P const msg) { SERIAL_ECHO_START(); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index c9a29b351cbb..4942a5d9048f 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1336,6 +1336,9 @@ #if PIN_EXISTS(X_MS1) #define HAS_X_MS_PINS 1 #endif +#if PIN_EXISTS(X_STDBY) + #define HAS_X_TMC_STDBY 1 +#endif #if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)) #define HAS_X2_ENABLE 1 @@ -1349,6 +1352,9 @@ #if PIN_EXISTS(X2_MS1) #define HAS_X2_MS_PINS 1 #endif +#if PIN_EXISTS(X2_STDBY) + #define HAS_X2_TMC_STDBY 1 +#endif #if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)) #define HAS_Y_ENABLE 1 @@ -1362,6 +1368,9 @@ #if PIN_EXISTS(Y_MS1) #define HAS_Y_MS_PINS 1 #endif +#if PIN_EXISTS(Y_STDBY) + #define HAS_Y_TMC_STDBY 1 +#endif #if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)) #define HAS_Y2_ENABLE 1 @@ -1375,6 +1384,9 @@ #if PIN_EXISTS(Y2_MS1) #define HAS_Y2_MS_PINS 1 #endif +#if PIN_EXISTS(Y2_STDBY) + #define HAS_Y2_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)) #define HAS_Z_ENABLE 1 @@ -1388,6 +1400,9 @@ #if PIN_EXISTS(Z_MS1) #define HAS_Z_MS_PINS 1 #endif +#if PIN_EXISTS(Z_STDBY) + #define HAS_Z_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)) #define HAS_Z2_ENABLE 1 @@ -1401,6 +1416,9 @@ #if PIN_EXISTS(Z2_MS1) #define HAS_Z2_MS_PINS 1 #endif +#if PIN_EXISTS(Z2_STDBY) + #define HAS_Z2_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)) #define HAS_Z3_ENABLE 1 @@ -1414,6 +1432,9 @@ #if PIN_EXISTS(Z3_MS1) #define HAS_Z3_MS_PINS 1 #endif +#if PIN_EXISTS(Z3_STDBY) + #define HAS_Z3_TMC_STDBY 1 +#endif #if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4)) #define HAS_Z4_ENABLE 1 @@ -1427,6 +1448,9 @@ #if PIN_EXISTS(Z4_MS1) #define HAS_Z4_MS_PINS 1 #endif +#if PIN_EXISTS(Z4_STDBY) + #define HAS_Z4_TMC_STDBY 1 +#endif // Extruder steppers and solenoids #if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)) @@ -1444,6 +1468,9 @@ #if PIN_EXISTS(SOL0) #define HAS_SOLENOID_0 1 #endif +#if PIN_EXISTS(E0_STDBY) + #define HAS_E0_TMC_STDBY 1 +#endif #if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)) #define HAS_E1_ENABLE 1 @@ -1460,6 +1487,9 @@ #if PIN_EXISTS(SOL1) #define HAS_SOLENOID_1 1 #endif +#if PIN_EXISTS(E1_STDBY) + #define HAS_E1_TMC_STDBY 1 +#endif #if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)) #define HAS_E2_ENABLE 1 @@ -1476,6 +1506,9 @@ #if PIN_EXISTS(SOL2) #define HAS_SOLENOID_2 1 #endif +#if PIN_EXISTS(E2_STDBY) + #define HAS_E2_TMC_STDBY 1 +#endif #if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)) #define HAS_E3_ENABLE 1 @@ -1492,6 +1525,9 @@ #if PIN_EXISTS(SOL3) #define HAS_SOLENOID_3 1 #endif +#if PIN_EXISTS(E3_STDBY) + #define HAS_E3_TMC_STDBY 1 +#endif #if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)) #define HAS_E4_ENABLE 1 @@ -1508,6 +1544,9 @@ #if PIN_EXISTS(SOL4) #define HAS_SOLENOID_4 1 #endif +#if PIN_EXISTS(E4_STDBY) + #define HAS_E4_TMC_STDBY 1 +#endif #if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)) #define HAS_E5_ENABLE 1 @@ -1524,6 +1563,9 @@ #if PIN_EXISTS(SOL5) #define HAS_SOLENOID_5 1 #endif +#if PIN_EXISTS(E5_STDBY) + #define HAS_E5_TMC_STDBY 1 +#endif #if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)) #define HAS_E6_ENABLE 1 @@ -1540,6 +1582,9 @@ #if PIN_EXISTS(SOL6) #define HAS_SOLENOID_6 1 #endif +#if PIN_EXISTS(E6_STDBY) + #define HAS_E6_TMC_STDBY 1 +#endif #if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)) #define HAS_E7_ENABLE 1 @@ -1556,6 +1601,9 @@ #if PIN_EXISTS(SOL7) #define HAS_SOLENOID_7 1 #endif +#if PIN_EXISTS(E7_STDBY) + #define HAS_E7_TMC_STDBY 1 +#endif // // Trinamic Stepper Drivers From fd78342f700f60ec58ee9295d55fd61c5da8329b Mon Sep 17 00:00:00 2001 From: thisiskeithb Date: Thu, 24 Sep 2020 11:01:50 -0700 Subject: [PATCH 6/7] Update USB_CONNECT_PIN --- Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 80b5bd4a4827..143504f0e338 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -176,7 +176,7 @@ // // USB connect control // -//#define USB_CONNECT_PIN P2_09 +//#define USB_CONNECT_PIN P0_29 //#define USB_CONNECT_INVERTING false /** From 6771dc14966175ee9ce516bd02741637ebab43d5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 24 Sep 2020 21:11:22 -0500 Subject: [PATCH 7/7] Move TMC standby init to a custom method --- Marlin/src/MarlinCore.cpp | 69 ++++++++++++++++++++++-------- Marlin/src/inc/Conditionals_post.h | 48 --------------------- 2 files changed, 52 insertions(+), 65 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 8f6358667d20..c6c6ef9b0db5 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -867,6 +867,57 @@ void stop() { } } +inline void tmc_standby_setup() { + #if PIN_EXISTS(X_STDBY) + SET_INPUT_PULLDOWN(X_STDBY_PIN); + #endif + #if PIN_EXISTS(X2_STDBY) + SET_INPUT_PULLDOWN(X2_STDBY_PIN); + #endif + #if PIN_EXISTS(Y_STDBY) + SET_INPUT_PULLDOWN(Y_STDBY_PIN); + #endif + #if PIN_EXISTS(Y2_STDBY) + SET_INPUT_PULLDOWN(Y2_STDBY_PIN); + #endif + #if PIN_EXISTS(Z_STDBY) + SET_INPUT_PULLDOWN(Z_STDBY_PIN); + #endif + #if PIN_EXISTS(Z2_STDBY) + SET_INPUT_PULLDOWN(Z2_STDBY_PIN); + #endif + #if PIN_EXISTS(Z3_STDBY) + SET_INPUT_PULLDOWN(Z3_STDBY_PIN); + #endif + #if PIN_EXISTS(Z4_STDBY) + SET_INPUT_PULLDOWN(Z4_STDBY_PIN); + #endif + #if PIN_EXISTS(E0_STDBY) + SET_INPUT_PULLDOWN(E0_STDBY_PIN); + #endif + #if PIN_EXISTS(E1_STDBY) + SET_INPUT_PULLDOWN(E1_STDBY_PIN); + #endif + #if PIN_EXISTS(E2_STDBY) + SET_INPUT_PULLDOWN(E2_STDBY_PIN); + #endif + #if PIN_EXISTS(E3_STDBY) + SET_INPUT_PULLDOWN(E3_STDBY_PIN); + #endif + #if PIN_EXISTS(E4_STDBY) + SET_INPUT_PULLDOWN(E4_STDBY_PIN); + #endif + #if PIN_EXISTS(E5_STDBY) + SET_INPUT_PULLDOWN(E5_STDBY_PIN); + #endif + #if PIN_EXISTS(E6_STDBY) + SET_INPUT_PULLDOWN(E6_STDBY_PIN); + #endif + #if PIN_EXISTS(E7_STDBY) + SET_INPUT_PULLDOWN(E7_STDBY_PIN); + #endif +} + /** * Marlin entry-point: Set up before the program loop * - Set up the kill pin, filament runout, power hold @@ -888,23 +939,7 @@ void stop() { */ void setup() { - // TMC Low Power Standby pins need to be set as early as possible or they won't be usable - TERN_(HAS_X_TMC_STDBY,SET_INPUT_PULLDOWN(X_STDBY_PIN)); - TERN_(HAS_X2_TMC_STDBY,SET_INPUT_PULLDOWN(X2_STDBY_PIN)); - TERN_(HAS_Y_TMC_STDBY,SET_INPUT_PULLDOWN(Y_STDBY_PIN)); - TERN_(HAS_Y2_TMC_STDBY,SET_INPUT_PULLDOWN(Y2_STDBY_PIN)); - TERN_(HAS_Z_TMC_STDBY,SET_INPUT_PULLDOWN(Z_STDBY_PIN)); - TERN_(HAS_Z2_TMC_STDBY,SET_INPUT_PULLDOWN(Z2_STDBY_PIN)); - TERN_(HAS_Z3_TMC_STDBY,SET_INPUT_PULLDOWN(Z3_STDBY_PIN)); - TERN_(HAS_Z4_TMC_STDBY,SET_INPUT_PULLDOWN(Z4_STDBY_PIN)); - TERN_(HAS_E0_TMC_STDBY,SET_INPUT_PULLDOWN(E0_STDBY_PIN)); - TERN_(HAS_E1_TMC_STDBY,SET_INPUT_PULLDOWN(E1_STDBY_PIN)); - TERN_(HAS_E2_TMC_STDBY,SET_INPUT_PULLDOWN(E2_STDBY_PIN)); - TERN_(HAS_E3_TMC_STDBY,SET_INPUT_PULLDOWN(E3_STDBY_PIN)); - TERN_(HAS_E4_TMC_STDBY,SET_INPUT_PULLDOWN(E4_STDBY_PIN)); - TERN_(HAS_E5_TMC_STDBY,SET_INPUT_PULLDOWN(E5_STDBY_PIN)); - TERN_(HAS_E6_TMC_STDBY,SET_INPUT_PULLDOWN(E6_STDBY_PIN)); - TERN_(HAS_E7_TMC_STDBY,SET_INPUT_PULLDOWN(E7_STDBY_PIN)); + tmc_standby_setup(); // TMC Low Power Standby pins must be set early or they're not usable #if ENABLED(MARLIN_DEV_MODE) auto log_current_ms = [&](PGM_P const msg) { diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 4942a5d9048f..c9a29b351cbb 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1336,9 +1336,6 @@ #if PIN_EXISTS(X_MS1) #define HAS_X_MS_PINS 1 #endif -#if PIN_EXISTS(X_STDBY) - #define HAS_X_TMC_STDBY 1 -#endif #if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)) #define HAS_X2_ENABLE 1 @@ -1352,9 +1349,6 @@ #if PIN_EXISTS(X2_MS1) #define HAS_X2_MS_PINS 1 #endif -#if PIN_EXISTS(X2_STDBY) - #define HAS_X2_TMC_STDBY 1 -#endif #if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)) #define HAS_Y_ENABLE 1 @@ -1368,9 +1362,6 @@ #if PIN_EXISTS(Y_MS1) #define HAS_Y_MS_PINS 1 #endif -#if PIN_EXISTS(Y_STDBY) - #define HAS_Y_TMC_STDBY 1 -#endif #if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)) #define HAS_Y2_ENABLE 1 @@ -1384,9 +1375,6 @@ #if PIN_EXISTS(Y2_MS1) #define HAS_Y2_MS_PINS 1 #endif -#if PIN_EXISTS(Y2_STDBY) - #define HAS_Y2_TMC_STDBY 1 -#endif #if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)) #define HAS_Z_ENABLE 1 @@ -1400,9 +1388,6 @@ #if PIN_EXISTS(Z_MS1) #define HAS_Z_MS_PINS 1 #endif -#if PIN_EXISTS(Z_STDBY) - #define HAS_Z_TMC_STDBY 1 -#endif #if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)) #define HAS_Z2_ENABLE 1 @@ -1416,9 +1401,6 @@ #if PIN_EXISTS(Z2_MS1) #define HAS_Z2_MS_PINS 1 #endif -#if PIN_EXISTS(Z2_STDBY) - #define HAS_Z2_TMC_STDBY 1 -#endif #if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)) #define HAS_Z3_ENABLE 1 @@ -1432,9 +1414,6 @@ #if PIN_EXISTS(Z3_MS1) #define HAS_Z3_MS_PINS 1 #endif -#if PIN_EXISTS(Z3_STDBY) - #define HAS_Z3_TMC_STDBY 1 -#endif #if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4)) #define HAS_Z4_ENABLE 1 @@ -1448,9 +1427,6 @@ #if PIN_EXISTS(Z4_MS1) #define HAS_Z4_MS_PINS 1 #endif -#if PIN_EXISTS(Z4_STDBY) - #define HAS_Z4_TMC_STDBY 1 -#endif // Extruder steppers and solenoids #if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)) @@ -1468,9 +1444,6 @@ #if PIN_EXISTS(SOL0) #define HAS_SOLENOID_0 1 #endif -#if PIN_EXISTS(E0_STDBY) - #define HAS_E0_TMC_STDBY 1 -#endif #if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)) #define HAS_E1_ENABLE 1 @@ -1487,9 +1460,6 @@ #if PIN_EXISTS(SOL1) #define HAS_SOLENOID_1 1 #endif -#if PIN_EXISTS(E1_STDBY) - #define HAS_E1_TMC_STDBY 1 -#endif #if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)) #define HAS_E2_ENABLE 1 @@ -1506,9 +1476,6 @@ #if PIN_EXISTS(SOL2) #define HAS_SOLENOID_2 1 #endif -#if PIN_EXISTS(E2_STDBY) - #define HAS_E2_TMC_STDBY 1 -#endif #if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)) #define HAS_E3_ENABLE 1 @@ -1525,9 +1492,6 @@ #if PIN_EXISTS(SOL3) #define HAS_SOLENOID_3 1 #endif -#if PIN_EXISTS(E3_STDBY) - #define HAS_E3_TMC_STDBY 1 -#endif #if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)) #define HAS_E4_ENABLE 1 @@ -1544,9 +1508,6 @@ #if PIN_EXISTS(SOL4) #define HAS_SOLENOID_4 1 #endif -#if PIN_EXISTS(E4_STDBY) - #define HAS_E4_TMC_STDBY 1 -#endif #if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)) #define HAS_E5_ENABLE 1 @@ -1563,9 +1524,6 @@ #if PIN_EXISTS(SOL5) #define HAS_SOLENOID_5 1 #endif -#if PIN_EXISTS(E5_STDBY) - #define HAS_E5_TMC_STDBY 1 -#endif #if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)) #define HAS_E6_ENABLE 1 @@ -1582,9 +1540,6 @@ #if PIN_EXISTS(SOL6) #define HAS_SOLENOID_6 1 #endif -#if PIN_EXISTS(E6_STDBY) - #define HAS_E6_TMC_STDBY 1 -#endif #if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)) #define HAS_E7_ENABLE 1 @@ -1601,9 +1556,6 @@ #if PIN_EXISTS(SOL7) #define HAS_SOLENOID_7 1 #endif -#if PIN_EXISTS(E7_STDBY) - #define HAS_E7_TMC_STDBY 1 -#endif // // Trinamic Stepper Drivers