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 9.5KB

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