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_SKR_MINI_E3_V3_0_1.h 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2022 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. #include "env_validate.h"
  25. #if HOTENDS > 1 || E_STEPPERS > 1
  26. #error "BTT SKR Mini E3 V3.0.1 supports up to 1 hotend / E stepper."
  27. #endif
  28. #ifndef BOARD_INFO_NAME
  29. #define BOARD_INFO_NAME "BTT SKR Mini E3 V3.0.1"
  30. #endif
  31. #define USES_DIAG_JUMPERS
  32. // Ignore temp readings during development.
  33. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
  34. #ifndef NEOPIXEL_LED
  35. #define LED_PIN PA14
  36. #endif
  37. // Onboard I2C EEPROM
  38. #if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM)
  39. #undef NO_EEPROM_SELECTED
  40. #define I2C_EEPROM
  41. #define SOFT_I2C_EEPROM // Force the use of Software I2C
  42. #define I2C_SCL_PIN PB8
  43. #define I2C_SDA_PIN PB9
  44. #define MARLIN_EEPROM_SIZE 0x1000 // 4K
  45. #endif
  46. //
  47. // Servos
  48. //
  49. #define SERVO0_PIN PA0 // SERVOS
  50. //
  51. // Limit Switches
  52. //
  53. #define X_STOP_PIN PB5 // X-STOP
  54. #define Y_STOP_PIN PB6 // Y-STOP
  55. #define Z_STOP_PIN PB7 // Z-STOP
  56. //
  57. // Z Probe must be this pin
  58. //
  59. #define Z_MIN_PROBE_PIN PA1 // PROBE
  60. //
  61. // Filament Runout Sensor
  62. //
  63. #ifndef FIL_RUNOUT_PIN
  64. #define FIL_RUNOUT_PIN PC15 // E0-STOP
  65. #endif
  66. //
  67. // Power-loss Detection
  68. //
  69. #ifndef POWER_LOSS_PIN
  70. #define POWER_LOSS_PIN PC13 // Power Loss Detection: PWR-DET
  71. #endif
  72. #ifndef NEOPIXEL_PIN
  73. #define NEOPIXEL_PIN PA14 // LED driving pin
  74. #endif
  75. #ifndef PS_ON_PIN
  76. #define PS_ON_PIN PC14 // Power Supply Control
  77. #endif
  78. //
  79. // Steppers
  80. //
  81. #define X_ENABLE_PIN PC10
  82. #define X_STEP_PIN PC11
  83. #define X_DIR_PIN PC12
  84. #define Y_ENABLE_PIN PB13
  85. #define Y_STEP_PIN PB12
  86. #define Y_DIR_PIN PB10
  87. #define Z_ENABLE_PIN PB2
  88. #define Z_STEP_PIN PB1
  89. #define Z_DIR_PIN PB0
  90. #define E0_ENABLE_PIN PC3
  91. #define E0_STEP_PIN PC2
  92. #define E0_DIR_PIN PC1
  93. #if HAS_TMC_UART
  94. /**
  95. * TMC220x stepper drivers
  96. * Hardware serial communication ports
  97. */
  98. #define X_HARDWARE_SERIAL MSerial6
  99. #define Y_HARDWARE_SERIAL MSerial6
  100. #define Z_HARDWARE_SERIAL MSerial6
  101. #define E0_HARDWARE_SERIAL MSerial6
  102. // Default TMC slave addresses
  103. #ifndef X_SLAVE_ADDRESS
  104. #define X_SLAVE_ADDRESS 0
  105. #endif
  106. #ifndef Y_SLAVE_ADDRESS
  107. #define Y_SLAVE_ADDRESS 2
  108. #endif
  109. #ifndef Z_SLAVE_ADDRESS
  110. #define Z_SLAVE_ADDRESS 1
  111. #endif
  112. #ifndef E0_SLAVE_ADDRESS
  113. #define E0_SLAVE_ADDRESS 3
  114. #endif
  115. #endif
  116. //
  117. // Temperature Sensors
  118. //
  119. #define TEMP_0_PIN PC5 // Analog Input "TH0"
  120. #define TEMP_BED_PIN PC4 // Analog Input "TB0"
  121. //
  122. // Heaters / Fans
  123. //
  124. #define HEATER_0_PIN PA15 // "HE"
  125. #define HEATER_BED_PIN PB3 // "HB"
  126. #define FAN_PIN PC9 // "FAN0"
  127. #define FAN1_PIN PA8 // "FAN1"
  128. #define FAN2_PIN PC8 // "FAN2"
  129. /**
  130. * SKR Mini E3 V3.0.1
  131. * ------
  132. * (BEEPER) PB15 | 1 2 | PB14 (BTN_ENC)
  133. * (BTN_EN1) PA9 | 3 4 | RESET
  134. * (BTN_EN2) PA10 5 6 | PB4 (LCD_D4)
  135. * (LCD_RS) PD2 | 7 8 | PC0 (LCD_EN)
  136. * GND | 9 10 | 5V
  137. * ------
  138. * EXP1
  139. */
  140. #define EXP1_01_PIN PB15
  141. #define EXP1_02_PIN PB14
  142. #define EXP1_03_PIN PA9
  143. #define EXP1_04_PIN -1 // RESET
  144. #define EXP1_05_PIN PA10
  145. #define EXP1_06_PIN PB4
  146. #define EXP1_07_PIN PD2
  147. #define EXP1_08_PIN PC0
  148. #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
  149. /**
  150. * ------ ------ ------
  151. * (ENT) | 1 2 | (BEEP) |10 9 | |10 9 |
  152. * (RX) | 3 4 | (RX) | 8 7 | (TX) RX | 8 7 | TX
  153. * (TX) 5 6 | (ENT) 6 5 | (BEEP) ENT | 6 5 | BEEP
  154. * (B) | 7 8 | (A) (B) | 4 3 | (A) B | 4 3 | A
  155. * GND | 9 10 | (VCC) GND | 2 1 | VCC GND | 2 1 | VCC
  156. * ------ ------ ------
  157. * EXP1 DWIN DWIN (plug)
  158. *
  159. * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on.
  160. */
  161. #error "DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. Comment out this line to continue."
  162. #define BEEPER_PIN EXP1_02_PIN
  163. #define BTN_EN1 EXP1_08_PIN
  164. #define BTN_EN2 EXP1_07_PIN
  165. #define BTN_ENC EXP1_01_PIN
  166. #elif HAS_WIRED_LCD
  167. #if ENABLED(CR10_STOCKDISPLAY)
  168. #define BEEPER_PIN EXP1_01_PIN
  169. #define BTN_ENC EXP1_02_PIN
  170. #define BTN_EN1 EXP1_03_PIN
  171. #define BTN_EN2 EXP1_05_PIN
  172. #define LCD_PINS_RS EXP1_07_PIN
  173. #define LCD_PINS_ENABLE EXP1_08_PIN
  174. #define LCD_PINS_D4 EXP1_06_PIN
  175. #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  176. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  177. #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.)"
  178. #endif
  179. #define LCD_PINS_RS EXP1_06_PIN
  180. #define LCD_PINS_ENABLE EXP1_02_PIN
  181. #define LCD_PINS_D4 EXP1_07_PIN
  182. #define LCD_PINS_D5 EXP1_05_PIN
  183. #define LCD_PINS_D6 EXP1_03_PIN
  184. #define LCD_PINS_D7 EXP1_01_PIN
  185. #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  186. #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
  187. #define BTN_ENC EXP1_02_PIN
  188. #define BTN_EN1 EXP1_03_PIN
  189. #define BTN_EN2 EXP1_05_PIN
  190. #define DOGLCD_CS EXP1_07_PIN
  191. #define DOGLCD_A0 EXP1_06_PIN
  192. #define DOGLCD_SCK EXP1_01_PIN
  193. #define DOGLCD_MOSI EXP1_08_PIN
  194. #define FORCE_SOFT_SPI
  195. #define LCD_BACKLIGHT_PIN -1
  196. #elif IS_TFTGLCD_PANEL
  197. #if ENABLED(TFTGLCD_PANEL_SPI)
  198. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  199. #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.)"
  200. #endif
  201. /**
  202. * TFTGLCD_PANEL_SPI display pinout
  203. *
  204. * Board Display
  205. * ------ ------
  206. * (BEEPER) PB6 | 1 2 | PB15 (SD_DET) 5V |10 9 | GND
  207. * RESET | 3 4 | PA9 (MOD_RESET) -- | 8 7 | (SD_DET)
  208. * PB4 5 6 | PA10 (SD_CS) (MOSI) | 6 5 | --
  209. * PB7 | 7 8 | PD2 (LCD_CS) (SD_CS) | 4 3 | (LCD_CS)
  210. * GND | 9 10 | 5V (SCK) | 2 1 | (MISO)
  211. * ------ ------
  212. * EXP1 EXP1
  213. *
  214. * Needs custom cable:
  215. *
  216. * Board Display
  217. *
  218. * EXP1-10 ---------- EXP1-10
  219. * EXP1-9 ----------- EXP1-9
  220. * SPI1-4 ----------- EXP1-6
  221. * EXP1-7 ----------- FREE
  222. * SPI1-3 ----------- EXP1-2
  223. * EXP1-5 ----------- EXP1-4
  224. * EXP1-4 ----------- FREE
  225. * EXP1-3 ----------- EXP1-3
  226. * SPI1-1 ----------- EXP1-1
  227. * EXP1-1 ----------- EXP1-7
  228. */
  229. #define TFTGLCD_CS EXP1_03_PIN
  230. #endif
  231. #else
  232. #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3."
  233. #endif
  234. #endif // HAS_WIRED_LCD
  235. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  236. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  237. #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.)"
  238. #endif
  239. /**
  240. * FYSETC TFT TFT81050 display pinout
  241. *
  242. * Board Display
  243. * ------ ------
  244. * (SD_DET) PB15 | 1 2 | PB6 (BEEPER) 5V |10 9 | GND
  245. * (MOD_RESET) PA9 | 3 4 | RESET (RESET) | 8 7 | (SD_DET)
  246. * (SD_CS) PA10 5 6 | PB4 (FREE) (MOSI) | 6 5 | (LCD_CS)
  247. * (LCD_CS) PD2 | 7 8 | PB7 (FREE) (SD_CS) | 4 3 | (MOD_RESET)
  248. * 5V | 9 10 | GND (SCK) | 2 1 | (MISO)
  249. * ------ ------
  250. * EXP1 EXP1
  251. *
  252. * Needs custom cable:
  253. *
  254. * Board Adapter Display
  255. * _________
  256. * EXP1-10 ---------- EXP1-10
  257. * EXP1-9 ----------- EXP1-9
  258. * SPI1-4 ----------- EXP1-6
  259. * EXP1-7 ----------- EXP1-5
  260. * SPI1-3 ----------- EXP1-2
  261. * EXP1-5 ----------- EXP1-4
  262. * EXP1-4 ----------- EXP1-8
  263. * EXP1-3 ----------- EXP1-3
  264. * SPI1-1 ----------- EXP1-1
  265. * EXP1-1 ----------- EXP1-7
  266. */
  267. #define CLCD_SPI_BUS 1 // SPI1 connector
  268. #define BEEPER_PIN EXP1_02_PIN
  269. #define CLCD_MOD_RESET EXP1_03_PIN
  270. #define CLCD_SPI_CS EXP1_07_PIN
  271. #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
  272. //
  273. // SD Support
  274. //
  275. #ifndef SDCARD_CONNECTION
  276. #define SDCARD_CONNECTION ONBOARD
  277. #endif
  278. #if SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
  279. #define SD_DETECT_PIN EXP1_01_PIN
  280. #define SD_SS_PIN EXP1_05_PIN
  281. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  282. #error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
  283. #endif
  284. #define ONBOARD_SPI_DEVICE 1 // SPI1 -> used only by HAL/STM32F1...
  285. #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
  286. #define ENABLE_SPI1
  287. #define SDSS ONBOARD_SD_CS_PIN
  288. #define SD_SS_PIN ONBOARD_SD_CS_PIN
  289. #define SD_SCK_PIN PA5
  290. #define SD_MISO_PIN PA6
  291. #define SD_MOSI_PIN PA7