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.h 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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 // 4KB
  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 NEOPIXEL_PIN
  67. #define NEOPIXEL_PIN PA8 // LED driving pin
  68. #endif
  69. #ifndef PS_ON_PIN
  70. #define PS_ON_PIN PC13 // Power Supply Control
  71. #endif
  72. //
  73. // Steppers
  74. //
  75. #define X_ENABLE_PIN PB14
  76. #define X_STEP_PIN PB13
  77. #define X_DIR_PIN PB12
  78. #define Y_ENABLE_PIN PB11
  79. #define Y_STEP_PIN PB10
  80. #define Y_DIR_PIN PB2
  81. #define Z_ENABLE_PIN PB1
  82. #define Z_STEP_PIN PB0
  83. #define Z_DIR_PIN PC5
  84. #define E0_ENABLE_PIN PD1
  85. #define E0_STEP_PIN PB3
  86. #define E0_DIR_PIN PB4
  87. #if HAS_TMC_UART
  88. /**
  89. * TMC220x stepper drivers
  90. * Hardware serial communication ports
  91. */
  92. #define X_HARDWARE_SERIAL MSerial4
  93. #define Y_HARDWARE_SERIAL MSerial4
  94. #define Z_HARDWARE_SERIAL MSerial4
  95. #define E0_HARDWARE_SERIAL MSerial4
  96. // Default TMC slave addresses
  97. #ifndef X_SLAVE_ADDRESS
  98. #define X_SLAVE_ADDRESS 0
  99. #endif
  100. #ifndef Y_SLAVE_ADDRESS
  101. #define Y_SLAVE_ADDRESS 2
  102. #endif
  103. #ifndef Z_SLAVE_ADDRESS
  104. #define Z_SLAVE_ADDRESS 1
  105. #endif
  106. #ifndef E0_SLAVE_ADDRESS
  107. #define E0_SLAVE_ADDRESS 3
  108. #endif
  109. #endif
  110. //
  111. // Temperature Sensors
  112. //
  113. #define TEMP_0_PIN PA0 // Analog Input "TH0"
  114. #define TEMP_BED_PIN PC4 // Analog Input "TB0"
  115. //
  116. // Heaters / Fans
  117. //
  118. #define HEATER_0_PIN PC8 // "HE"
  119. #define HEATER_BED_PIN PC9 // "HB"
  120. #define FAN_PIN PC6 // "FAN0"
  121. #define FAN1_PIN PC7 // "FAN1"
  122. #define FAN2_PIN PB15 // "FAN2"
  123. /**
  124. * SKR Mini E3 V3.0
  125. * ------
  126. * 5V | 1 2 | GND
  127. * (LCD_EN) PD6 | 3 4 | PB8 (LCD_RS)
  128. * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2)
  129. * RESET | 7 8 | PA9 (BTN_EN1)
  130. * (BTN_ENC) PA15 | 9 10 | PB5 (BEEPER)
  131. * ------
  132. * EXP1
  133. */
  134. #define EXP1_09_PIN PA15
  135. #define EXP1_03_PIN PD6
  136. #if EITHER(DWIN_CREALITY_LCD, IS_DWIN_MARLINUI)
  137. /**
  138. * ------ ------ ------
  139. * VCC | 1 2 | GND VCC | 1 2 | GND GND | 2 1 | VCC
  140. * A | 3 4 | B A | 3 4 | B B | 4 3 | A
  141. * | 5 6 TX BEEP | 5 6 ENT ENT | 6 5 | BEEP
  142. * | 7 8 | RX TX | 7 8 | RX RX | 8 7 | TX
  143. * BEEP | 9 10 | ENT | 9 10 | | 10 9 |
  144. * ------ ------ ------
  145. * EXP1 DWIN DWIN (plug)
  146. *
  147. * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on.
  148. */
  149. #error "DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. Comment out this line to continue."
  150. #define BEEPER_PIN EXP1_09_PIN
  151. #define BTN_EN1 EXP1_03_PIN
  152. #define BTN_EN2 PB8
  153. #define BTN_ENC PB5
  154. #elif HAS_WIRED_LCD
  155. #if ENABLED(CR10_STOCKDISPLAY)
  156. #define BEEPER_PIN PB5
  157. #define BTN_ENC EXP1_09_PIN
  158. #define BTN_EN1 PA9
  159. #define BTN_EN2 PA10
  160. #define LCD_PINS_RS PB8
  161. #define LCD_PINS_ENABLE EXP1_03_PIN
  162. #define LCD_PINS_D4 PB9
  163. #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  164. #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
  165. #define LCD_PINS_RS PB9
  166. #define LCD_PINS_ENABLE EXP1_09_PIN
  167. #define LCD_PINS_D4 PB8
  168. #define LCD_PINS_D5 PA10
  169. #define LCD_PINS_D6 PA9
  170. #define LCD_PINS_D7 PB5
  171. #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  172. #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
  173. #define BTN_ENC EXP1_09_PIN
  174. #define BTN_EN1 PA9
  175. #define BTN_EN2 PA10
  176. #define DOGLCD_CS PB8
  177. #define DOGLCD_A0 PB9
  178. #define DOGLCD_SCK PB5
  179. #define DOGLCD_MOSI EXP1_03_PIN
  180. #define FORCE_SOFT_SPI
  181. #define LCD_BACKLIGHT_PIN -1
  182. #elif IS_TFTGLCD_PANEL
  183. #if ENABLED(TFTGLCD_PANEL_SPI)
  184. #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
  185. /**
  186. * TFTGLCD_PANEL_SPI display pinout
  187. *
  188. * Board Display
  189. * ------ ------
  190. * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK)
  191. * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) LCD_CS | 3 4 | SD_CS (PA10)
  192. * (FREE) PB9 | 5 6 | PA10 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI)
  193. * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE)
  194. * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V
  195. * ------ ------
  196. * EXP1 EXP1
  197. *
  198. * Needs custom cable:
  199. *
  200. * Board Display
  201. *
  202. * EXP1-1 ----------- EXP1-10
  203. * EXP1-2 ----------- EXP1-9
  204. * SPI1-4 ----------- EXP1-6
  205. * EXP1-4 ----------- FREE
  206. * SPI1-3 ----------- EXP1-2
  207. * EXP1-6 ----------- EXP1-4
  208. * EXP1-7 ----------- FREE
  209. * EXP1-8 ----------- EXP1-3
  210. * SPI1-1 ----------- EXP1-1
  211. * EXP1-10 ----------- EXP1-7
  212. */
  213. #define TFTGLCD_CS PA9
  214. #endif
  215. #else
  216. #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."
  217. #endif
  218. #endif // HAS_WIRED_LCD
  219. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  220. #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
  221. /**
  222. * FYSETC TFT TFT81050 display pinout
  223. *
  224. * Board Display
  225. * ------ ------
  226. * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK)
  227. * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10)
  228. * (FREE) PB9 | 5 6 | PA10 (SD_CS) (PB8) LCD_CS | 5 6 | MOSI (SPI1-MOSI)
  229. * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | RESET
  230. * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V
  231. * ------ ------
  232. * EXP1 EXP1
  233. *
  234. * Needs custom cable:
  235. *
  236. * Board Adapter Display
  237. * _________
  238. * EXP1-1 ----------- EXP1-10
  239. * EXP1-2 ----------- EXP1-9
  240. * SPI1-4 ----------- EXP1-6
  241. * EXP1-4 ----------- EXP1-5
  242. * SPI1-3 ----------- EXP1-2
  243. * EXP1-6 ----------- EXP1-4
  244. * EXP1-7 ----------- EXP1-8
  245. * EXP1-8 ----------- EXP1-3
  246. * SPI1-1 ----------- EXP1-1
  247. * EXP1-10 ----------- EXP1-7
  248. */
  249. #define CLCD_SPI_BUS 1 // SPI1 connector
  250. #define BEEPER_PIN EXP1_09_PIN
  251. #define CLCD_MOD_RESET PA9
  252. #define CLCD_SPI_CS PB8
  253. #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
  254. //
  255. // SD Support
  256. //
  257. #ifndef SDCARD_CONNECTION
  258. #define SDCARD_CONNECTION ONBOARD
  259. #endif
  260. #if SD_CONNECTION_IS(ONBOARD)
  261. #define SD_DETECT_PIN PC3
  262. #elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
  263. #define SD_DETECT_PIN PB5
  264. #define SD_SS_PIN PA10
  265. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  266. #error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
  267. #endif
  268. #define ONBOARD_SPI_DEVICE 1 // SPI1 -> used only by HAL/STM32F1...
  269. #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
  270. #define ENABLE_SPI1
  271. #define SDSS ONBOARD_SD_CS_PIN
  272. #define SD_SS_PIN ONBOARD_SD_CS_PIN
  273. #define SD_SCK_PIN PA5
  274. #define SD_MISO_PIN PA6
  275. #define SD_MOSI_PIN PA7