Skip to content

Commit eb3022e

Browse files
thisiskeithbvgadreau
authored andcommitted
BigTreeTech SKR E3 Turbo (MarlinFirmware#19500)
1 parent 3235959 commit eb3022e

File tree

4 files changed

+322
-0
lines changed

4 files changed

+322
-0
lines changed

Marlin/src/MarlinCore.cpp

+53
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,57 @@ void stop() {
867867
}
868868
}
869869

870+
inline void tmc_standby_setup() {
871+
#if PIN_EXISTS(X_STDBY)
872+
SET_INPUT_PULLDOWN(X_STDBY_PIN);
873+
#endif
874+
#if PIN_EXISTS(X2_STDBY)
875+
SET_INPUT_PULLDOWN(X2_STDBY_PIN);
876+
#endif
877+
#if PIN_EXISTS(Y_STDBY)
878+
SET_INPUT_PULLDOWN(Y_STDBY_PIN);
879+
#endif
880+
#if PIN_EXISTS(Y2_STDBY)
881+
SET_INPUT_PULLDOWN(Y2_STDBY_PIN);
882+
#endif
883+
#if PIN_EXISTS(Z_STDBY)
884+
SET_INPUT_PULLDOWN(Z_STDBY_PIN);
885+
#endif
886+
#if PIN_EXISTS(Z2_STDBY)
887+
SET_INPUT_PULLDOWN(Z2_STDBY_PIN);
888+
#endif
889+
#if PIN_EXISTS(Z3_STDBY)
890+
SET_INPUT_PULLDOWN(Z3_STDBY_PIN);
891+
#endif
892+
#if PIN_EXISTS(Z4_STDBY)
893+
SET_INPUT_PULLDOWN(Z4_STDBY_PIN);
894+
#endif
895+
#if PIN_EXISTS(E0_STDBY)
896+
SET_INPUT_PULLDOWN(E0_STDBY_PIN);
897+
#endif
898+
#if PIN_EXISTS(E1_STDBY)
899+
SET_INPUT_PULLDOWN(E1_STDBY_PIN);
900+
#endif
901+
#if PIN_EXISTS(E2_STDBY)
902+
SET_INPUT_PULLDOWN(E2_STDBY_PIN);
903+
#endif
904+
#if PIN_EXISTS(E3_STDBY)
905+
SET_INPUT_PULLDOWN(E3_STDBY_PIN);
906+
#endif
907+
#if PIN_EXISTS(E4_STDBY)
908+
SET_INPUT_PULLDOWN(E4_STDBY_PIN);
909+
#endif
910+
#if PIN_EXISTS(E5_STDBY)
911+
SET_INPUT_PULLDOWN(E5_STDBY_PIN);
912+
#endif
913+
#if PIN_EXISTS(E6_STDBY)
914+
SET_INPUT_PULLDOWN(E6_STDBY_PIN);
915+
#endif
916+
#if PIN_EXISTS(E7_STDBY)
917+
SET_INPUT_PULLDOWN(E7_STDBY_PIN);
918+
#endif
919+
}
920+
870921
/**
871922
* Marlin entry-point: Set up before the program loop
872923
* - Set up the kill pin, filament runout, power hold
@@ -888,6 +939,8 @@ void stop() {
888939
*/
889940
void setup() {
890941

942+
tmc_standby_setup(); // TMC Low Power Standby pins must be set early or they're not usable
943+
891944
#if ENABLED(MARLIN_DEV_MODE)
892945
auto log_current_ms = [&](PGM_P const msg) {
893946
SERIAL_ECHO_START();

Marlin/src/core/boards.h

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed)
224224
#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
225225
#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed)
226+
#define BOARD_BTT_SKR_E3_TURBO 2015 // BigTreeTech SKR E3 Turbo (Power outputs: Hotend0, Hotend1, Fan, Bed)
226227

227228
//
228229
// LPC1769 ARM Cortex M3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#ifndef BOARD_INFO_NAME
25+
#define BOARD_INFO_NAME "BTT SKR E3 Turbo"
26+
#endif
27+
28+
// Onboard I2C EEPROM
29+
#define I2C_EEPROM
30+
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB (AT24C32)
31+
32+
//
33+
// Servos
34+
//
35+
#define SERVO0_PIN P1_23
36+
37+
//
38+
// TMC StallGuard DIAG pins
39+
//
40+
#define X_DIAG_PIN P1_29 // X-STOP
41+
#define Y_DIAG_PIN P1_28 // Y-STOP
42+
#define Z_DIAG_PIN P1_27 // Z-STOP
43+
#define E0_DIAG_PIN P1_26 // E0DET
44+
#define E1_DIAG_PIN P1_25 // E1DET
45+
46+
//
47+
// Limit Switches
48+
#define X_STOP_PIN X_DIAG_PIN
49+
#define Y_STOP_PIN Y_DIAG_PIN
50+
#define Z_STOP_PIN Z_DIAG_PIN
51+
52+
//
53+
// Z Probe
54+
//
55+
#ifndef Z_MIN_PROBE_PIN
56+
#define Z_MIN_PROBE_PIN P1_22
57+
#endif
58+
59+
//
60+
// Filament Runout Sensor
61+
//
62+
#define FIL_RUNOUT_PIN P1_26 // E0DET
63+
#define FIL_RUNOUT2_PIN P1_25 // E1DET
64+
65+
//
66+
// Power Supply Control
67+
//
68+
#ifndef PS_ON_PIN
69+
#define PS_ON_PIN P1_21
70+
#endif
71+
72+
// LED driving pin
73+
#define NEOPIXEL_PIN P1_24
74+
75+
//
76+
// Power Loss Detection
77+
//
78+
#ifndef POWER_LOSS_PIN
79+
#define POWER_LOSS_PIN P1_20 // PWRDET
80+
#endif
81+
82+
//
83+
// Steppers
84+
//
85+
#define X_STEP_PIN P1_04
86+
#define X_DIR_PIN P1_08
87+
#define X_ENABLE_PIN P1_00
88+
#ifndef X_CS_PIN
89+
#define X_CS_PIN P1_01
90+
#endif
91+
92+
#define Y_STEP_PIN P1_14
93+
#define Y_DIR_PIN P1_15
94+
#define Y_ENABLE_PIN P1_09
95+
#ifndef Y_CS_PIN
96+
#define Y_CS_PIN P1_10
97+
#endif
98+
99+
#define Z_STEP_PIN P4_29
100+
#define Z_DIR_PIN P4_28
101+
#define Z_ENABLE_PIN P1_16
102+
#ifndef Z_CS_PIN
103+
#define Z_CS_PIN P1_17
104+
#endif
105+
106+
#define E0_STEP_PIN P2_06
107+
#define E0_DIR_PIN P2_07
108+
#define E0_ENABLE_PIN P0_04
109+
#ifndef E0_CS_PIN
110+
#define E0_CS_PIN P0_05
111+
#endif
112+
113+
#define E1_STEP_PIN P2_11
114+
#define E1_DIR_PIN P2_12
115+
#define E1_ENABLE_PIN P0_21
116+
#ifndef E1_CS_PIN
117+
#define E1_CS_PIN P0_22
118+
#endif
119+
120+
#if HAS_TMC_UART
121+
/**
122+
* TMC2208/TMC2209 stepper drivers
123+
*
124+
* Hardware serial communication ports.
125+
* If undefined software serial is used according to the pins below
126+
*/
127+
128+
//
129+
// Software serial
130+
//
131+
#define X_SERIAL_TX_PIN P1_01
132+
#define X_SERIAL_RX_PIN P1_01
133+
134+
#define Y_SERIAL_TX_PIN P1_10
135+
#define Y_SERIAL_RX_PIN P1_10
136+
137+
#define Z_SERIAL_TX_PIN P1_17
138+
#define Z_SERIAL_RX_PIN P1_17
139+
140+
#define E0_SERIAL_TX_PIN P0_05
141+
#define E0_SERIAL_RX_PIN P0_05
142+
143+
#define E1_SERIAL_TX_PIN P0_22
144+
#define E1_SERIAL_RX_PIN P0_22
145+
146+
// Reduce baud rate to improve software serial reliability
147+
#define TMC_BAUD_RATE 19200
148+
#endif
149+
150+
//
151+
// TMC Low Power Standby pins
152+
//
153+
#define X_STDBY_PIN P3_26
154+
#define Y_STDBY_PIN P3_25
155+
#define Z_STDBY_PIN P1_18
156+
#define E0_STDBY_PIN P1_19
157+
#define E1_STDBY_PIN P2_13
158+
159+
//
160+
// Temperature Sensors
161+
//
162+
#define TEMP_0_PIN P0_24
163+
#define TEMP_1_PIN P0_23
164+
//#define TEMP_2_PIN P1_30 // Onboard thermistor
165+
#define TEMP_BED_PIN P0_25
166+
167+
//
168+
// Heaters / Fans
169+
//
170+
#define HEATER_0_PIN P2_03 // EXTRUDER 0
171+
#define HEATER_1_PIN P2_04 // EXTRUDER 1
172+
#define HEATER_BED_PIN P2_05 // BED
173+
#define FAN_PIN P2_01
174+
#define FAN1_PIN P2_02
175+
176+
//
177+
// USB connect control
178+
//
179+
//#define USB_CONNECT_PIN P0_29
180+
//#define USB_CONNECT_INVERTING false
181+
182+
/**
183+
* _____
184+
* 5V | 1 2 | GND
185+
* (LCD_EN) P0_18 | 3 4 | P0_17 (LCD_RS)
186+
* (LCD_D4) P0_15 | 5 6 P0_20 (BTN_EN2)
187+
* RESET | 7 8 | P0_19 (BTN_EN1)
188+
* (BTN_ENC) P0_16 | 9 10| P2_08 (BEEPER)
189+
* -----
190+
* EXP
191+
*/
192+
193+
#define EXPA1_03_PIN P0_18
194+
#define EXPA1_04_PIN P0_17
195+
#define EXPA1_05_PIN P0_15
196+
#define EXPA1_06_PIN P0_20
197+
#define EXPA1_07_PIN -1
198+
#define EXPA1_08_PIN P0_19
199+
#define EXPA1_09_PIN P0_16
200+
#define EXPA1_10_PIN P2_08
201+
202+
#if HAS_SPI_LCD
203+
204+
#if ENABLED(CR10_STOCKDISPLAY)
205+
206+
#define BEEPER_PIN EXPA1_10_PIN
207+
208+
#define BTN_EN1 EXPA1_08_PIN
209+
#define BTN_EN2 EXPA1_06_PIN
210+
#define BTN_ENC EXPA1_09_PIN
211+
212+
#define LCD_PINS_RS EXPA1_04_PIN
213+
#define LCD_PINS_ENABLE EXPA1_03_PIN
214+
#define LCD_PINS_D4 EXPA1_05_PIN
215+
216+
#elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
217+
218+
#error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_E3_TURBO.h' for details. Comment out this line to continue."
219+
220+
#define LCD_PINS_RS EXPA1_05_PIN
221+
#define LCD_PINS_ENABLE EXPA1_09_PIN
222+
#define LCD_PINS_D4 EXPA1_04_PIN
223+
#define LCD_PINS_D5 EXPA1_06_PIN
224+
#define LCD_PINS_D6 EXPA1_08_PIN
225+
#define LCD_PINS_D7 EXPA1_10_PIN
226+
#define ADC_KEYPAD_PIN P1_23 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
227+
228+
#elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
229+
230+
#define BTN_EN1 EXPA1_08_PIN
231+
#define BTN_EN2 EXPA1_06_PIN
232+
#define BTN_ENC EXPA1_09_PIN
233+
234+
#define DOGLCD_CS EXPA1_04_PIN
235+
#define DOGLCD_A0 EXPA1_05_PIN
236+
#define DOGLCD_SCK EXPA1_10_PIN
237+
#define DOGLCD_MOSI EXPA1_03_PIN
238+
#define FORCE_SOFT_SPI
239+
#define LCD_BACKLIGHT_PIN -1
240+
241+
#else
242+
243+
#error "Only ZONESTAR_LCD, MKS_MINI_12864, ENDER2_STOCKDISPLAY, and CR10_STOCKDISPLAY are currently supported on the BTT_SKR_E3_TURBO."
244+
245+
#endif
246+
247+
#endif // HAS_SPI_LCD
248+
249+
//
250+
// SD Support
251+
//
252+
#ifndef SDCARD_CONNECTION
253+
#define SDCARD_CONNECTION ONBOARD
254+
#endif
255+
256+
#if SD_CONNECTION_IS(ONBOARD)
257+
#define SD_DETECT_PIN P2_00
258+
#define SCK_PIN P0_07
259+
#define MISO_PIN P0_08
260+
#define MOSI_PIN P0_09
261+
#define SS_PIN P0_06
262+
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
263+
#error "SD CUSTOM_CABLE is not compatible with SKR E3 Turbo."
264+
#endif
265+
266+
#define ON_BOARD_SPI_DEVICE 1 // SPI1

Marlin/src/pins/pins.h

+2
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@
421421
#include "lpc1769/pins_BTT_SKR_V1_4_TURBO.h" // LPC1769 env:LPC1769
422422
#elif MB(MKS_SGEN_L_V2)
423423
#include "lpc1769/pins_MKS_SGEN_L_V2.h" // LPC1769 env:LPC1769
424+
#elif MB(BTT_SKR_E3_TURBO)
425+
#include "lpc1769/pins_BTT_SKR_E3_TURBO.h" // LPC1769 env:LPC1769
424426

425427
//
426428
// Due (ATSAM) boards

0 commit comments

Comments
 (0)