🚸 TH3D EZBoard V2 TMC slave addresses (#23857)
[Marlin.git] / Marlin / src / pins / stm32f4 / pins_TH3D_EZBOARD_V2.h
blobfd6b960542141b687c18eca8bd9ce1040a77a393
1 /**
2 * Marlin 3D Printer Firmware
3 * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5 * Based on Sprinter and grbl.
6 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
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.
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.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 #pragma once
24 #define ALLOW_STM32DUINO
25 #include "env_validate.h"
27 #define BOARD_INFO_NAME "TH3D EZBoard V2"
28 #define BOARD_WEBSITE_URL "th3dstudio.com"
30 //#define V3_EZABL_ON_SERVO // As in TH3D Firmware Config
32 #define DISABLE_JTAGSWD // Disabling J-tag and Debug via SWD
34 // Onboard I2C EEPROM
35 #if NO_EEPROM_SELECTED
36 #define I2C_EEPROM
37 #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
38 #define I2C_SCL_PIN PB6
39 #define I2C_SDA_PIN PB7
40 #undef NO_EEPROM_SELECTED
41 #endif
44 // Neopixels
46 #define NEOPIXEL_PIN PA8
49 // Servos
51 #if ENABLED(V3_EZABL_ON_SERVO)
52 #define SERVO0_PIN -1
53 #else
54 #define SERVO0_PIN PA2
55 #endif
58 // Limit Switches
60 #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
61 // Sensorless homing pins
62 #if ENABLED(X_AXIS_SENSORLESS_HOMING)
63 #define X_STOP_PIN PB4
64 #else
65 #define X_STOP_PIN PC1
66 #endif
68 #if ENABLED(Y_AXIS_SENSORLESS_HOMING)
69 #define Y_STOP_PIN PB9
70 #else
71 #define Y_STOP_PIN PC2
72 #endif
74 //#define Z_STOP_PIN PC15 // Don't use sensorless homing on Z!
76 #define E_STOP_PIN PB10
77 #else
78 // Standard Endstop Pins
79 #define X_STOP_PIN PC1
80 #define Y_STOP_PIN PC2
81 #endif
83 #if ENABLED(V3_EZABL_ON_SERVO)
84 #define Z_STOP_PIN PA2
85 #else
86 #define Z_STOP_PIN PC3
87 #endif
90 // Filament Runout Sensor
92 #ifndef FIL_RUNOUT_PIN
93 #define FIL_RUNOUT_PIN PC0
94 #endif
97 // Steppers
99 #define X_STEP_PIN PB3
100 #define X_DIR_PIN PD2
101 #define X_ENABLE_PIN PB5
103 #define Y_STEP_PIN PB8
104 #define Y_DIR_PIN PC13
105 #define Y_ENABLE_PIN PC12
107 #define Z_STEP_PIN PA3
108 #define Z_DIR_PIN PB1
109 #define Z_ENABLE_PIN PC14
111 #define E0_STEP_PIN PA15
112 #define E0_DIR_PIN PB11
113 #define E0_ENABLE_PIN PB2
115 #if HAS_TMC_UART
117 // Hardware Serial on UART4, Single Wire, 0-3 addresses
119 #define X_SERIAL_TX_PIN PC10
120 #define X_SERIAL_RX_PIN PC11
122 #define Y_SERIAL_TX_PIN PC10
123 #define Y_SERIAL_RX_PIN PC11
125 #define Z_SERIAL_TX_PIN PC10
126 #define Z_SERIAL_RX_PIN PC11
128 #define E0_SERIAL_TX_PIN PC10
129 #define E0_SERIAL_RX_PIN PC11
131 // Reduce baud rate to improve software serial reliability
132 #define TMC_BAUD_RATE 19200
134 // Default TMC slave addresses
135 #ifndef X_SLAVE_ADDRESS
136 #define X_SLAVE_ADDRESS 0
137 #endif
138 #ifndef Y_SLAVE_ADDRESS
139 #define Y_SLAVE_ADDRESS 1
140 #endif
141 #ifndef Z_SLAVE_ADDRESS
142 #define Z_SLAVE_ADDRESS 2
143 #endif
144 #ifndef E0_SLAVE_ADDRESS
145 #define E0_SLAVE_ADDRESS 3
146 #endif
147 #endif
150 // Temp Sensors
151 // 3.3V max when defined as an Analog Input!
153 #define TEMP_0_PIN PA1 // Analog Input PA1
154 #define TEMP_BED_PIN PA0 // Analog Input PA0
157 // Heaters / Fans
159 #define HEATER_BED_PIN PC9
160 #define HEATER_0_PIN PC8
161 #ifndef FAN_PIN
162 #define FAN_PIN PC6
163 #endif
164 #define FAN1_PIN PC7
167 // Auto fans
169 #define AUTO_FAN_PIN PC7
170 #ifndef E0_AUTO_FAN_PIN
171 #define E0_AUTO_FAN_PIN AUTO_FAN_PIN
172 #endif
173 #ifndef E1_AUTO_FAN_PIN
174 #define E1_AUTO_FAN_PIN AUTO_FAN_PIN
175 #endif
176 #ifndef E2_AUTO_FAN_PIN
177 #define E2_AUTO_FAN_PIN AUTO_FAN_PIN
178 #endif
181 // SD Card
184 #define SDCARD_CONNECTION ONBOARD
186 //#define SOFTWARE_SPI
187 #define CUSTOM_SPI_PINS
188 #define SDSS PA4
189 #define SD_SCK_PIN PA5
190 #define SD_MISO_PIN PA6
191 #define SD_MOSI_PIN PA7
192 #define SD_SS_PIN SDSS
193 //#define SD_DETECT_PIN -1
194 //#define ONBOARD_SD_CS_PIN SDSS
197 // LCD / Controller
201 * ------
202 * PA14 |10 9 | PB0
203 * PC4 | 8 7 | --
204 * PC5 | 6 5 PB13
205 * PB12 | 4 3 | PB15
206 * GND | 2 1 | 5V
207 * ------
208 * EXP1
210 * LCD_PINS_D5, D6, and D7 are not present in the EXP1 connector, and will need to be
211 * defined to use the REPRAP_DISCOUNT_SMART_CONTROLLER.
213 * A remote SD card is currently not supported because the pins routed to the EXP2
214 * connector are shared with the onboard SD card.
216 #define EXP1_03_PIN PB15
217 #define EXP1_04_PIN PB12
218 #define EXP1_05_PIN PB13
219 #define EXP1_06_PIN PC5
220 //#define EXP1_07_PIN -1
221 #define EXP1_08_PIN PC4
222 #define EXP1_09_PIN PB0
223 #define EXP1_10_PIN PA14
225 #if ENABLED(CR10_STOCKDISPLAY)
226 /** ------
227 * BEEPER |10 9 | ENC
228 * EN1 | 8 7 | RESET
229 * EN2 | 6 5 LCD_D4
230 * LCD_RS | 4 3 | LCD_EN
231 * GND | 2 1 | 5V
232 * ------
234 #ifdef DISABLE_JTAGSWD
235 #define BEEPER_PIN EXP1_10_PIN // Not connected in dev board
236 #endif
237 #define LCD_PINS_RS EXP1_04_PIN
238 #define LCD_PINS_ENABLE EXP1_03_PIN
239 #define LCD_PINS_D4 EXP1_05_PIN
240 //#define KILL_PIN -1
242 #define BOARD_ST7920_DELAY_1 600
243 #define BOARD_ST7920_DELAY_2 750
244 #define BOARD_ST7920_DELAY_3 750
246 #elif ENABLED(MKS_MINI_12864)
247 /** ------
248 * SCK |10 9 | ENC
249 * EN1 | 8 7 | --
250 * EN2 | 6 5 A0
251 * CS | 4 3 | MOSI
252 * GND | 2 1 | 5V
253 * ------
255 #define DOGLCD_CS EXP1_04_PIN
256 #define DOGLCD_A0 EXP1_05_PIN
257 #define DOGLCD_SCK EXP1_10_PIN
258 #define DOGLCD_MOSI EXP1_03_PIN
259 #define LCD_CONTRAST_INIT 160
260 #define LCD_CONTRAST_MIN 120
261 #define LCD_CONTRAST_MAX 180
262 #define FORCE_SOFT_SPI
263 #define LCD_BACKLIGHT_PIN -1
265 #elif HAS_WIRED_LCD
267 #error "Only CR10_STOCKDISPLAY or MKS_MINI_12864 are supported with TH3D EZBoard V2."
269 #endif
271 #if EITHER(CR10_STOCKDISPLAY, MKS_MINI_12864)
272 #define BTN_EN1 EXP1_08_PIN
273 #define BTN_EN2 EXP1_06_PIN
274 #define BTN_ENC EXP1_09_PIN
275 #endif