My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

pins_BTT_SKR_V1_1.h 8.2KB

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