My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pins_BTT_GTR_V1_0.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "env_validate.h"
  24. #if E_STEPPERS > MAX_E_STEPPERS
  25. #error "Marlin extruder/hotends limit! Increase MAX_E_STEPPERS to continue."
  26. #elif HOTENDS > 8 || E_STEPPERS > 8
  27. #error "BIGTREE GTR V1.0 supports up to 8 hotends / E steppers."
  28. #endif
  29. #define BOARD_INFO_NAME "BTT GTR V1.0"
  30. #define USES_DIAG_JUMPERS
  31. #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support
  32. #define M5_EXTENDER // The M5 extender is attached
  33. // Onboard I2C EEPROM
  34. #define I2C_EEPROM
  35. #define MARLIN_EEPROM_SIZE 0x2000 // 8K (24C64)
  36. //
  37. // Servos
  38. //
  39. #define SERVO0_PIN PB11 // BLTOUCH
  40. #define SOL0_PIN PC7 // Toolchanger
  41. #if ENABLED(TOOL_SENSOR)
  42. #define TOOL_SENSOR1_PIN PH6
  43. #define TOOL_SENSOR2_PIN PI4
  44. //#define TOOL_SENSOR3_PIN PF4
  45. #else
  46. #define PS_ON_PIN PH6
  47. #endif
  48. //
  49. // Trinamic Stallguard pins
  50. //
  51. #define X_DIAG_PIN PF2 // X-
  52. #define Y_DIAG_PIN PC13 // Y-
  53. #define Z_DIAG_PIN PE0 // Z-
  54. #define E0_DIAG_PIN PG14 // X+
  55. #define E1_DIAG_PIN PG9 // Y+
  56. #define E2_DIAG_PIN PD3 // Z+
  57. //
  58. // Limit Switches
  59. //
  60. #ifdef X_STALL_SENSITIVITY
  61. #define X_STOP_PIN X_DIAG_PIN
  62. #if X_HOME_TO_MIN
  63. #define X_MAX_PIN E0_DIAG_PIN // X+
  64. #else
  65. #define X_MIN_PIN E0_DIAG_PIN // X+
  66. #endif
  67. #else
  68. #define X_MIN_PIN X_DIAG_PIN // X-
  69. #define X_MAX_PIN E0_DIAG_PIN // X+
  70. #endif
  71. #ifdef Y_STALL_SENSITIVITY
  72. #define Y_STOP_PIN Y_DIAG_PIN
  73. #if Y_HOME_TO_MIN
  74. #define Y_MAX_PIN E1_DIAG_PIN // Y+
  75. #else
  76. #define Y_MIN_PIN E1_DIAG_PIN // Y+
  77. #endif
  78. #else
  79. #define Y_MIN_PIN Y_DIAG_PIN // Y-
  80. #define Y_MAX_PIN E1_DIAG_PIN // Y+
  81. #endif
  82. #ifdef Z_STALL_SENSITIVITY
  83. #define Z_STOP_PIN Z_DIAG_PIN
  84. #if Z_HOME_TO_MIN
  85. #define Z_MAX_PIN E2_DIAG_PIN // Z+
  86. #else
  87. #define Z_MIN_PIN E2_DIAG_PIN // Z+
  88. #endif
  89. #else
  90. #define Z_MIN_PIN Z_DIAG_PIN // Z-
  91. #define Z_MAX_PIN E2_DIAG_PIN // Z+
  92. #endif
  93. //
  94. // Pins on the extender
  95. //
  96. #if ENABLED(M5_EXTENDER)
  97. #define X2_STOP_PIN PI4 // M5 M1_STOP
  98. #define Y2_STOP_PIN PF12 // M5 M5_STOP
  99. #define Z2_STOP_PIN PF4 // M5 M2_STOP
  100. #define Z3_STOP_PIN PI7 // M5 M4_STOP
  101. #define Z4_STOP_PIN PF6 // M5 M3_STOP
  102. #endif
  103. #ifndef Z_MIN_PROBE_PIN
  104. #define Z_MIN_PROBE_PIN PH11 // Z Probe must be PH11
  105. #endif
  106. //
  107. // Steppers
  108. //
  109. #define X_STEP_PIN PC15
  110. #define X_DIR_PIN PF0
  111. #define X_ENABLE_PIN PF1
  112. #ifndef X_CS_PIN
  113. #define X_CS_PIN PC14
  114. #endif
  115. #define Y_STEP_PIN PE3
  116. #define Y_DIR_PIN PE2
  117. #define Y_ENABLE_PIN PE4
  118. #ifndef Y_CS_PIN
  119. #define Y_CS_PIN PE1
  120. #endif
  121. #define Z_STEP_PIN PB8
  122. #define Z_DIR_PIN PB7 // PB7
  123. #define Z_ENABLE_PIN PB9
  124. #ifndef Z_CS_PIN
  125. #define Z_CS_PIN PB5
  126. #endif
  127. #define E0_STEP_PIN PG12
  128. #define E0_DIR_PIN PG11
  129. #define E0_ENABLE_PIN PG13
  130. #ifndef E0_CS_PIN
  131. #define E0_CS_PIN PG10
  132. #endif
  133. #define E1_STEP_PIN PD6
  134. #define E1_DIR_PIN PD5
  135. #define E1_ENABLE_PIN PD7
  136. #ifndef E1_CS_PIN
  137. #define E1_CS_PIN PD4
  138. #endif
  139. #define E2_STEP_PIN PD1
  140. #define E2_DIR_PIN PD0
  141. #define E2_ENABLE_PIN PD2
  142. #ifndef E2_CS_PIN
  143. #define E2_CS_PIN PC12
  144. #endif
  145. #if ENABLED(M5_EXTENDER)
  146. #define E3_STEP_PIN PF3
  147. #define E3_DIR_PIN PG3
  148. #define E3_ENABLE_PIN PF8
  149. #ifndef E3_CS_PIN
  150. #define E3_CS_PIN PG4
  151. #endif
  152. #define E4_STEP_PIN PD14
  153. #define E4_DIR_PIN PD11
  154. #define E4_ENABLE_PIN PG2
  155. #ifndef E4_CS_PIN
  156. #define E4_CS_PIN PE15
  157. #endif
  158. #define E5_STEP_PIN PE12
  159. #define E5_DIR_PIN PE10
  160. #define E5_ENABLE_PIN PF14
  161. #ifndef E5_CS_PIN
  162. #define E5_CS_PIN PE7
  163. #endif
  164. #define E6_STEP_PIN PG0
  165. #define E6_DIR_PIN PG1
  166. #define E6_ENABLE_PIN PE8
  167. #ifndef E6_CS_PIN
  168. #define E6_CS_PIN PF15
  169. #endif
  170. #define E7_STEP_PIN PH12
  171. #define E7_DIR_PIN PH15
  172. #define E7_ENABLE_PIN PI0
  173. #ifndef E7_CS_PIN
  174. #define E7_CS_PIN PH14
  175. #endif
  176. #endif
  177. //
  178. // Software SPI pins for TMC2130 stepper drivers
  179. //
  180. #if ENABLED(TMC_USE_SW_SPI)
  181. #ifndef TMC_SW_MOSI
  182. #define TMC_SW_MOSI PG15
  183. #endif
  184. #ifndef TMC_SW_MISO
  185. #define TMC_SW_MISO PB6
  186. #endif
  187. #ifndef TMC_SW_SCK
  188. #define TMC_SW_SCK PB3
  189. #endif
  190. #endif
  191. #if HAS_TMC_UART
  192. /**
  193. * TMC2208/TMC2209 stepper drivers
  194. *
  195. * Hardware serial communication ports.
  196. * If undefined software serial is used according to the pins below
  197. */
  198. //#define X_HARDWARE_SERIAL Serial1
  199. //#define X2_HARDWARE_SERIAL Serial1
  200. //#define Y_HARDWARE_SERIAL Serial1
  201. //#define Y2_HARDWARE_SERIAL Serial1
  202. //#define Z_HARDWARE_SERIAL Serial1
  203. //#define Z2_HARDWARE_SERIAL Serial1
  204. //#define E0_HARDWARE_SERIAL Serial1
  205. //#define E1_HARDWARE_SERIAL Serial1
  206. //#define E2_HARDWARE_SERIAL Serial1
  207. //#define E3_HARDWARE_SERIAL Serial1 // M5 MOTOR 1
  208. //#define E4_HARDWARE_SERIAL Serial1 // M5 MOTOR 2
  209. //#define E5_HARDWARE_SERIAL Serial1 // M5 MOTOR 3
  210. //#define E6_HARDWARE_SERIAL Serial1 // M5 MOTOR 4
  211. //#define E7_HARDWARE_SERIAL Serial1 // M5 MOTOR 5
  212. #define X_SERIAL_TX_PIN PC14
  213. #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
  214. #define Y_SERIAL_TX_PIN PE1
  215. #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
  216. #define Z_SERIAL_TX_PIN PB5
  217. #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
  218. #define E0_SERIAL_TX_PIN PG10
  219. #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
  220. #define E1_SERIAL_TX_PIN PD4
  221. #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
  222. #define E2_SERIAL_TX_PIN PC12
  223. #define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
  224. #if ENABLED(M5_EXTENDER)
  225. #define E3_SERIAL_TX_PIN PG4
  226. #define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
  227. #define E4_SERIAL_TX_PIN PE15
  228. #define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN
  229. #define E5_SERIAL_TX_PIN PE7
  230. #define E5_SERIAL_RX_PIN E5_SERIAL_TX_PIN
  231. #define E6_SERIAL_TX_PIN PF15
  232. #define E6_SERIAL_RX_PIN E6_SERIAL_TX_PIN
  233. #define E7_SERIAL_TX_PIN PH14
  234. #define E7_SERIAL_RX_PIN E7_SERIAL_TX_PIN
  235. #endif
  236. // Reduce baud rate to improve software serial reliability
  237. #define TMC_BAUD_RATE 19200
  238. #endif
  239. //
  240. // Temperature Sensors
  241. //
  242. #define TEMP_0_PIN PC1 // T1 <-> E0
  243. #define TEMP_1_PIN PC2 // T2 <-> E1
  244. #define TEMP_2_PIN PC3 // T3 <-> E2
  245. #if ENABLED(M5_EXTENDER)
  246. #define TEMP_3_PIN PA3 // M5 TEMP1
  247. #define TEMP_4_PIN PF9 // M5 TEMP2
  248. #define TEMP_5_PIN PF10 // M5 TEMP3
  249. #define TEMP_6_PIN PF7 // M5 TEMP4
  250. #define TEMP_7_PIN PF5 // M5 TEMP5
  251. #endif
  252. #define TEMP_BED_PIN PC0 // T0 <-> Bed
  253. // SPI for MAX Thermocouple
  254. // Uses a separate SPI bus
  255. // If you have a two-way thermocouple, you can customize two TEMP_x_CS_PIN pins (x:0~1)
  256. #define TEMP_0_CS_PIN PH9 // GTR K-TEMP
  257. #define TEMP_0_SCK_PIN PI1 // SCK
  258. #define TEMP_0_MISO_PIN PI2 // MISO
  259. //#define TEMP_0_MOSI_PIN ... // For MAX31865
  260. #define TEMP_1_CS_PIN PH2 // M5 K-TEMP
  261. #define TEMP_1_SCK_PIN TEMP_0_SCK_PIN
  262. #define TEMP_1_MISO_PIN TEMP_0_MISO_PIN
  263. //#define TEMP_1_MOSI_PIN TEMP_0_MOSI_PIN
  264. //
  265. // Heaters / Fans
  266. //
  267. #define HEATER_0_PIN PB1 // Heater0
  268. #define HEATER_1_PIN PA1 // Heater1
  269. #define HEATER_2_PIN PB0 // Heater2
  270. #if ENABLED(M5_EXTENDER)
  271. #define HEATER_3_PIN PD15 // M5 HEAT1
  272. #define HEATER_4_PIN PD13 // M5 HEAT2
  273. #define HEATER_5_PIN PD12 // M5 HEAT3
  274. #define HEATER_6_PIN PE13 // M5 HEAT4
  275. #define HEATER_7_PIN PI6 // M5 HEAT5
  276. #endif
  277. #define HEATER_BED_PIN PA2 // Hotbed
  278. #define FAN_PIN PE5 // Fan0
  279. #define FAN1_PIN PE6 // Fan1
  280. #define FAN2_PIN PC8 // Fan2
  281. #if ENABLED(M5_EXTENDER)
  282. #define FAN3_PIN PI5 // M5 FAN1
  283. #define FAN4_PIN PE9 // M5 FAN2
  284. #define FAN5_PIN PE11 // M5 FAN3
  285. //#define FAN6_PIN PC9 // M5 FAN4
  286. //#define FAN7_PIN PE14 // M5 FAN5
  287. #endif
  288. #ifndef SDCARD_CONNECTION
  289. #define SDCARD_CONNECTION ONBOARD
  290. #endif
  291. //
  292. // By default the LCD SD (SPI2) is enabled
  293. // Onboard SD is on a completely separate SPI bus, and requires
  294. // overriding pins to access.
  295. //
  296. #if SD_CONNECTION_IS(LCD)
  297. #define SD_DETECT_PIN EXP2_07_PIN
  298. #define SDSS EXP2_04_PIN
  299. #elif SD_CONNECTION_IS(ONBOARD)
  300. #define SDSS PA4
  301. #define SD_SS_PIN SDSS
  302. #define SD_SCK_PIN PA5
  303. #define SD_MISO_PIN PA6
  304. #define SD_MOSI_PIN PA7
  305. #define SD_DETECT_PIN PC4
  306. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  307. #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board"
  308. #endif
  309. /**
  310. * ------ ------
  311. * (BEEPER) PC11 | 1 2 | PA15 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SCK)
  312. * (LCD_EN) PC10 | 3 4 | PA8 (LCD_RS) (BTN_EN1) PD10 | 3 4 | PB12 (SD_SS)
  313. * (LCD_D4) PG8 5 6 | PG7 (LCD_D5) (BTN_EN2) PH10 5 6 | PB15 (MOSI)
  314. * (LCD_D6) PG6 | 7 8 | PG5 (LCD_D7) (SD_DETECT) PB10 | 7 8 | RESET
  315. * GND | 9 10 | 5V GND | 9 10 | --
  316. * ------ ------
  317. * EXP1 EXP2
  318. */
  319. #define EXP1_01_PIN PC11
  320. #define EXP1_02_PIN PA15
  321. #define EXP1_03_PIN PC10
  322. #define EXP1_04_PIN PA8
  323. #define EXP1_05_PIN PG8
  324. #define EXP1_06_PIN PG7
  325. #define EXP1_07_PIN PG6
  326. #define EXP1_08_PIN PG5
  327. #define EXP2_01_PIN PB14
  328. #define EXP2_02_PIN PB13
  329. #define EXP2_03_PIN PD10
  330. #define EXP2_04_PIN PB12
  331. #define EXP2_05_PIN PH10
  332. #define EXP2_06_PIN PB15
  333. #define EXP2_07_PIN PB10
  334. //
  335. // LCDs and Controllers
  336. //
  337. #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI)
  338. #define TFT_CS_PIN EXP2_04_PIN
  339. #define TFT_A0_PIN EXP2_07_PIN
  340. #define TFT_SCK_PIN EXP2_02_PIN
  341. #define TFT_MISO_PIN EXP2_01_PIN
  342. #define TFT_MOSI_PIN EXP2_06_PIN
  343. #define TOUCH_INT_PIN EXP1_07_PIN
  344. #define TOUCH_MISO_PIN EXP1_06_PIN
  345. #define TOUCH_MOSI_PIN EXP1_03_PIN
  346. #define TOUCH_SCK_PIN EXP1_05_PIN
  347. #define TOUCH_CS_PIN EXP1_04_PIN
  348. #define BTN_ENC EXP1_02_PIN
  349. #define BTN_EN1 EXP2_03_PIN
  350. #define BTN_EN2 EXP2_05_PIN
  351. #elif HAS_WIRED_LCD
  352. #define BEEPER_PIN EXP1_01_PIN
  353. #define BTN_ENC EXP1_02_PIN
  354. #if ENABLED(CR10_STOCKDISPLAY)
  355. #define LCD_PINS_RS EXP1_07_PIN
  356. #define BTN_EN1 EXP1_03_PIN
  357. #define BTN_EN2 EXP1_05_PIN
  358. #define LCD_PINS_ENABLE EXP1_08_PIN
  359. #define LCD_PINS_D4 EXP1_06_PIN
  360. #elif ENABLED(MKS_MINI_12864)
  361. #define DOGLCD_A0 EXP1_07_PIN
  362. #define DOGLCD_CS EXP1_06_PIN
  363. #define BTN_EN1 EXP2_03_PIN
  364. #define BTN_EN2 EXP2_05_PIN
  365. #if SD_CONNECTION_IS(ONBOARD)
  366. #define SOFTWARE_SPI
  367. #endif
  368. #else
  369. #define LCD_PINS_RS EXP1_04_PIN
  370. #define BTN_EN1 EXP2_03_PIN
  371. #define BTN_EN2 EXP2_05_PIN
  372. #define LCD_PINS_ENABLE EXP1_03_PIN
  373. #define LCD_PINS_D4 EXP1_05_PIN
  374. #if ENABLED(FYSETC_MINI_12864)
  375. #define DOGLCD_CS EXP1_03_PIN
  376. #define DOGLCD_A0 EXP1_04_PIN
  377. #if SD_CONNECTION_IS(ONBOARD)
  378. #define SOFTWARE_SPI
  379. #endif
  380. //#define LCD_BACKLIGHT_PIN -1
  381. #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
  382. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  383. #ifndef RGB_LED_R_PIN
  384. #define RGB_LED_R_PIN EXP1_06_PIN
  385. #endif
  386. #ifndef RGB_LED_G_PIN
  387. #define RGB_LED_G_PIN EXP1_07_PIN
  388. #endif
  389. #ifndef RGB_LED_B_PIN
  390. #define RGB_LED_B_PIN EXP1_08_PIN
  391. #endif
  392. #elif ENABLED(FYSETC_MINI_12864_2_1)
  393. #define NEOPIXEL_PIN EXP1_06_PIN
  394. #endif
  395. #endif // !FYSETC_MINI_12864
  396. #if IS_ULTIPANEL
  397. #define LCD_PINS_D5 EXP1_06_PIN
  398. #define LCD_PINS_D6 EXP1_07_PIN
  399. #define LCD_PINS_D7 EXP1_08_PIN
  400. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  401. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  402. #endif
  403. #endif
  404. #endif
  405. // Alter timing for graphical display
  406. #if IS_U8GLIB_ST7920
  407. #define BOARD_ST7920_DELAY_1 125
  408. #define BOARD_ST7920_DELAY_2 90
  409. #define BOARD_ST7920_DELAY_3 600
  410. #endif
  411. #endif // HAS_WIRED_LCD
  412. #undef TP
  413. #undef M5_EXTENDER