My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

pins_BTT_SKR_MINI_E3_V3_0.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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. //#define BOARD_CUSTOM_BUILD_FLAGS -DTONE_CHANNEL=4 -DTONE_TIMER=4 -DTIMER_TONE=4
  24. #ifndef BOARD_INFO_NAME
  25. #define BOARD_INFO_NAME "BTT SKR Mini E3 V3.0"
  26. #endif
  27. #define USES_DIAG_JUMPERS
  28. // Ignore temp readings during development.
  29. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
  30. #define LED_PIN PD8
  31. // Onboard I2C EEPROM
  32. #if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM)
  33. #undef NO_EEPROM_SELECTED
  34. #define I2C_EEPROM
  35. #define SOFT_I2C_EEPROM // Force the use of Software I2C
  36. #define I2C_SCL_PIN PB6
  37. #define I2C_SDA_PIN PB7
  38. #define MARLIN_EEPROM_SIZE 0x1000 // 4K
  39. #endif
  40. //
  41. // Servos
  42. //
  43. #define SERVO0_PIN PA1 // SERVOS
  44. //
  45. // Limit Switches
  46. //
  47. #define X_STOP_PIN PC0 // X-STOP
  48. #define Y_STOP_PIN PC1 // Y-STOP
  49. #define Z_STOP_PIN PC2 // Z-STOP
  50. //
  51. // Z Probe must be this pin
  52. //
  53. #define Z_MIN_PROBE_PIN PC14 // PROBE
  54. //
  55. // Filament Runout Sensor
  56. //
  57. #ifndef FIL_RUNOUT_PIN
  58. #define FIL_RUNOUT_PIN PC15 // E0-STOP
  59. #endif
  60. //
  61. // Power-loss Detection
  62. //
  63. #ifndef POWER_LOSS_PIN
  64. #define POWER_LOSS_PIN PC12 // Power Loss Detection: PWR-DET
  65. #endif
  66. #ifndef PS_ON_PIN
  67. #define PS_ON_PIN PC13 // Power Supply Control
  68. #endif
  69. //
  70. // Steppers
  71. //
  72. #define X_ENABLE_PIN PB14
  73. #define X_STEP_PIN PB13
  74. #define X_DIR_PIN PB12
  75. #define Y_ENABLE_PIN PB11
  76. #define Y_STEP_PIN PB10
  77. #define Y_DIR_PIN PB2
  78. #define Z_ENABLE_PIN PB1
  79. #define Z_STEP_PIN PB0
  80. #define Z_DIR_PIN PC5
  81. #define E0_ENABLE_PIN PD1
  82. #define E0_STEP_PIN PB3
  83. #define E0_DIR_PIN PB4
  84. #if HAS_TMC_UART
  85. /**
  86. * TMC220x stepper drivers
  87. * Hardware serial communication ports
  88. */
  89. #define X_HARDWARE_SERIAL MSerial4
  90. #define Y_HARDWARE_SERIAL MSerial4
  91. #define Z_HARDWARE_SERIAL MSerial4
  92. #define E0_HARDWARE_SERIAL MSerial4
  93. // Default TMC slave addresses
  94. #ifndef X_SLAVE_ADDRESS
  95. #define X_SLAVE_ADDRESS 0
  96. #endif
  97. #ifndef Y_SLAVE_ADDRESS
  98. #define Y_SLAVE_ADDRESS 2
  99. #endif
  100. #ifndef Z_SLAVE_ADDRESS
  101. #define Z_SLAVE_ADDRESS 1
  102. #endif
  103. #ifndef E0_SLAVE_ADDRESS
  104. #define E0_SLAVE_ADDRESS 3
  105. #endif
  106. #endif
  107. //
  108. // Temperature Sensors
  109. //
  110. #define TEMP_0_PIN PA0 // Analog Input "TH0"
  111. #define TEMP_BED_PIN PC4 // Analog Input "TB0"
  112. //
  113. // Heaters / Fans
  114. //
  115. #define HEATER_0_PIN PC8 // "HE"
  116. #define HEATER_BED_PIN PC9 // "HB"
  117. #define FAN_PIN PC6 // "FAN0"
  118. #define FAN1_PIN PC7 // "FAN1"
  119. #define FAN2_PIN PB15 // "FAN2"
  120. /**
  121. * SKR Mini E3 V3.0
  122. * ------
  123. * (BEEPER) PB5 | 1 2 | PA15 (BTN_ENC)
  124. * (BTN_EN1) PA9 | 3 4 | RESET
  125. * (BTN_EN2) PA10 5 6 | PB9 (LCD_D4)
  126. * (LCD_RS) PB8 | 7 8 | PD6 (LCD_EN)
  127. * GND | 9 10 | 5V
  128. * ------
  129. * EXP1
  130. */
  131. #define EXP1_01_PIN PB5
  132. #define EXP1_02_PIN PA15
  133. #define EXP1_03_PIN PA9
  134. #define EXP1_04_PIN -1
  135. #define EXP1_05_PIN PA10
  136. #define EXP1_06_PIN PB9
  137. #define EXP1_07_PIN PB8
  138. #define EXP1_08_PIN PD6
  139. #define EXP1_09_PIN -1
  140. #define EXP1_10_PIN -1
  141. #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
  142. /**
  143. * ------ ------ ------
  144. * (ENT) | 1 2 | (BEEP) |10 9 | |10 9 |
  145. * (RX) | 3 4 | (RX) | 8 7 | (TX) RX | 8 7 | TX
  146. * (TX) 5 6 | (ENT) 6 5 | (BEEP) ENT | 6 5 | BEEP
  147. * (B) | 7 8 | (A) (B) | 4 3 | (A) B | 4 3 | A
  148. * GND | 9 10 | (VCC) GND | 2 1 | VCC GND | 2 1 | VCC
  149. * ------ ------ ------
  150. * EXP1 DWIN DWIN (plug)
  151. *
  152. * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on.
  153. */
  154. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  155. #error "CAUTION! DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  156. #endif
  157. #define BEEPER_PIN EXP1_02_PIN
  158. #define BTN_EN1 EXP1_08_PIN
  159. #define BTN_EN2 EXP1_07_PIN
  160. #define BTN_ENC EXP1_01_PIN
  161. #elif HAS_WIRED_LCD
  162. #if ENABLED(SKR_MINI_SCREEN_ADAPTER)
  163. /** https://github.com/VoronDesign/Voron-Hardware/tree/master/SKR-Mini_Screen_Adaptor/SRK%20Mini%20E3%20V3.0
  164. *
  165. * SKR Mini E3 V3.0 SKR Mini Screen Adaptor
  166. * ------ ------
  167. * 5V | 1 2 | GND MISO | 1 2 | SCK
  168. * CS | 3 4 | SCK (EN1) PA10 | 3 4 | --
  169. * MOSI | 5 6 | MISO (EN2) PA9 5 6 | MOSI
  170. * 3V3 | 7 8 | GND -- | 7 8 | --
  171. * ------ GND | 9 10| RESET (Kill)
  172. * SPI ------
  173. * EXP2
  174. *
  175. * ------ ------
  176. * PB5 | 1 2 | PA15 -- | 1 2 | PB5 (BTN_ENC)
  177. * PA9 | 3 4 | RESET (LCD CS) PB8 | 3 4 | PD6 (LCD_A0)
  178. * PA10 5 6 | PB9 (RESET) PB9 5 6 | PA15 (DIN)
  179. * PB8 | 7 8 | PD6 -- | 7 8 | --
  180. * GND | 9 10| 5V GND | 9 10| 5V
  181. * ------ ------
  182. * EXP1 EXP1
  183. */
  184. #if ENABLED(FYSETC_MINI_12864_2_1)
  185. #define BTN_ENC EXP1_01_PIN
  186. #define BTN_EN1 EXP1_03_PIN
  187. #define BTN_EN2 EXP1_05_PIN
  188. #define BEEPER_PIN -1
  189. #define LCD_RESET_PIN EXP1_06_PIN
  190. #define DOGLCD_CS EXP1_07_PIN
  191. #define DOGLCD_A0 EXP1_08_PIN
  192. #define DOGLCD_SCK PA5
  193. #define DOGLCD_MOSI PA7
  194. #define FORCE_SOFT_SPI
  195. #define LCD_BACKLIGHT_PIN -1
  196. #define NEOPIXEL_PIN EXP1_02_PIN
  197. #else
  198. #error "Only CR10_FYSETC_MINI_12864_2_1 and compatibles are currently supported on the BIGTREE_SKR_MINI_E3 with SKR_MINI_SCREEN_ADAPTER"
  199. #endif
  200. #else
  201. #if ENABLED(CR10_STOCKDISPLAY)
  202. #define BEEPER_PIN EXP1_01_PIN
  203. #define BTN_ENC EXP1_02_PIN
  204. #define BTN_EN1 EXP1_03_PIN
  205. #define BTN_EN2 EXP1_05_PIN
  206. #define LCD_PINS_RS EXP1_07_PIN
  207. #define LCD_PINS_ENABLE EXP1_08_PIN
  208. #define LCD_PINS_D4 EXP1_06_PIN
  209. #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  210. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  211. #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  212. #endif
  213. #define LCD_PINS_RS EXP1_06_PIN
  214. #define LCD_PINS_ENABLE EXP1_02_PIN
  215. #define LCD_PINS_D4 EXP1_07_PIN
  216. #define LCD_PINS_D5 EXP1_05_PIN
  217. #define LCD_PINS_D6 EXP1_03_PIN
  218. #define LCD_PINS_D7 EXP1_01_PIN
  219. #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  220. #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
  221. #define BTN_ENC EXP1_02_PIN
  222. #define BTN_EN1 EXP1_03_PIN
  223. #define BTN_EN2 EXP1_05_PIN
  224. #define DOGLCD_CS EXP1_07_PIN
  225. #define DOGLCD_A0 EXP1_06_PIN
  226. #define DOGLCD_SCK EXP1_01_PIN
  227. #define DOGLCD_MOSI EXP1_08_PIN
  228. #define FORCE_SOFT_SPI
  229. #define LCD_BACKLIGHT_PIN -1
  230. #elif IS_TFTGLCD_PANEL
  231. #if ENABLED(TFTGLCD_PANEL_SPI)
  232. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  233. #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  234. #endif
  235. /**
  236. * TFTGLCD_PANEL_SPI display pinout
  237. *
  238. * Board Display
  239. * ------ ------
  240. * (BEEPER) PB6 | 1 2 | PB5 (SD_DET) 5V |10 9 | GND
  241. * RESET | 3 4 | PA9 (MOD_RESET) -- | 8 7 | (SD_DET)
  242. * PB9 5 6 | PA10 (SD_CS) (MOSI) | 6 5 | --
  243. * PB7 | 7 8 | PB8 (LCD_CS) (SD_CS) | 4 3 | (LCD_CS)
  244. * GND | 9 10 | 5V (SCK) | 2 1 | (MISO)
  245. * ------ ------
  246. * EXP1 EXP1
  247. *
  248. * Needs custom cable:
  249. *
  250. * Board Display
  251. *
  252. * EXP1-10 ----------- EXP1-10 5V
  253. * EXP1-9 ------------ EXP1-9 GND
  254. * SPI1-4 ------------ EXP1-6 MOSI
  255. * EXP1-7 ------------ n/c
  256. * SPI1-3 ------------ EXP1-2 SCK
  257. * EXP1-5 ------------ EXP1-4 SD_CS
  258. * EXP1-4 ------------ n/c
  259. * EXP1-3 ------------ EXP1-3 LCD_CS
  260. * SPI1-1 ------------ EXP1-1 MISO
  261. * EXP1-1 ------------ EXP1-7 SD_DET
  262. */
  263. #define TFTGLCD_CS EXP1_03_PIN
  264. #endif
  265. #elif ENABLED(FYSETC_MINI_12864_2_1)
  266. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  267. #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning."
  268. #endif
  269. /**
  270. *
  271. * Board Display
  272. * ------ ------
  273. * (EN2) PB5 | 1 2 | PA15(BTN_ENC) 5V |10 9 | GND
  274. * (LCD_CS) PA9 | 3 4 | RST (RESET) -- | 8 7 | --
  275. * (LCD_A0) PA10 5 6 | PB9 (EN1) (DIN) | 6 5 (RESET)
  276. * (LCD_SCK)PB8 | 7 8 | PD6 (MOSI) (LCD_A0) | 4 3 | (LCD_CS)
  277. * GND | 9 10 | 5V (BTN_ENC) | 2 1 | --
  278. * ------ ------
  279. * EXP1 EXP1
  280. *
  281. * ------
  282. * -- |10 9 | --
  283. * --- (RESET) | 8 7 | --
  284. * | 3 | (MOSI) | 6 5 (EN2)
  285. * | 2 | (DIN) -- | 4 3 | (EN1)
  286. * | 1 | (LCD_SCK)| 2 1 | --
  287. * --- ------
  288. * Neopixel EXP2
  289. *
  290. * Needs custom cable. Connect EN2-EN2, LCD_CS-LCD_CS and so on.
  291. *
  292. * Check the index/notch position twice!!!
  293. * On BTT boards pins from IDC10 connector are numbered in unusual order.
  294. */
  295. #define BTN_ENC EXP1_02_PIN
  296. #define BTN_EN1 EXP1_06_PIN
  297. #define BTN_EN2 EXP1_01_PIN
  298. #define BEEPER_PIN -1
  299. #define DOGLCD_CS EXP1_03_PIN
  300. #define DOGLCD_A0 EXP1_05_PIN
  301. #define DOGLCD_SCK EXP1_07_PIN
  302. #define DOGLCD_MOSI EXP1_08_PIN
  303. #define FORCE_SOFT_SPI
  304. #define LCD_BACKLIGHT_PIN -1
  305. #else
  306. #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, FYSETC_MINI_12864_2_1, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3."
  307. #endif
  308. #endif // SKR_MINI_SCREEN_ADAPTER
  309. #endif // HAS_WIRED_LCD
  310. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  311. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  312. #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  313. #endif
  314. /**
  315. * FYSETC TFT TFT81050 display pinout
  316. *
  317. * Board Display
  318. * ------ ------
  319. * (SD_DET) PB5 | 1 2 | PB6 (BEEPER) 5V |10 9 | GND
  320. * (MOD_RESET) PA9 | 3 4 | RESET (RESET) | 8 7 | (SD_DET)
  321. * (SD_CS) PA10 5 6 | PB9 (FREE) (MOSI) | 6 5 | (LCD_CS)
  322. * (LCD_CS) PB8 | 7 8 | PB7 (FREE) (SD_CS) | 4 3 | (MOD_RESET)
  323. * 5V | 9 10 | GND (SCK) | 2 1 | (MISO)
  324. * ------ ------
  325. * EXP1 EXP1
  326. *
  327. * Needs custom cable:
  328. *
  329. * Board Adapter Display
  330. * ----------------------------------
  331. * EXP1-10 ----------- EXP1-10 5V
  332. * EXP1-9 ------------ EXP1-9 GND
  333. * SPI1-4 ------------ EXP1-6 MOSI
  334. * EXP1-7 ------------ EXP1-5 LCD_CS
  335. * SPI1-3 ------------ EXP1-2 SCK
  336. * EXP1-5 ------------ EXP1-4 SD_CS
  337. * EXP1-4 ------------ EXP1-8 RESET
  338. * EXP1-3 ------------ EXP1-3 MOD_RST
  339. * SPI1-1 ------------ EXP1-1 MISO
  340. * EXP1-1 ------------ EXP1-7 SD_DET
  341. */
  342. #define CLCD_SPI_BUS 1 // SPI1 connector
  343. #define BEEPER_PIN EXP1_02_PIN
  344. #define CLCD_MOD_RESET EXP1_03_PIN
  345. #define CLCD_SPI_CS EXP1_07_PIN
  346. #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
  347. //
  348. // SD Support
  349. //
  350. #ifndef SDCARD_CONNECTION
  351. #define SDCARD_CONNECTION ONBOARD
  352. #endif
  353. #if SD_CONNECTION_IS(ONBOARD)
  354. #define SD_DETECT_PIN PC3
  355. #elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
  356. #define SD_DETECT_PIN EXP1_01_PIN
  357. #define SD_SS_PIN EXP1_05_PIN
  358. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  359. #error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
  360. #endif
  361. #define ONBOARD_SPI_DEVICE 1 // SPI1 -> used only by HAL/STM32F1...
  362. #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
  363. #define ENABLE_SPI1
  364. #define SDSS ONBOARD_SD_CS_PIN
  365. #define SD_SS_PIN ONBOARD_SD_CS_PIN
  366. #define SD_SCK_PIN PA5
  367. #define SD_MISO_PIN PA6
  368. #define SD_MOSI_PIN PA7
  369. //
  370. // Default NEOPIXEL_PIN
  371. //
  372. #ifndef NEOPIXEL_PIN
  373. #define NEOPIXEL_PIN PA8 // LED driving pin
  374. #endif