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/>.
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
35 #if NO_EEPROM_SELECTED
37 #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
38 #define I2C_SCL_PIN PB6
39 #define I2C_SDA_PIN PB7
40 #undef NO_EEPROM_SELECTED
46 #define NEOPIXEL_PIN PA8
51 #if ENABLED(V3_EZABL_ON_SERVO)
54 #define SERVO0_PIN PA2
60 #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
61 // Sensorless homing pins
62 #if ENABLED(X_AXIS_SENSORLESS_HOMING)
63 #define X_STOP_PIN PB4
65 #define X_STOP_PIN PC1
68 #if ENABLED(Y_AXIS_SENSORLESS_HOMING)
69 #define Y_STOP_PIN PB9
71 #define Y_STOP_PIN PC2
74 //#define Z_STOP_PIN PC15 // Don't use sensorless homing on Z!
76 #define E_STOP_PIN PB10
78 // Standard Endstop Pins
79 #define X_STOP_PIN PC1
80 #define Y_STOP_PIN PC2
83 #if ENABLED(V3_EZABL_ON_SERVO)
84 #define Z_STOP_PIN PA2
86 #define Z_STOP_PIN PC3
90 // Filament Runout Sensor
92 #ifndef FIL_RUNOUT_PIN
93 #define FIL_RUNOUT_PIN PC0
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
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
138 #ifndef Y_SLAVE_ADDRESS
139 #define Y_SLAVE_ADDRESS 1
141 #ifndef Z_SLAVE_ADDRESS
142 #define Z_SLAVE_ADDRESS 2
144 #ifndef E0_SLAVE_ADDRESS
145 #define E0_SLAVE_ADDRESS 3
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
159 #define HEATER_BED_PIN PC9
160 #define HEATER_0_PIN PC8
169 #define AUTO_FAN_PIN PC7
170 #ifndef E0_AUTO_FAN_PIN
171 #define E0_AUTO_FAN_PIN AUTO_FAN_PIN
173 #ifndef E1_AUTO_FAN_PIN
174 #define E1_AUTO_FAN_PIN AUTO_FAN_PIN
176 #ifndef E2_AUTO_FAN_PIN
177 #define E2_AUTO_FAN_PIN AUTO_FAN_PIN
184 #define SDCARD_CONNECTION ONBOARD
186 //#define SOFTWARE_SPI
187 #define CUSTOM_SPI_PINS
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
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)
230 * LCD_RS | 4 3 | LCD_EN
234 #ifdef DISABLE_JTAGSWD
235 #define BEEPER_PIN EXP1_10_PIN // Not connected in dev board
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)
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
267 #error "Only CR10_STOCKDISPLAY or MKS_MINI_12864 are supported with TH3D EZBoard V2."
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