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_1.h 9.2KB

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