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_E3_RRF.h 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2021 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. #if NOT_TARGET(STM32F4)
  24. #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
  25. #endif
  26. #ifndef BOARD_INFO_NAME
  27. #define BOARD_INFO_NAME "BTT E3 RRF"
  28. #endif
  29. #define USES_DIAG_JUMPERS
  30. // Add-on board for IDEX conversion
  31. //#define BTT_E3_RRF_IDEX_BOARD
  32. // Onboard I2C EEPROM
  33. #define I2C_EEPROM
  34. #define MARLIN_EEPROM_SIZE 0x1000 // 4K
  35. //
  36. // Servos
  37. //
  38. #define SERVO0_PIN PB0 // SERVOS
  39. //
  40. // Limit Switches
  41. //
  42. #define X_STOP_PIN PC0 // X-STOP
  43. #define Y_STOP_PIN PC1 // Y-STOP
  44. #define Z_STOP_PIN PC2 // Z-STOP
  45. #if ENABLED(BTT_E3_RRF_IDEX_BOARD)
  46. #if X2_USE_ENDSTOP == _XMAX_
  47. #define X_MAX_PIN FPC2_PIN // X2-STOP
  48. #elif X2_USE_ENDSTOP == _XMIN_
  49. #define X_MIN_PIN FPC2_PIN // X2-STOP
  50. #endif
  51. #endif
  52. //
  53. // Z Probe must be this pin
  54. //
  55. #define Z_MIN_PROBE_PIN PC5 // PROBE
  56. //
  57. // Filament Runout Sensor
  58. //
  59. #ifndef FIL_RUNOUT_PIN
  60. #define FIL_RUNOUT_PIN PC3 // E0-STOP
  61. #endif
  62. #if !defined(FIL1_RUNOUT2_PIN) && ENABLED(BTT_E3_RRF_IDEX_BOARD)
  63. #define FIL_RUNOUT2_PIN FPC3_PIN // E1-STOP
  64. #endif
  65. //
  66. // Power-loss Detection
  67. //
  68. #ifndef POWER_LOSS_PIN
  69. #define POWER_LOSS_PIN PE0 // Power Loss Detection: PWR-DET
  70. #endif
  71. //
  72. // Steppers
  73. //
  74. #define X_ENABLE_PIN PD7
  75. #define X_STEP_PIN PD5
  76. #define X_DIR_PIN PD4
  77. #define Y_ENABLE_PIN PD3
  78. #define Y_STEP_PIN PD0
  79. #define Y_DIR_PIN PA15
  80. #define Z_ENABLE_PIN PD14
  81. #define Z_STEP_PIN PC6
  82. #define Z_DIR_PIN PC7
  83. #define E0_ENABLE_PIN PD10
  84. #define E0_STEP_PIN PD12
  85. #define E0_DIR_PIN PD13
  86. #if ENABLED(BTT_E3_RRF_IDEX_BOARD)
  87. #define E1_ENABLE_PIN FPC7_PIN // E1EN
  88. #define E1_STEP_PIN FPC5_PIN // E1STP
  89. #define E1_DIR_PIN FPC4_PIN // E1DIR
  90. #define X2_ENABLE_PIN FPC13_PIN // X2EN
  91. #define X2_STEP_PIN FPC11_PIN // X2STP
  92. #define X2_DIR_PIN FPC10_PIN // X2DIR
  93. #endif
  94. /**
  95. * TMC2208/TMC2209 stepper drivers
  96. */
  97. #if HAS_TMC_UART
  98. #define X_SERIAL_TX_PIN PD6
  99. #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
  100. #define Y_SERIAL_TX_PIN PD1
  101. #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
  102. #define Z_SERIAL_TX_PIN PD15
  103. #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
  104. #define E0_SERIAL_TX_PIN PD11
  105. #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
  106. #if ENABLED(BTT_E3_RRF_IDEX_BOARD)
  107. #define X2_SERIAL_TX_PIN FPC12_PIN // X2UART
  108. #define X2_SERIAL_RX_PIN X2_SERIAL_TX_PIN
  109. #define E1_SERIAL_TX_PIN FPC6_PIN // E1UART
  110. #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
  111. #endif
  112. // Reduce baud rate to improve software serial reliability
  113. #define TMC_BAUD_RATE 19200
  114. #endif
  115. //
  116. // Temperature Sensors
  117. //
  118. #define TEMP_BED_PIN PA1 // Analog Input "TB"
  119. #define TEMP_0_PIN PA0 // Analog Input "TH0"
  120. #if ENABLED(BTT_E3_RRF_IDEX_BOARD)
  121. #define TEMP_1_PIN FPC9_PIN // Analog Input "TH1"
  122. #define PT100_PIN FPC8_PIN // Analog Input "PT100" (INA826)
  123. #endif
  124. //
  125. // Heaters / Fans
  126. //
  127. #define HEATER_BED_PIN PB4 // "HB"
  128. #define HEATER_0_PIN PB3 // "HE0"
  129. #if ENABLED(BTT_E3_RRF_IDEX_BOARD)
  130. #define HEATER_1_PIN FPC16_PIN // "HE1"
  131. #endif
  132. #define FAN_PIN PB5 // "FAN0"
  133. #ifndef CONTROLLER_FAN_PIN
  134. #define CONTROLLER_FAN_PIN PB6 // "FAN1"
  135. #endif
  136. #if ENABLED(BTT_E3_RRF_IDEX_BOARD)
  137. #define FAN1_PIN FPC15_PIN // "FAN0" in IDEX board
  138. #define FAN2_PIN FPC14_PIN // "FAN1" in IDEX board
  139. #else
  140. //#define FAN1_PIN PB6 // "FAN1"
  141. #endif
  142. //
  143. // Misc. Functions
  144. //
  145. #ifndef NEOPIXEL_PIN
  146. #define NEOPIXEL_PIN PB7 // LED driving pin
  147. #endif
  148. #ifndef PS_ON_PIN
  149. #define PS_ON_PIN PE1 // Power Supply Control
  150. #endif
  151. /**
  152. * BTT E3 RRF
  153. * ------
  154. * (BEEPER) PE8 | 1 2 | PE9 (BTN_ENC)
  155. * (BTN_EN1) PE7 | 3 4 | RESET
  156. * (BTN_EN2) PB2 5 6 | PE10 (LCD_D4)
  157. * (LCD_RS) PB1 | 7 8 | PE11 (LCD_EN)
  158. * GND | 9 10 | 5V
  159. * ------
  160. * EXP1
  161. */
  162. #if HAS_WIRED_LCD
  163. #if EITHER(CR10_STOCKDISPLAY, LCD_FOR_MELZI)
  164. #define BEEPER_PIN PE8
  165. #define BTN_ENC PE9
  166. #define BTN_EN1 PE7
  167. #define BTN_EN2 PB2
  168. #define LCD_PINS_RS PB1
  169. #define LCD_PINS_ENABLE PE11
  170. #define LCD_PINS_D4 PE10
  171. #if ENABLED(LCD_FOR_MELZI)
  172. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  173. #error "CAUTION! LCD_FOR_MELZI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  174. #endif
  175. /** LCD_FOR_MELZI display pinout
  176. *
  177. * BTT E3 RRF Display Ribbon
  178. * ------ ------
  179. * (BEEPER) PE8 | 1 2 | PE9 (BTN_ENC) GND |10 9 | 5V
  180. * (BTN_EN1) PE7 | 3 4 | RESET BEEPER | 8 7 | ESTOP (RESET)
  181. * (BTN_EN2) PB2 5 6 | PE10 (LCD_D4) (BTN_ENC) ENC_BTN | 6 5 | LCD_SCLK (LCD_D4)
  182. * (LCD_RS) PB1 | 7 8 | PE11 (LCD_EN) (BTN_EN2) ENC_A | 4 3 | LCD_DATA (LCD_EN)
  183. * GND | 9 10 | 5V (BTN_EN1) ENC_B | 2 1 | LCD_CS (LCD_RS)
  184. * ------ ------
  185. * EXP1 LCD
  186. *
  187. * Needs custom cable:
  188. *
  189. * Board Adapter Display Ribbon (coming from display)
  190. * ----------------------------------
  191. * EXP1-10 ---------- LCD-9 5V
  192. * EXP1-9 ----------- LCD-10 GND
  193. * EXP1-8 ----------- LCD-3 LCD_EN
  194. * EXP1-7 ----------- LCD-1 LCD_RS
  195. * EXP1-6 ----------- LCD-5 LCD_D4
  196. * EXP1-5 ----------- LCD-4 EN2
  197. * EXP1-4 ----------- LCD-7 RESET
  198. * EXP1-3 ----------- LCD-2 EN1
  199. * EXP1-2 ----------- LCD-6 BTN
  200. * EXP1-1 ----------- LCD-8 BEEPER
  201. */
  202. #endif
  203. #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  204. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  205. #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  206. #endif
  207. #define LCD_PINS_RS PE10
  208. #define LCD_PINS_ENABLE PE9
  209. #define LCD_PINS_D4 PB1
  210. #define LCD_PINS_D5 PB2
  211. #define LCD_PINS_D6 PE7
  212. #define LCD_PINS_D7 PE8
  213. #define ADC_KEYPAD_PIN PB0 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  214. #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
  215. #define BTN_ENC PE9
  216. #define BTN_EN1 PE7
  217. #define BTN_EN2 PB2
  218. #define DOGLCD_CS PB1
  219. #define DOGLCD_A0 PE10
  220. #define DOGLCD_SCK PE8
  221. #define DOGLCD_MOSI PE11
  222. #define FORCE_SOFT_SPI
  223. #define LCD_BACKLIGHT_PIN -1
  224. #elif IS_TFTGLCD_PANEL
  225. #if ENABLED(TFTGLCD_PANEL_SPI)
  226. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  227. #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  228. #endif
  229. /**
  230. * TFTGLCD_PANEL_SPI display pinout
  231. *
  232. * Board Display
  233. * ------ ------
  234. * (SD_DET) PE8 | 1 2 | PE9 (BEEPER) 5V |10 9 | GND
  235. * (MOD_RESET) PE7 | 3 4 | RESET -- | 8 7 | (SD_DET)
  236. * (SD_CS) PB2 5 6 | PE10 (MOSI) 6 5 | --
  237. * (LCD_CS) PB1 | 7 8 | PE11 (SD_CS) | 4 3 | (LCD_CS)
  238. * GND | 9 10 | 5V (SCK) | 2 1 | (MISO)
  239. * ------ ------
  240. * EXP1 EXP1
  241. *
  242. * Needs custom cable:
  243. *
  244. * Board Adapter Display
  245. * ----------------------------------
  246. * EXP1-10 ---------- EXP1-10 5V
  247. * EXP1-9 ----------- EXP1-9 GND
  248. * SPI1-4 ----------- EXP1-6 MOSI
  249. * EXP1-7 ----------- n/c
  250. * SPI1-3 ----------- EXP1-2 SCK
  251. * EXP1-5 ----------- EXP1-4 SD_CS
  252. * EXP1-4 ----------- n/c
  253. * EXP1-3 ----------- EXP1-3 LCD_CS
  254. * SPI1-1 ----------- EXP1-1 MISO
  255. * EXP1-1 ----------- EXP1-7 SD_DET
  256. */
  257. #define TFTGLCD_CS PE7
  258. #endif
  259. #else
  260. #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, LCD_FOR_MELZI, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BTT_E3_RRF."
  261. #endif
  262. // Alter timing for graphical display
  263. #if ENABLED(LCD_FOR_MELZI) // LCD_FOR_MELZI default timing is too fast. This works but may be reduced.
  264. #define BOARD_ST7920_DELAY_1 200
  265. #define BOARD_ST7920_DELAY_2 400
  266. #define BOARD_ST7920_DELAY_3 1200
  267. #elif IS_U8GLIB_ST7920
  268. #define BOARD_ST7920_DELAY_1 96
  269. #define BOARD_ST7920_DELAY_2 48
  270. #define BOARD_ST7920_DELAY_3 600
  271. #endif
  272. #endif // HAS_WIRED_LCD
  273. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  274. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  275. #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  276. #endif
  277. /** FYSETC TFT TFT81050 display pinout
  278. *
  279. * Board Display
  280. * ------ ------
  281. * (SD_DET) PE8 | 1 2 | PE9 (BEEPER) 5V |10 9 | GND
  282. * (MOD_RESET) PE7 | 3 4 | RESET RESET | 8 7 | (SD_DET)
  283. * (SD_CS) PB2 5 6 | PE10 (MOSI) | 6 5 | (LCD_CS)
  284. * (LCD_CS) PB1 | 7 8 | PE11 (SD_CS) | 4 3 | (MOD_RESET)
  285. * GND | 9 10 | 5V (SCK) | 2 1 | (MISO)
  286. * ------ ------
  287. * EXP1 EXP1
  288. *
  289. * Needs custom cable:
  290. *
  291. * Board Adapter Display
  292. * ----------------------------------
  293. * EXP1-10 ---------- EXP1-10 5V
  294. * EXP1-9 ----------- EXP1-9 GND
  295. * SPI1-4 ----------- EXP1-6 MOSI
  296. * EXP1-7 ----------- EXP1-5 LCD_CS
  297. * SPI1-3 ----------- EXP1-2 SCK
  298. * EXP1-5 ----------- EXP1-4 SD_CS
  299. * EXP1-4 ----------- EXP1-8 RESET
  300. * EXP1-3 ----------- EXP1-3 MOD_RST
  301. * SPI1-1 ----------- EXP1-1 MISO
  302. * EXP1-1 ----------- EXP1-7 SD_DET
  303. */
  304. #define CLCD_SPI_BUS 1 // SPI1 connector
  305. #define BEEPER_PIN PE9
  306. #define CLCD_MOD_RESET PE7
  307. #define CLCD_SPI_CS PB1
  308. #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
  309. //
  310. // SD Support
  311. //
  312. #ifndef SDCARD_CONNECTION
  313. #define SDCARD_CONNECTION ONBOARD
  314. #endif
  315. #if SD_CONNECTION_IS(ONBOARD)
  316. #define SDIO_SUPPORT // Use SDIO for onboard SD
  317. //#define SDIO_CLOCK 48000000
  318. #define SD_DETECT_PIN PC4
  319. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  320. #error "SD CUSTOM_CABLE is not compatible with BTT E3 RRF."
  321. #endif
  322. //
  323. // WIFI
  324. //
  325. #define ESP_WIFI_MODULE_COM 3 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this
  326. #define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2
  327. #define ESP_WIFI_MODULE_RESET_PIN PA4
  328. #define ESP_WIFI_MODULE_ENABLE_PIN PA5
  329. #define ESP_WIFI_MODULE_GPIO0_PIN PA6
  330. #if ENABLED(BTT_E3_RRF_IDEX_BOARD)
  331. #define FPC2_PIN PB11
  332. #define FPC3_PIN PB10
  333. #define FPC4_PIN PE12
  334. #define FPC5_PIN PE13
  335. #define FPC6_PIN PE14
  336. #define FPC7_PIN PE15
  337. #define FPC8_PIN PA3
  338. #define FPC9_PIN PA2
  339. #define FPC10_PIN PA8
  340. #define FPC11_PIN PC15
  341. #define FPC12_PIN PC14
  342. #define FPC13_PIN PC13
  343. #define FPC14_PIN PE6
  344. #define FPC15_PIN PE5
  345. #define FPC16_PIN PE4
  346. #define FPC17_PIN PE3
  347. #endif