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_BIGTREE_SKR_V1.1.h 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. #ifndef TARGET_LPC1768
  24. #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
  25. #endif
  26. #define BOARD_INFO_NAME "BIGTREE SKR 1.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. #define E1_STEP_PIN P0_01
  52. #define E1_DIR_PIN P0_00
  53. #define E1_ENABLE_PIN P0_10
  54. //
  55. // Temperature Sensors
  56. // 3.3V max when defined as an analog input
  57. //
  58. #define TEMP_BED_PIN 0 // Analog Input
  59. #define TEMP_0_PIN 1 // Analog Input
  60. #define TEMP_1_PIN 2 // Analog Input
  61. //
  62. // Heaters / Fans
  63. //
  64. #define HEATER_0_PIN P2_07
  65. #if HOTENDS == 1
  66. #define FAN1_PIN P2_04
  67. #else
  68. #define HEATER_1_PIN P2_04
  69. #endif
  70. #define FAN_PIN P2_03
  71. #define HEATER_BED_PIN P2_05
  72. /**
  73. * LCD / Controller
  74. *
  75. * As of 20 JAN 2019 only the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER display has
  76. * been tested with these settings. It can be connected to the SKR using standard cables
  77. * via the EXP1 and EXP2 ports. Other displays may need a custom cable and/or changes to
  78. * the pins defined below.
  79. *
  80. * The SD card on the LCD controller uses the same SPI signals as the LCD, resulting in
  81. * garbage/lines on the LCD display during SD card access. The LCD code mitigates this
  82. * by redrawing the screen after SD card accesses.
  83. */
  84. #if HAS_SPI_LCD
  85. #define BEEPER_PIN P1_30
  86. #define BTN_EN1 P3_26
  87. #define BTN_EN2 P3_25
  88. #define BTN_ENC P2_11
  89. #define SD_DETECT_PIN P1_31
  90. #define LCD_SDSS P1_23
  91. #define LCD_PINS_RS P0_16
  92. #define LCD_PINS_ENABLE P0_18
  93. #define LCD_PINS_D4 P0_15
  94. #if ENABLED(MKS_MINI_12864)
  95. #define DOGLCD_CS P2_06
  96. #define DOGLCD_A0 P0_16
  97. #endif
  98. #endif
  99. //
  100. // SD Support
  101. //
  102. // MKS_MINI_12864 strongly prefers the SD card on the display and
  103. // requires jumpers on the SKR V1.1 board as documented here:
  104. // https://www.facebook.com/groups/505736576548648/permalink/630639874058317/
  105. #ifndef SDCARD_CONNECTION
  106. #if ENABLED(MKS_MINI_12864)
  107. #define SDCARD_CONNECTION LCD
  108. #else
  109. #define SDCARD_CONNECTION ONBOARD
  110. #endif
  111. #endif
  112. #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
  113. #if SD_CONNECTION_IS(LCD)
  114. #define SCK_PIN P0_15
  115. #define MISO_PIN P0_17
  116. #define MOSI_PIN P0_18
  117. #define SS_PIN P1_23
  118. #elif SD_CONNECTION_IS(ONBOARD)
  119. #undef SD_DETECT_PIN
  120. #define SD_DETECT_PIN P0_27
  121. #define SCK_PIN P0_07
  122. #define MISO_PIN P0_08
  123. #define MOSI_PIN P0_09
  124. #define SS_PIN ONBOARD_SD_CS_PIN
  125. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  126. #error "No custom SD drive cable defined for this board."
  127. #endif
  128. // Trinamic driver support
  129. #if HAS_TRINAMIC
  130. // Using TMC devices in intelligent mode requires extra connections to each device. Unfortunately
  131. // the SKR does not have many free pins (especially if a display is in use). The SPI-based devices
  132. // will require 3 connections (clock, mosi, miso), plus a chip select line (CS) for each driver.
  133. // The UART-based devices require 2 pis per deriver (one of which must be interrupt capable).
  134. // The same SPI pins can be shared with the display/SD card reader, meaning SPI-based devices are
  135. // probably a good choice for this board.
  136. //
  137. // SOFTWARE_DRIVER_ENABLE is a good option. It uses SPI to control the driver enable and allows the
  138. // hardware ENABLE pins for each driver to be repurposed as SPI chip select. To use this mode the
  139. // driver modules will probably need to be modified, removing the pin used for the enable line from
  140. // the module and wiring this connection directly to GND (as is the case for TMC2130).
  141. // Using this option and sharing all of the SPI pins allows 5 TMC2130 drivers to be used along with
  142. // a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER without requiring the use of any extra pins.
  143. //
  144. // Other options will probably require the use of any free pins and the TFT serial port or a
  145. // different type of display (like the TFT), using the pins normally used for the display and encoder.
  146. // Unfortunately, tests show it's not possible to use endstop and thermistor pins for chip-select.
  147. // Sample settings are provided below, but only some have been tested.
  148. //
  149. // Another option is to share the enable and chip-select pins when using SPI. Several users have
  150. // reported that this works. However, it's unlikely that this configuration will allow SPI communi-
  151. // cation with the device when the drivers are active, meaning that some of the more advanced TMC
  152. // options may not be available.
  153. // When using any TMC SPI-based drivers, software SPI is used
  154. // because pins may be shared with the display or SD card.
  155. #define TMC_USE_SW_SPI
  156. #define TMC_SW_MOSI P0_18
  157. #define TMC_SW_MISO P0_17
  158. // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.)
  159. #define TMC_SW_SCK P0_15
  160. // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
  161. //#define TMC_SW_SCK P2_06
  162. #if ENABLED(SOFTWARE_DRIVER_ENABLE)
  163. // Software enable allows the enable pins to be repurposed as chip-select pins.
  164. // Note: Requires the driver modules to be modified to always be enabled with the enable pin removed.
  165. #if AXIS_DRIVER_TYPE_X(TMC2130)
  166. #define X_CS_PIN P4_28
  167. #undef X_ENABLE_PIN
  168. #define X_ENABLE_PIN -1
  169. #endif
  170. #if AXIS_DRIVER_TYPE_Y(TMC2130)
  171. #define Y_CS_PIN P2_00
  172. #undef Y_ENABLE_PIN
  173. #define Y_ENABLE_PIN -1
  174. #endif
  175. #if AXIS_DRIVER_TYPE_Z(TMC2130)
  176. #define Z_CS_PIN P0_19
  177. #undef Z_ENABLE_PIN
  178. #define Z_ENABLE_PIN -1
  179. #endif
  180. #if AXIS_DRIVER_TYPE_E0(TMC2130)
  181. #define E0_CS_PIN P2_12
  182. #undef E0_ENABLE_PIN
  183. #define E0_ENABLE_PIN -1
  184. #endif
  185. #if AXIS_DRIVER_TYPE_E1(TMC2130)
  186. #define E1_CS_PIN P0_10
  187. #undef E1_ENABLE_PIN
  188. #define E1_ENABLE_PIN -1
  189. #endif
  190. #else // !SOFTWARE_DRIVER_ENABLE
  191. // A chip-select pin is needed for each driver.
  192. // EXAMPLES
  193. // Example 1: No LCD attached or a TFT style display using the AUX header RX/TX pins.
  194. // SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2.
  195. //#define SKR_USE_LCD_PINS_FOR_CS
  196. #if ENABLED(SKR_USE_LCD_PINS_FOR_CS)
  197. #if SD_CONNECTION_IS(LCD)
  198. #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_PINS_FOR_CS."
  199. #endif
  200. #define X_CS_PIN P1_23
  201. #define Y_CS_PIN P3_26
  202. #define Z_CS_PIN P2_11
  203. #define E0_CS_PIN P3_25
  204. #define E1_CS_PIN P1_31
  205. #endif
  206. // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  207. // The SD card reader attached to the LCD (if present) can't be used because
  208. // the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'.
  209. //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS
  210. #if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
  211. #if SD_CONNECTION_IS(LCD)
  212. #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_SD_CARD_PINS_FOR_CS."
  213. #endif
  214. #define X_CS_PIN P0_02
  215. #define Y_CS_PIN P0_03
  216. #define Z_CS_PIN P2_06
  217. // We use SD_DETECT_PIN for E0
  218. #undef SD_DETECT_PIN
  219. #define E0_CS_PIN P1_31
  220. // We use LCD_SDSS pin for E1
  221. #undef LCD_SDSS
  222. #define LCD_SDSS -1
  223. #define E1_CS_PIN P1_23
  224. #endif
  225. // Example 3: Use the driver enable pins for chip-select.
  226. // Commands must not be sent to the drivers when enabled. So certain
  227. // advanced features (like driver monitoring) will not be available.
  228. //#define SKR_USE_ENABLE_CS
  229. #if ENABLED(SKR_USE_ENABLE_FOR_CS)
  230. #define X_CS_PIN X_ENABLE_PIN
  231. #define Y_CS_PIN Y_ENABLE_PIN
  232. #define Z_CS_PIN Z_ENABLE_PIN
  233. #define E0_CS_PIN E0_ENABLE_PIN
  234. #define E1_CS_PIN E1_ENABLE_PIN
  235. #endif
  236. #endif // SOFTWARE_DRIVER_ENABLE
  237. #endif