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_MKS_SKIPR_V1_0.h 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2022 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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include "env_validate.h"
  24. #if HOTENDS > 4 || E_STEPPERS > 4
  25. #error "MKS SKIPR supports up to 4 hotends / E steppers."
  26. #endif
  27. #define BOARD_INFO_NAME "MKS SKIPR V1.0"
  28. // Valid SERIAL_PORT values: -1 (USB-C), 1 (direct to RK3328), 3 (USART3 header)
  29. #define USES_DIAG_JUMPERS
  30. // Onboard I2C EEPROM
  31. #define I2C_EEPROM
  32. #define MARLIN_EEPROM_SIZE 0x1000 // 4K (AT24C32)
  33. #define I2C_SCL_PIN PB8
  34. #define I2C_SDA_PIN PB9
  35. //
  36. // Servos
  37. //
  38. #define SERVO0_PIN PA8
  39. //
  40. // Trinamic Stallguard pins // Connector labels
  41. #define X_DIAG_PIN PA14 // X-
  42. #define Y_DIAG_PIN PA15 // Y-
  43. #define Z_DIAG_PIN PB15 // Z-
  44. #define E0_DIAG_PIN PA13 // MT-DET
  45. #define E1_DIAG_PIN PC5 // NEOPIXEL
  46. #define E2_DIAG_PIN PB14 // Z+
  47. //
  48. // Check for additional used endstop pins
  49. //
  50. #if HAS_EXTRA_ENDSTOPS
  51. #define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES
  52. #if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_)
  53. #define NEEDS_X_MINMAX 1
  54. #endif
  55. #if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_)
  56. #define NEEDS_Y_MINMAX 1
  57. #endif
  58. #if _ENDSTOP_IS_ANY(_ZMIN_) || _ENDSTOP_IS_ANY(_ZMAX_)
  59. #define NEEDS_Z_MINMAX 1
  60. #endif
  61. #undef _ENDSTOP_IS_ANY
  62. #endif
  63. //
  64. // Limit Switches
  65. //
  66. #ifdef X_STALL_SENSITIVITY
  67. #define X_STOP_PIN X_DIAG_PIN // X-
  68. #elif EITHER(DUAL_X_CARRIAGE, NEEDS_X_MINMAX)
  69. #ifndef X_MIN_PIN
  70. #define X_MIN_PIN X_DIAG_PIN // X-
  71. #endif
  72. #ifndef X_MAX_PIN
  73. #define X_MAX_PIN E0_DIAG_PIN // MT-DET
  74. #endif
  75. #else
  76. #define X_STOP_PIN X_DIAG_PIN // X-
  77. #endif
  78. #ifdef Y_STALL_SENSITIVITY
  79. #define Y_STOP_PIN Y_DIAG_PIN // Y-
  80. #elif NEEDS_Y_MINMAX
  81. #ifndef Y_MIN_PIN
  82. #define Y_MIN_PIN Y_DIAG_PIN // Y-
  83. #endif
  84. #ifndef Y_MAX_PIN
  85. #define Y_MAX_PIN E1_DIAG_PIN // NEOPIXEL
  86. #endif
  87. #else
  88. #define Y_STOP_PIN Y_DIAG_PIN // Y-
  89. #endif
  90. #ifdef Z_STALL_SENSITIVITY
  91. #define Z_STOP_PIN Z_DIAG_PIN // Z-
  92. #elif NEEDS_Z_MINMAX
  93. #ifndef Z_MIN_PIN
  94. #define Z_MIN_PIN Z_DIAG_PIN // Z-
  95. #endif
  96. #ifndef Z_MAX_PIN
  97. #define Z_MAX_PIN E2_DIAG_PIN // Z+
  98. #endif
  99. #else
  100. #define Z_STOP_PIN Z_DIAG_PIN // Z-
  101. #endif
  102. #if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) || ENABLED(USE_PROBE_FOR_Z_HOMING)
  103. #ifndef Z_MIN_PROBE
  104. #define Z_MIN_PROBE_PIN E2_DIAG_PIN // defaults to 'Z+' connector
  105. #endif
  106. #endif
  107. #undef NEEDS_X_MINMAX
  108. #undef NEEDS_Y_MINMAX
  109. #undef NEEDS_Z_MINMAX
  110. //
  111. // Steppers
  112. //
  113. #define X_STEP_PIN PC14
  114. #define X_DIR_PIN PC13
  115. #define X_ENABLE_PIN PC15
  116. #ifndef X_CS_PIN
  117. #define X_CS_PIN PE6
  118. #endif
  119. #define Y_STEP_PIN PE5
  120. #define Y_DIR_PIN PE4
  121. #define Y_ENABLE_PIN PD14
  122. #ifndef Y_CS_PIN
  123. #define Y_CS_PIN PE3
  124. #endif
  125. #define Z_STEP_PIN PE1 // "Z1"
  126. #define Z_DIR_PIN PE0
  127. #define Z_ENABLE_PIN PE2
  128. #ifndef Z_CS_PIN
  129. #define Z_CS_PIN PB7
  130. #endif
  131. #define E0_STEP_PIN PB5
  132. #define E0_DIR_PIN PB4
  133. #define E0_ENABLE_PIN PB6
  134. #ifndef E0_CS_PIN
  135. #define E0_CS_PIN PB3
  136. #endif
  137. #define E1_STEP_PIN PD6 // "Z2"
  138. #define E1_DIR_PIN PD5
  139. #define E1_ENABLE_PIN PD7
  140. #ifndef E1_CS_PIN
  141. #define E1_CS_PIN PD4
  142. #endif
  143. #define E2_STEP_PIN PD2 // "Z3"
  144. #define E2_DIR_PIN PD1
  145. #define E2_ENABLE_PIN PD3
  146. #ifndef E2_CS_PIN
  147. #define E2_CS_PIN PD0
  148. #endif
  149. #define E3_STEP_PIN PC7 // "Z4"
  150. #define E3_DIR_PIN PC6
  151. #define E3_ENABLE_PIN PC8
  152. #ifndef E3_CS_PIN
  153. #define E3_CS_PIN PD15
  154. #endif
  155. //
  156. // Temperature Sensors
  157. //
  158. #define TEMP_BED_PIN PC0 // TB
  159. #define TEMP_0_PIN PC1 // TH0
  160. #define TEMP_1_PIN PC2 // TH1
  161. #define TEMP_2_PIN PC3 // TH2
  162. //
  163. // Heaters / Fans
  164. //
  165. #define HEATER_BED_PIN PD12 // Hotbed
  166. #define HEATER_0_PIN PB1 // Heater0
  167. #define HEATER_1_PIN PB0 // Heater1
  168. #define HEATER_2_PIN PA3 // Heater2
  169. #define FAN_PIN PA2 // Fan0
  170. #define FAN1_PIN PA1 // Fan1
  171. #define FAN2_PIN PA0 // Fan2
  172. //
  173. // Software SPI pins for TMC2130 stepper drivers
  174. // This board doesn't support hardware SPI there
  175. //
  176. #if HAS_TMC_SPI
  177. #define TMC_USE_SW_SPI
  178. #define TMC_SW_MOSI PE14
  179. #define TMC_SW_MISO PE13
  180. #define TMC_SW_SCK PE12
  181. #endif
  182. //
  183. // TMC2208/TMC2209 stepper drivers
  184. // This board is routed for one-wire software serial
  185. //
  186. #if HAS_TMC_UART
  187. #define X_SERIAL_TX_PIN PE6
  188. #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
  189. #define Y_SERIAL_TX_PIN PE3
  190. #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
  191. #define Z_SERIAL_TX_PIN PB7
  192. #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
  193. #define E0_SERIAL_TX_PIN PB3
  194. #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
  195. #define E1_SERIAL_TX_PIN PD4
  196. #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
  197. #define E2_SERIAL_TX_PIN PD0
  198. #define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
  199. #define E3_SERIAL_TX_PIN PD15
  200. #define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
  201. // Reduce baud rate to improve software serial reliability
  202. #define TMC_BAUD_RATE 19200
  203. #endif
  204. /** ------ ------
  205. * (BEEPER) PB2 | 1 2 | PE10 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK)
  206. * (LCD_EN) PE11 | 3 4 | PD10 (LCD_RS) (BTN_EN1) PE9 | 3 4 | PA4 (SD_SS)
  207. * (LCD_D4) PD9 | 5 6 PD8 (LCD_D5) (BTN_EN2) PE8 | 5 6 PA7 (MOSI)
  208. * (LCD_D6) PE15 | 7 8 | PE7 (LCD_D7) (SD_DETECT) PD13 | 7 8 | RESET
  209. * GND | 9 10 | 5V GND | 9 10 | --
  210. * ------ ------
  211. * EXP1 EXP2
  212. */
  213. #define EXP1_01_PIN PB2
  214. #define EXP1_02_PIN PE10
  215. #define EXP1_03_PIN PE11
  216. #define EXP1_04_PIN PD10
  217. #define EXP1_05_PIN PD9
  218. #define EXP1_06_PIN PD8
  219. #define EXP1_07_PIN PE15
  220. #define EXP1_08_PIN PE7
  221. #define EXP2_01_PIN PA6
  222. #define EXP2_02_PIN PA5
  223. #define EXP2_03_PIN PE9
  224. #define EXP2_04_PIN PA4
  225. #define EXP2_05_PIN PE8
  226. #define EXP2_06_PIN PA7
  227. #define EXP2_07_PIN PD13
  228. #define EXP2_08_PIN -1 // connected to MCU reset
  229. //
  230. // SD Support
  231. // Onboard SD card use hardware SPI3 (defined in variant), LCD SD card use hardware SPI1
  232. //
  233. #if ENABLED(SDSUPPORT)
  234. #ifndef SDCARD_CONNECTION
  235. #define SDCARD_CONNECTION LCD
  236. #endif
  237. #if SD_CONNECTION_IS(ONBOARD)
  238. //#define SOFTWARE_SPI
  239. //#define SD_SPI_SPEED SPI_HALF_SPEED
  240. #undef SD_DETECT_STATE
  241. #define SD_DETECT_STATE LOW
  242. #define SD_DETECT_PIN PC4
  243. #elif SD_CONNECTION_IS(LCD)
  244. //#define SOFTWARE_SPI
  245. //#define SD_SPI_SPEED SPI_QUARTER_SPEED
  246. #define SD_SS_PIN EXP2_04_PIN
  247. #define SD_SCK_PIN EXP2_02_PIN
  248. #define SD_MISO_PIN EXP2_01_PIN
  249. #define SD_MOSI_PIN EXP2_06_PIN
  250. #define SD_DETECT_PIN EXP2_07_PIN
  251. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  252. #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board"
  253. #endif
  254. #define SDSS SD_SS_PIN
  255. #endif
  256. //
  257. // LCDs and Controllers
  258. //
  259. #if IS_TFTGLCD_PANEL
  260. #if ENABLED(TFTGLCD_PANEL_SPI)
  261. #define TFTGLCD_CS EXP2_03_PIN
  262. #endif
  263. #elif HAS_WIRED_LCD
  264. #define BEEPER_PIN EXP1_01_PIN
  265. #define BTN_ENC EXP1_02_PIN
  266. #if ENABLED(CR10_STOCKDISPLAY)
  267. #define LCD_PINS_RS EXP1_07_PIN
  268. #define BTN_EN1 EXP1_03_PIN
  269. #define BTN_EN2 EXP1_05_PIN
  270. #define LCD_PINS_ENABLE EXP1_08_PIN
  271. #define LCD_PINS_D4 EXP1_06_PIN
  272. #else
  273. #define LCD_PINS_RS EXP1_04_PIN
  274. #define BTN_EN1 EXP2_03_PIN
  275. #define BTN_EN2 EXP2_05_PIN
  276. #define LCD_PINS_ENABLE EXP1_03_PIN
  277. #define LCD_PINS_D4 EXP1_05_PIN
  278. #if ENABLED(FYSETC_MINI_12864)
  279. #define DOGLCD_CS EXP1_03_PIN
  280. #define DOGLCD_A0 EXP1_04_PIN
  281. //#define LCD_BACKLIGHT_PIN -1
  282. #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
  283. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  284. #ifndef RGB_LED_R_PIN
  285. #define RGB_LED_R_PIN EXP1_06_PIN
  286. #endif
  287. #ifndef RGB_LED_G_PIN
  288. #define RGB_LED_G_PIN EXP1_07_PIN
  289. #endif
  290. #ifndef RGB_LED_B_PIN
  291. #define RGB_LED_B_PIN EXP1_08_PIN
  292. #endif
  293. #elif ENABLED(FYSETC_MINI_12864_2_1)
  294. #define NEOPIXEL_PIN EXP1_06_PIN
  295. #endif
  296. #endif // !FYSETC_MINI_12864
  297. #if IS_ULTIPANEL
  298. #define LCD_PINS_D5 EXP1_06_PIN
  299. #define LCD_PINS_D6 EXP1_07_PIN
  300. #define LCD_PINS_D7 EXP1_08_PIN
  301. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  302. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  303. #endif
  304. #endif
  305. #endif
  306. #endif // HAS_WIRED_LCD
  307. // Alter timing for graphical display
  308. #if IS_U8GLIB_ST7920
  309. #define BOARD_ST7920_DELAY_1 120
  310. #define BOARD_ST7920_DELAY_2 80
  311. #define BOARD_ST7920_DELAY_3 580
  312. #endif
  313. //
  314. // NeoPixel LED
  315. //
  316. #ifndef NEOPIXEL_PIN
  317. #define NEOPIXEL_PIN PC5
  318. #endif
  319. //
  320. // MAX31865
  321. //
  322. #if HAS_MAX31865
  323. #define TEMP_0_CS_PIN PD11
  324. #define TEMP_0_SCK_PIN PE12
  325. #define TEMP_0_MISO_PIN PE13
  326. #define TEMP_0_MOSI_PIN PE14
  327. #endif