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

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