My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

pins_BTT_SKR_V1_1.h 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * BigTreeTech SKR 1.1 pin assignments
  25. */
  26. #define BOARD_INFO_NAME "BTT SKR V1.1"
  27. //
  28. // Limit Switches
  29. //
  30. #define X_MIN_PIN P1_29
  31. #define X_MAX_PIN P1_28
  32. #define Y_MIN_PIN P1_27
  33. #define Y_MAX_PIN P1_26
  34. #define Z_MIN_PIN P1_25
  35. #define Z_MAX_PIN P1_24
  36. //
  37. // Steppers
  38. //
  39. #define X_STEP_PIN P0_04
  40. #define X_DIR_PIN P0_05
  41. #define X_ENABLE_PIN P4_28
  42. #define Y_STEP_PIN P2_01
  43. #define Y_DIR_PIN P2_02
  44. #define Y_ENABLE_PIN P2_00
  45. #define Z_STEP_PIN P0_20
  46. #define Z_DIR_PIN P0_21
  47. #define Z_ENABLE_PIN P0_19
  48. #define E0_STEP_PIN P0_11
  49. #define E0_DIR_PIN P2_13
  50. #define E0_ENABLE_PIN P2_12
  51. /** ------ ------
  52. * 1.30 | 1 2 | 2.11 0.17 | 1 2 | 0.15
  53. * 0.18 | 3 4 | 0.16 3.26 | 3 4 | 1.23
  54. * 0.15 5 6 | -- 3.25 5 6 | 0.18
  55. * -- | 7 8 | -- 1.31 | 7 8 | RESET
  56. * GND | 9 10 | 5V GND | 9 10 | --
  57. * ------ ------
  58. * EXP1 EXP2
  59. */
  60. #define EXP1_01_PIN P1_30
  61. #define EXP1_02_PIN P2_11
  62. #define EXP1_03_PIN P0_18
  63. #define EXP1_04_PIN P0_16
  64. #define EXP1_05_PIN P0_15
  65. #define EXP1_06_PIN -1 // NC
  66. #define EXP1_07_PIN -1 // NC
  67. #define EXP1_08_PIN -1 // NC
  68. #define EXP2_01_PIN P0_17
  69. #define EXP2_02_PIN P0_15
  70. #define EXP2_03_PIN P3_26
  71. #define EXP2_04_PIN P1_23
  72. #define EXP2_05_PIN P3_25
  73. #define EXP2_06_PIN P0_18
  74. #define EXP2_07_PIN P1_31
  75. #define EXP2_08_PIN -1 // RESET
  76. /**
  77. * LCD / Controller
  78. *
  79. * As of 20 JAN 2019 only the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER display has
  80. * been tested with these settings. It can be connected to the SKR using standard cables
  81. * via the EXP1 and EXP2 ports. Other displays may need a custom cable and/or changes to
  82. * the pins defined below.
  83. *
  84. * The SD card on the LCD controller uses the same SPI signals as the LCD, resulting in
  85. * garbage/lines on the LCD display during SD card access. The LCD code mitigates this
  86. * by redrawing the screen after SD card accesses.
  87. */
  88. #if IS_TFTGLCD_PANEL
  89. #if ENABLED(TFTGLCD_PANEL_SPI)
  90. #define TFTGLCD_CS EXP2_03_PIN
  91. #endif
  92. #elif HAS_WIRED_LCD
  93. #define BTN_EN1 EXP2_03_PIN
  94. #define BTN_EN2 EXP2_05_PIN
  95. #define BTN_ENC EXP1_02_PIN
  96. #define LCD_SDSS EXP2_04_PIN
  97. #define LCD_PINS_RS EXP1_04_PIN
  98. #define LCD_PINS_ENABLE EXP2_06_PIN
  99. #define LCD_PINS_D4 EXP2_02_PIN
  100. #if ENABLED(MKS_MINI_12864)
  101. #define DOGLCD_CS P2_06
  102. #define DOGLCD_A0 EXP1_04_PIN
  103. #endif
  104. #endif // HAS_WIRED_LCD
  105. //
  106. // SD Support
  107. //
  108. // MKS_MINI_12864 strongly prefers the SD card on the display and
  109. // requires jumpers on the SKR V1.1 board as documented here:
  110. // https://www.facebook.com/groups/505736576548648/permalink/630639874058317/
  111. #ifndef SDCARD_CONNECTION
  112. #if ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY, IS_TFTGLCD_PANEL)
  113. #define SDCARD_CONNECTION LCD
  114. #else
  115. #define SDCARD_CONNECTION ONBOARD
  116. #endif
  117. #endif
  118. // Trinamic driver support
  119. #if HAS_TRINAMIC_CONFIG
  120. // Using TMC devices in intelligent mode requires extra connections to each device. Unfortunately
  121. // the SKR does not have many free pins (especially if a display is in use). The SPI-based devices
  122. // will require 3 connections (clock, mosi, miso), plus a chip select line (CS) for each driver.
  123. // The UART-based devices require 2 pis per driver (one of which must be interrupt capable).
  124. // The same SPI pins can be shared with the display/SD card reader, meaning SPI-based devices are
  125. // probably a good choice for this board.
  126. //
  127. // SOFTWARE_DRIVER_ENABLE is a good option. It uses SPI to control the driver enable and allows the
  128. // hardware ENABLE pins for each driver to be repurposed as SPI chip select. To use this mode the
  129. // driver modules will probably need to be modified, removing the pin used for the enable line from
  130. // the module and wiring this connection directly to GND (as is the case for TMC2130).
  131. // Using this option and sharing all of the SPI pins allows 5 TMC2130 drivers to be used along with
  132. // a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER without requiring the use of any extra pins.
  133. //
  134. // Other options will probably require the use of any free pins and the TFT serial port or a
  135. // different type of display (like the TFT), using the pins normally used for the display and encoder.
  136. // Unfortunately, tests show it's not possible to use endstop and thermistor pins for chip-select.
  137. // Sample settings are provided below, but only some have been tested.
  138. //
  139. // Another option is to share the enable and chip-select pins when using SPI. Several users have
  140. // reported that this works. However, it's unlikely that this configuration will allow SPI communi-
  141. // cation with the device when the drivers are active, meaning that some of the more advanced TMC
  142. // options may not be available.
  143. // When using any TMC SPI-based drivers, software SPI is used
  144. // because pins may be shared with the display or SD card.
  145. #define TMC_USE_SW_SPI
  146. #define TMC_SW_MOSI EXP2_06_PIN
  147. #define TMC_SW_MISO EXP2_01_PIN
  148. // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.)
  149. #define TMC_SW_SCK EXP2_02_PIN
  150. // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
  151. //#define TMC_SW_SCK P2_06
  152. #if ENABLED(SOFTWARE_DRIVER_ENABLE)
  153. // Software enable allows the enable pins to be repurposed as chip-select pins.
  154. // Note: Requires the driver modules to be modified to always be enabled with the enable pin removed.
  155. #if AXIS_DRIVER_TYPE_X(TMC2130)
  156. #define X_CS_PIN P4_28
  157. #undef X_ENABLE_PIN
  158. #endif
  159. #if AXIS_DRIVER_TYPE_Y(TMC2130)
  160. #define Y_CS_PIN P2_00
  161. #undef Y_ENABLE_PIN
  162. #endif
  163. #if AXIS_DRIVER_TYPE_Z(TMC2130)
  164. #define Z_CS_PIN P0_19
  165. #undef Z_ENABLE_PIN
  166. #endif
  167. #if AXIS_DRIVER_TYPE_E0(TMC2130)
  168. #define E0_CS_PIN P2_12
  169. #undef E0_ENABLE_PIN
  170. #endif
  171. #if AXIS_DRIVER_TYPE_E1(TMC2130)
  172. #define E1_CS_PIN P0_10
  173. #undef E1_ENABLE_PIN
  174. #endif
  175. #else // !SOFTWARE_DRIVER_ENABLE
  176. // A chip-select pin is needed for each driver.
  177. // EXAMPLES
  178. // Example 1: No LCD attached or a TFT style display using the AUX header RX/TX pins.
  179. // SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2.
  180. //#define SKR_USE_LCD_PINS_FOR_CS
  181. #if ENABLED(SKR_USE_LCD_PINS_FOR_CS)
  182. #define X_CS_PIN EXP2_04_PIN
  183. #define Y_CS_PIN EXP2_03_PIN
  184. #define Z_CS_PIN EXP1_02_PIN
  185. #define E0_CS_PIN EXP2_05_PIN
  186. #define E1_CS_PIN EXP2_07_PIN
  187. #endif
  188. // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  189. // The SD card reader attached to the LCD (if present) can't be used because
  190. // the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'.
  191. //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS
  192. #if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
  193. #define X_CS_PIN P0_02
  194. #define Y_CS_PIN P0_03
  195. #define Z_CS_PIN P2_06
  196. // We use SD_DETECT_PIN for E0
  197. #undef SD_DETECT_PIN
  198. #define E0_CS_PIN EXP2_07_PIN
  199. // We use LCD_SDSS pin for E1
  200. #undef LCD_SDSS
  201. #define LCD_SDSS -1
  202. #define E1_CS_PIN EXP2_04_PIN
  203. #endif
  204. // Example 3: Use the driver enable pins for chip-select.
  205. // Commands must not be sent to the drivers when enabled. So certain
  206. // advanced features (like driver monitoring) will not be available.
  207. //#define SKR_USE_ENABLE_CS
  208. #if ENABLED(SKR_USE_ENABLE_FOR_CS)
  209. #define X_CS_PIN X_ENABLE_PIN
  210. #define Y_CS_PIN Y_ENABLE_PIN
  211. #define Z_CS_PIN Z_ENABLE_PIN
  212. #define E0_CS_PIN E0_ENABLE_PIN
  213. #define E1_CS_PIN E1_ENABLE_PIN
  214. #endif
  215. #endif // SOFTWARE_DRIVER_ENABLE
  216. #endif
  217. // Include common SKR pins
  218. #include "pins_BTT_SKR_common.h"