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

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