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_V1_4.h 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #ifndef BOARD_INFO_NAME
  24. #define BOARD_INFO_NAME "BIGTREE SKR 1.4"
  25. #endif
  26. //
  27. // EEPROM
  28. //
  29. #if NONE(FLASH_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION)
  30. #define FLASH_EEPROM_EMULATION
  31. //#define SDCARD_EEPROM_EMULATION
  32. #endif
  33. //
  34. // SD Connection
  35. //
  36. #ifndef SDCARD_CONNECTION
  37. #define SDCARD_CONNECTION LCD
  38. #endif
  39. //
  40. // Servos
  41. //
  42. #define SERVO0_PIN P2_00
  43. //
  44. // TMC StallGuard DIAG pins
  45. //
  46. #define X_DIAG_PIN P1_29 // X-STOP
  47. #define Y_DIAG_PIN P1_28 // Y-STOP
  48. #define Z_DIAG_PIN P1_27 // Z-STOP
  49. #define E0_DIAG_PIN P1_26 // E0DET
  50. #define E1_DIAG_PIN P1_25 // E1DET
  51. //
  52. // Limit Switches
  53. //
  54. #if X_STALL_SENSITIVITY
  55. #define X_STOP_PIN X_DIAG_PIN
  56. #if X_HOME_DIR < 0
  57. #define X_MAX_PIN P1_26 // E0DET
  58. #else
  59. #define X_MIN_PIN P1_26 // E0DET
  60. #endif
  61. #else
  62. #define X_STOP_PIN P1_29 // X-STOP
  63. #endif
  64. #if Y_STALL_SENSITIVITY
  65. #define Y_STOP_PIN Y_DIAG_PIN
  66. #if Y_HOME_DIR < 0
  67. #define Y_MAX_PIN P1_25 // E1DET
  68. #else
  69. #define Y_MIN_PIN P1_25 // E1DET
  70. #endif
  71. #else
  72. #define Y_STOP_PIN P1_28 // Y-STOP
  73. #endif
  74. #if Z_STALL_SENSITIVITY
  75. #define Z_STOP_PIN Z_DIAG_PIN
  76. #if Z_HOME_DIR < 0
  77. #define Z_MAX_PIN P1_00 // PWRDET
  78. #else
  79. #define Z_MIN_PIN P1_00 // PWRDET
  80. #endif
  81. #else
  82. #ifndef Z_STOP_PIN
  83. #define Z_STOP_PIN P1_27 // Z-STOP
  84. #endif
  85. #endif
  86. //
  87. // Z Probe (when not Z_MIN_PIN)
  88. //
  89. #ifndef Z_MIN_PROBE_PIN
  90. #define Z_MIN_PROBE_PIN P0_10
  91. #endif
  92. //
  93. // Filament Runout Sensor
  94. //
  95. #define FIL_RUNOUT_PIN P1_26 // E0DET
  96. #define FIL_RUNOUT2_PIN P1_25 // E1DET
  97. //
  98. // Power Supply Control
  99. //
  100. #ifndef PS_ON_PIN
  101. #define PS_ON_PIN P1_00 // PWRDET
  102. #endif
  103. //
  104. // Power Loss Detection
  105. //
  106. #ifndef POWER_LOSS_PIN
  107. #define POWER_LOSS_PIN P1_00 // PWRDET
  108. #endif
  109. //
  110. // Steppers
  111. //
  112. #define X_STEP_PIN P2_02
  113. #define X_DIR_PIN P2_06
  114. #define X_ENABLE_PIN P2_01
  115. #ifndef X_CS_PIN
  116. #define X_CS_PIN P1_10
  117. #endif
  118. #define Y_STEP_PIN P0_19
  119. #define Y_DIR_PIN P0_20
  120. #define Y_ENABLE_PIN P2_08
  121. #ifndef Y_CS_PIN
  122. #define Y_CS_PIN P1_09
  123. #endif
  124. #define Z_STEP_PIN P0_22
  125. #define Z_DIR_PIN P2_11
  126. #define Z_ENABLE_PIN P0_21
  127. #ifndef Z_CS_PIN
  128. #define Z_CS_PIN P1_08
  129. #endif
  130. #define E0_STEP_PIN P2_13
  131. #define E0_DIR_PIN P0_11
  132. #define E0_ENABLE_PIN P2_12
  133. #ifndef E0_CS_PIN
  134. #define E0_CS_PIN P1_04
  135. #endif
  136. #define E1_STEP_PIN P1_15
  137. #define E1_DIR_PIN P1_14
  138. #define E1_ENABLE_PIN P1_16
  139. #ifndef E1_CS_PIN
  140. #define E1_CS_PIN P1_01
  141. #endif
  142. #define TEMP_1_PIN P0_23_A0 // A2 (T2) - (69) - TEMP_1_PIN
  143. #define TEMP_BED_PIN P0_25_A2 // A0 (T0) - (67) - TEMP_BED_PIN
  144. //
  145. // Software SPI pins for TMC2130 stepper drivers
  146. //
  147. #if ENABLED(TMC_USE_SW_SPI)
  148. #ifndef TMC_SW_MOSI
  149. #define TMC_SW_MOSI P1_17
  150. #endif
  151. #ifndef TMC_SW_MISO
  152. #define TMC_SW_MISO P0_05
  153. #endif
  154. #ifndef TMC_SW_SCK
  155. #define TMC_SW_SCK P0_04
  156. #endif
  157. #endif
  158. #if HAS_TMC_UART
  159. /**
  160. * TMC2208/TMC2209 stepper drivers
  161. *
  162. * Hardware serial communication ports.
  163. * If undefined software serial is used according to the pins below
  164. */
  165. //#define X_HARDWARE_SERIAL Serial
  166. //#define X2_HARDWARE_SERIAL Serial1
  167. //#define Y_HARDWARE_SERIAL Serial1
  168. //#define Y2_HARDWARE_SERIAL Serial1
  169. //#define Z_HARDWARE_SERIAL Serial1
  170. //#define Z2_HARDWARE_SERIAL Serial1
  171. //#define E0_HARDWARE_SERIAL Serial1
  172. //#define E1_HARDWARE_SERIAL Serial1
  173. //#define E2_HARDWARE_SERIAL Serial1
  174. //#define E3_HARDWARE_SERIAL Serial1
  175. //#define E4_HARDWARE_SERIAL Serial1
  176. //
  177. // Software serial
  178. //
  179. #define X_SERIAL_TX_PIN P1_10
  180. #define X_SERIAL_RX_PIN P1_10
  181. #define Y_SERIAL_TX_PIN P1_09
  182. #define Y_SERIAL_RX_PIN P1_09
  183. #define Z_SERIAL_TX_PIN P1_08
  184. #define Z_SERIAL_RX_PIN P1_08
  185. #define E0_SERIAL_TX_PIN P1_04
  186. #define E0_SERIAL_RX_PIN P1_04
  187. #define E1_SERIAL_TX_PIN P1_01
  188. #define E1_SERIAL_RX_PIN P1_01
  189. #define Z2_SERIAL_TX_PIN P1_01
  190. #define Z2_SERIAL_RX_PIN P1_01
  191. // Reduce baud rate to improve software serial reliability
  192. #define TMC_BAUD_RATE 19200
  193. #endif
  194. //
  195. // SD Connection
  196. //
  197. #if SD_CONNECTION_IS(LCD)
  198. #define SS_PIN P0_16
  199. #endif
  200. /**
  201. * _____ _____
  202. * NC | · · | GND 5V | · · | GND
  203. * RESET | · · | 1.31(SD_DETECT) (LCD_D7) 1.23 | · · | 1.22 (LCD_D6)
  204. * (MOSI)0.18 | · · | 3.25(BTN_EN2) (LCD_D5) 1.21 | · · | 1.20 (LCD_D4)
  205. * (SD_SS)0.16 | · · | 3.26(BTN_EN1) (LCD_RS) 1.19 | · · | 1.18 (LCD_EN)
  206. * (SCK)0.15 | · · | 0.17(MISO) (BTN_ENC) 0.28 | · · | 1.30 (BEEPER)
  207. * ----- -----
  208. * EXP2 EXP1
  209. */
  210. #if HAS_SPI_LCD
  211. #if ENABLED(ANET_FULL_GRAPHICS_LCD)
  212. #define LCD_PINS_RS P1_23
  213. #define BTN_EN1 P1_20
  214. #define BTN_EN2 P1_22
  215. #define BTN_ENC P1_18
  216. #define LCD_PINS_ENABLE P1_21
  217. #define LCD_PINS_D4 P1_19
  218. #elif ENABLED(CR10_STOCKDISPLAY)
  219. #define BTN_ENC P0_28 // (58) open-drain
  220. #define LCD_PINS_RS P1_22
  221. #define BTN_EN1 P1_18
  222. #define BTN_EN2 P1_20
  223. #define LCD_PINS_ENABLE P1_23
  224. #define LCD_PINS_D4 P1_21
  225. #else
  226. #define BTN_ENC P0_28 // (58) open-drain
  227. #define LCD_PINS_RS P1_19
  228. #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
  229. #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
  230. #define LCD_PINS_ENABLE P1_18
  231. #define LCD_PINS_D4 P1_20
  232. #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4
  233. #if SD_CONNECTION_IS(LCD)
  234. #define SD_DETECT_PIN P1_31 // (49) (NOT 5V tolerant)
  235. #endif
  236. #if ENABLED(FYSETC_MINI_12864)
  237. #define DOGLCD_CS P1_18
  238. #define DOGLCD_A0 P1_19
  239. #define DOGLCD_SCK P0_15
  240. #define DOGLCD_MOSI P0_18
  241. #define LCD_BACKLIGHT_PIN -1
  242. #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
  243. // results in LCD soft SPI mode 3, SD soft SPI mode 0
  244. #define LCD_RESET_PIN P1_20 // Must be high or open for LCD to operate normally.
  245. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  246. #ifndef RGB_LED_R_PIN
  247. #define RGB_LED_R_PIN P1_21
  248. #endif
  249. #ifndef RGB_LED_G_PIN
  250. #define RGB_LED_G_PIN P1_22
  251. #endif
  252. #ifndef RGB_LED_B_PIN
  253. #define RGB_LED_B_PIN P1_23
  254. #endif
  255. #elif ENABLED(FYSETC_MINI_12864_2_1)
  256. #define NEOPIXEL_PIN P1_21
  257. #endif
  258. #else // !FYSETC_MINI_12864
  259. #if ENABLED(MKS_MINI_12864)
  260. #define DOGLCD_CS P1_21
  261. #define DOGLCD_A0 P1_22
  262. #define DOGLCD_SCK P0_15
  263. #define DOGLCD_MOSI P0_18
  264. #define FORCE_SOFT_SPI
  265. #endif
  266. #if ENABLED(ULTIPANEL)
  267. #define LCD_PINS_D5 P1_21
  268. #define LCD_PINS_D6 P1_22
  269. #define LCD_PINS_D7 P1_23
  270. #endif
  271. #endif // !FYSETC_MINI_12864
  272. #endif
  273. #endif // HAS_SPI_LCD
  274. //
  275. // Neopixel LED
  276. //
  277. #ifndef NEOPIXEL_PIN
  278. #define NEOPIXEL_PIN P1_24
  279. #endif
  280. /**
  281. * Special pins
  282. * P1_30 (37) (NOT 5V tolerant)
  283. * P1_31 (49) (NOT 5V tolerant)
  284. * P0_27 (57) (Open collector)
  285. * P0_28 (58) (Open collector)
  286. */
  287. //
  288. // Include common SKR pins
  289. //
  290. #include "pins_BTT_SKR_common.h"