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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  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. #define BOARD_INFO_NAME "BIGTREE SKR 1.3"
  24. /**
  25. * Trinamic Stallguard pins
  26. */
  27. #define X_DIAG_PIN P1_29 // X-
  28. #define Y_DIAG_PIN P1_27 // Y-
  29. #define Z_DIAG_PIN P1_25 // Z-
  30. #define E0_DIAG_PIN P1_28 // X+
  31. #define E1_DIAG_PIN P1_26 // Y+
  32. /**
  33. * Limit Switches
  34. */
  35. #if X_STALL_SENSITIVITY
  36. #define X_STOP_PIN X_DIAG_PIN
  37. #if X_HOME_DIR < 0
  38. #define X_MAX_PIN P1_28 // X+
  39. #else
  40. #define X_MIN_PIN P1_28 // X+
  41. #endif
  42. #else
  43. #define X_MIN_PIN P1_29 // X-
  44. #define X_MAX_PIN P1_28 // X+
  45. #endif
  46. #if Y_STALL_SENSITIVITY
  47. #define Y_STOP_PIN Y_DIAG_PIN
  48. #if Y_HOME_DIR < 0
  49. #define Y_MAX_PIN P1_26 // Y+
  50. #else
  51. #define Y_MIN_PIN P1_26 // Y+
  52. #endif
  53. #else
  54. #define Y_MIN_PIN P1_27 // Y-
  55. #define Y_MAX_PIN P1_26 // Y+
  56. #endif
  57. #if Z_STALL_SENSITIVITY
  58. #define Z_STOP_PIN Z_DIAG_PIN
  59. #if Z_HOME_DIR < 0
  60. #define Z_MAX_PIN P1_24 // Z+
  61. #else
  62. #define Z_MIN_PIN P1_24 // Z+
  63. #endif
  64. #else
  65. #define Z_MIN_PIN P1_25 // Z-
  66. #define Z_MAX_PIN P1_24 // Z+
  67. #endif
  68. #define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups
  69. //
  70. // Servos
  71. //
  72. #ifndef SERVO0_PIN
  73. #define SERVO0_PIN P2_00
  74. #endif
  75. //
  76. // Z Probe (when not Z_MIN_PIN)
  77. //
  78. #ifndef Z_MIN_PROBE_PIN
  79. #define Z_MIN_PROBE_PIN P1_24
  80. #endif
  81. //
  82. // Filament Runout Sensor
  83. //
  84. #ifndef FIL_RUNOUT_PIN
  85. #define FIL_RUNOUT_PIN P1_28
  86. #endif
  87. //
  88. // Steppers
  89. //
  90. #define X_STEP_PIN P2_02
  91. #define X_DIR_PIN P2_06
  92. #define X_ENABLE_PIN P2_01
  93. #ifndef X_CS_PIN
  94. #define X_CS_PIN P1_17
  95. #endif
  96. #define Y_STEP_PIN P0_19
  97. #define Y_DIR_PIN P0_20
  98. #define Y_ENABLE_PIN P2_08
  99. #ifndef Y_CS_PIN
  100. #define Y_CS_PIN P1_15
  101. #endif
  102. #define Z_STEP_PIN P0_22
  103. #define Z_DIR_PIN P2_11
  104. #define Z_ENABLE_PIN P0_21
  105. #ifndef Z_CS_PIN
  106. #define Z_CS_PIN P1_10
  107. #endif
  108. #define E0_STEP_PIN P2_13
  109. #define E0_DIR_PIN P0_11
  110. #define E0_ENABLE_PIN P2_12
  111. #ifndef E0_CS_PIN
  112. #define E0_CS_PIN P1_08
  113. #endif
  114. #ifndef E1_CS_PIN
  115. #define E1_CS_PIN P1_01
  116. #endif
  117. //
  118. // Software SPI pins for TMC2130 stepper drivers
  119. //
  120. #if ENABLED(TMC_USE_SW_SPI)
  121. #ifndef TMC_SW_MOSI
  122. #define TMC_SW_MOSI P4_28
  123. #endif
  124. #ifndef TMC_SW_MISO
  125. #define TMC_SW_MISO P0_05
  126. #endif
  127. #ifndef TMC_SW_SCK
  128. #define TMC_SW_SCK P0_04
  129. #endif
  130. #endif
  131. #if HAS_TMC220x
  132. /**
  133. * TMC2208/TMC2209 stepper drivers
  134. *
  135. * Hardware serial communication ports.
  136. * If undefined software serial is used according to the pins below
  137. */
  138. //#define X_HARDWARE_SERIAL Serial
  139. //#define X2_HARDWARE_SERIAL Serial1
  140. //#define Y_HARDWARE_SERIAL Serial1
  141. //#define Y2_HARDWARE_SERIAL Serial1
  142. //#define Z_HARDWARE_SERIAL Serial1
  143. //#define Z2_HARDWARE_SERIAL Serial1
  144. //#define E0_HARDWARE_SERIAL Serial1
  145. //#define E1_HARDWARE_SERIAL Serial1
  146. //#define E2_HARDWARE_SERIAL Serial1
  147. //#define E3_HARDWARE_SERIAL Serial1
  148. //#define E4_HARDWARE_SERIAL Serial1
  149. //
  150. // Software serial
  151. //
  152. #define X_SERIAL_TX_PIN P4_29
  153. #define X_SERIAL_RX_PIN P1_17
  154. #define Y_SERIAL_TX_PIN P1_16
  155. #define Y_SERIAL_RX_PIN P1_15
  156. #define Z_SERIAL_TX_PIN P1_14
  157. #define Z_SERIAL_RX_PIN P1_10
  158. #define E0_SERIAL_TX_PIN P1_09
  159. #define E0_SERIAL_RX_PIN P1_08
  160. #define E1_SERIAL_TX_PIN P1_04
  161. #define E1_SERIAL_RX_PIN P1_01
  162. // Reduce baud rate to improve software serial reliability
  163. #define TMC_BAUD_RATE 19200
  164. #endif
  165. /**
  166. * _____ _____
  167. * NC | 1 2 | GND 5V | 1 2 | GND
  168. * RESET | 3 4 | 1.31 (SD_DETECT) (LCD_D7) 1.23 | 3 4 | 1.22 (LCD_D6)
  169. * (MOSI) 0.18 | 5 6 3.25 (BTN_EN2) (LCD_D5) 1.21 | 5 6 1.20 (LCD_D4)
  170. * (SD_SS) 0.16 | 7 8 | 3.26 (BTN_EN1) (LCD_RS) 1.19 | 7 8 | 1.18 (LCD_EN)
  171. * (SCK) 0.15 | 9 10| 0.17 (MISO) (BTN_ENC) 0.28 | 9 10| 1.30 (BEEPER)
  172. * ----- -----
  173. * EXP2 EXP1
  174. */
  175. #define EXPA1_03_PIN P1_23
  176. #define EXPA1_04_PIN P1_22
  177. #define EXPA1_05_PIN P1_21
  178. #define EXPA1_06_PIN P1_20
  179. #define EXPA1_07_PIN P1_19
  180. #define EXPA1_08_PIN P1_18
  181. #define EXPA1_09_PIN P0_28
  182. #define EXPA1_10_PIN P1_30
  183. #define EXPA2_03_PIN -1
  184. #define EXPA2_04_PIN P1_31
  185. #define EXPA2_05_PIN P0_18
  186. #define EXPA2_06_PIN P3_25
  187. #define EXPA2_07_PIN P0_16
  188. #define EXPA2_08_PIN P3_26
  189. #define EXPA2_09_PIN P0_15
  190. #define EXPA2_10_PIN P0_17
  191. #if HAS_SPI_LCD
  192. #if ENABLED(ANET_FULL_GRAPHICS_LCD)
  193. #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. Comment out this line to continue."
  194. /**
  195. * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
  196. * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
  197. * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.)
  198. * 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board.
  199. *
  200. * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
  201. *
  202. * The ANET_FULL_GRAPHICS_LCD connector plug:
  203. *
  204. * BEFORE AFTER
  205. * _____ _____
  206. * GND 1 | 1 2 | 2 5V 5V 1 | 1 2 | 2 GND
  207. * CS 3 | 3 4 | 4 BTN_EN2 CS 3 | 3 4 | 4 BTN_EN2
  208. * SID 5 | 5 6 6 BTN_EN1 SID 5 | 5 6 6 BTN_EN1
  209. * open 7 | 7 8 | 8 BTN_ENC CLK 7 | 7 8 | 8 BTN_ENC
  210. * CLK 9 | 9 10| 10 Beeper open 9 | 9 10| 10 Beeper
  211. * ----- -----
  212. * LCD LCD
  213. */
  214. #define LCD_PINS_RS EXPA1_03_PIN
  215. #define BTN_EN1 EXPA1_06_PIN
  216. #define BTN_EN2 EXPA1_04_PIN
  217. #define BTN_ENC EXPA1_08_PIN
  218. #define LCD_PINS_ENABLE EXPA1_05_PIN
  219. #define LCD_PINS_D4 EXPA1_07_PIN
  220. #elif ENABLED(CR10_STOCKDISPLAY)
  221. #define LCD_PINS_RS EXPA1_04_PIN
  222. #define BTN_EN1 EXPA1_08_PIN
  223. #define BTN_EN2 EXPA1_06_PIN
  224. #define BTN_ENC EXPA1_09_PIN // (58) open-drain
  225. #define LCD_PINS_ENABLE EXPA1_03_PIN
  226. #define LCD_PINS_D4 EXPA1_05_PIN
  227. #else // !CR10_STOCKDISPLAY
  228. #define LCD_PINS_RS EXPA1_07_PIN
  229. #define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4
  230. #define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4
  231. #define BTN_ENC EXPA1_09_PIN // (58) open-drain
  232. #define LCD_PINS_ENABLE EXPA1_08_PIN
  233. #define LCD_PINS_D4 EXPA1_06_PIN
  234. #define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4
  235. #define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant)
  236. #if ENABLED(FYSETC_MINI_12864)
  237. #define DOGLCD_CS EXPA1_08_PIN
  238. #define DOGLCD_A0 EXPA1_07_PIN
  239. #define DOGLCD_SCK EXPA2_09_PIN
  240. #define DOGLCD_MOSI EXPA2_05_PIN
  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 EXPA1_06_PIN // 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 EXPA1_05_PIN
  248. #endif
  249. #ifndef RGB_LED_G_PIN
  250. #define RGB_LED_G_PIN EXPA1_04_PIN
  251. #endif
  252. #ifndef RGB_LED_B_PIN
  253. #define RGB_LED_B_PIN EXPA1_03_PIN
  254. #endif
  255. #elif ENABLED(FYSETC_MINI_12864_2_1)
  256. #define NEOPIXEL_PIN EXPA1_05_PIN
  257. #define REVERSE_ENCODER_DIRECTION
  258. #endif
  259. #else // !FYSETC_MINI_12864
  260. #if ENABLED(MKS_MINI_12864)
  261. #define DOGLCD_CS EXPA1_05_PIN
  262. #define DOGLCD_A0 EXPA1_04_PIN
  263. #define DOGLCD_SCK EXPA2_09_PIN
  264. #define DOGLCD_MOSI EXPA2_05_PIN
  265. #elif ENABLED(ENDER2_STOCKDISPLAY)
  266. /**
  267. * Creality Ender-2 display pinout
  268. * _____
  269. * 5V | 1 2 | GND
  270. * (MOSI) P1_23 | 3 4 | P1_22 (LCD_CS)
  271. * (LCD_A0) P1_21 | 5 6 P1_20 (BTN_EN2)
  272. * RESET P1_19 | 7 8 | P1_18 (BTN_EN1)
  273. * (BTN_ENC) P0_28 | 9 10| P1_30 (SCK)
  274. * -----
  275. * EXP1
  276. */
  277. #define BTN_EN1 EXPA1_08_PIN
  278. #define BTN_EN2 EXPA1_06_PIN
  279. #define BTN_ENC EXPA1_09_PIN
  280. #define DOGLCD_CS EXPA1_04_PIN
  281. #define DOGLCD_A0 EXPA1_05_PIN
  282. #define DOGLCD_SCK EXPA1_10_PIN
  283. #define DOGLCD_MOSI EXPA1_03_PIN
  284. #define FORCE_SOFT_SPI
  285. #define LCD_BACKLIGHT_PIN -1
  286. #endif
  287. #if ENABLED(ULTIPANEL)
  288. #define LCD_PINS_D5 EXPA1_05_PIN
  289. #define LCD_PINS_D6 EXPA1_04_PIN
  290. #define LCD_PINS_D7 EXPA1_03_PIN
  291. #endif
  292. #endif // !FYSETC_MINI_12864
  293. #endif // !CR10_STOCKDISPLAY
  294. #endif // HAS_SPI_LCD
  295. //
  296. // SD Support
  297. //
  298. #ifndef SDCARD_CONNECTION
  299. #define SDCARD_CONNECTION LCD
  300. #endif
  301. #if SD_CONNECTION_IS(LCD)
  302. #define SS_PIN EXPA2_07_PIN
  303. #endif
  304. /**
  305. * Special pins
  306. * P1_30 (37) (NOT 5V tolerant)
  307. * P1_31 (49) (NOT 5V tolerant)
  308. * P0_27 (57) (Open collector)
  309. * P0_28 (58) (Open collector)
  310. */
  311. // Include common SKR pins
  312. #include "pins_BTT_SKR_common.h"