My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

pins_MKS_ROBIN_PRO.h 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * MKS Robin pro (STM32F103ZET6) board pin assignments
  25. */
  26. #if NOT_TARGET(__STM32F1__)
  27. #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
  28. #elif HOTENDS > 3 || E_STEPPERS > 3
  29. #error "MKS Robin pro supports up to 3 hotends / E-steppers. Comment out this line to continue."
  30. #endif
  31. #define BOARD_INFO_NAME "MKS Robin pro"
  32. //
  33. // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
  34. //
  35. #define DISABLE_DEBUG
  36. //
  37. // Note: MKS Robin board is using SPI2 interface.
  38. //
  39. //#define SPI_MODULE 2
  40. #define ENABLE_SPI2
  41. //
  42. // Servos
  43. //
  44. #define SERVO0_PIN PA8 // BLTOUCH
  45. //
  46. // Limit Switches
  47. //
  48. #define X_MIN_PIN PA15
  49. #define X_MAX_PIN PG7
  50. #define Y_MIN_PIN PA12
  51. #define Y_MAX_PIN PG8
  52. #define Z_MIN_PIN PA11
  53. #define Z_MAX_PIN PC4
  54. //
  55. // Steppers
  56. //
  57. #define X_ENABLE_PIN PE4
  58. #define X_STEP_PIN PE3
  59. #define X_DIR_PIN PE2
  60. #ifndef X_CS_PIN
  61. #define X_CS_PIN PF8
  62. #endif
  63. #define Y_ENABLE_PIN PE1
  64. #define Y_STEP_PIN PE0
  65. #define Y_DIR_PIN PB9
  66. #ifndef Y_CS_PIN
  67. #define Y_CS_PIN PF3
  68. #endif
  69. #define Z_ENABLE_PIN PB8
  70. #define Z_STEP_PIN PB5
  71. #define Z_DIR_PIN PB4
  72. #ifndef Z_CS_PIN
  73. #define Z_CS_PIN PF6
  74. #endif
  75. #define E0_ENABLE_PIN PB3
  76. #define E0_STEP_PIN PD6
  77. #define E0_DIR_PIN PD3
  78. #ifndef E0_CS_PIN
  79. #define E0_CS_PIN PG15
  80. #endif
  81. #define E1_ENABLE_PIN PA3
  82. #define E1_STEP_PIN PA6
  83. #define E1_DIR_PIN PA1
  84. #ifndef E1_CS_PIN
  85. #define E1_CS_PIN PG10
  86. #endif
  87. #define E2_ENABLE_PIN PF0
  88. #define E2_STEP_PIN PF2
  89. #define E2_DIR_PIN PF1
  90. #ifndef E2_CS_PIN
  91. #define E2_CS_PIN PG9
  92. #endif
  93. //
  94. // Software SPI pins for TMC2130 stepper drivers
  95. //
  96. #if ENABLED(TMC_USE_SW_SPI)
  97. #ifndef TMC_SW_MOSI
  98. #define TMC_SW_MOSI PB15
  99. #endif
  100. #ifndef TMC_SW_MISO
  101. #define TMC_SW_MISO PB14
  102. #endif
  103. #ifndef TMC_SW_SCK
  104. #define TMC_SW_SCK PB13
  105. #endif
  106. #endif
  107. #if HAS_TMC_UART
  108. /**
  109. * TMC2208/TMC2209 stepper drivers
  110. *
  111. * Hardware serial communication ports.
  112. * If undefined software serial is used according to the pins below
  113. */
  114. //#define X_HARDWARE_SERIAL MSerial1
  115. //#define Y_HARDWARE_SERIAL MSerial1
  116. //#define Z_HARDWARE_SERIAL MSerial1
  117. //#define E0_HARDWARE_SERIAL MSerial1
  118. //#define E1_HARDWARE_SERIAL MSerial1
  119. //#define E2_HARDWARE_SERIAL MSerial1
  120. //
  121. // Software serial
  122. //
  123. #define X_SERIAL_TX_PIN PF7
  124. #define X_SERIAL_RX_PIN PF8
  125. #define Y_SERIAL_TX_PIN PF4
  126. #define Y_SERIAL_RX_PIN PF3
  127. #define Z_SERIAL_TX_PIN PF5
  128. #define Z_SERIAL_RX_PIN PF6
  129. #define E0_SERIAL_TX_PIN PG13
  130. #define E0_SERIAL_RX_PIN PG15
  131. #define E1_SERIAL_TX_PIN PG12
  132. #define E1_SERIAL_RX_PIN PG10
  133. #define E2_SERIAL_TX_PIN PC13
  134. #define E2_SERIAL_RX_PIN PG9
  135. #endif
  136. //
  137. // Temperature Sensors
  138. //
  139. #define TEMP_0_PIN PC1 // TH1
  140. #define TEMP_1_PIN PC2 // TH2
  141. #define TEMP_2_PIN PC3 // TH3
  142. #define TEMP_BED_PIN PC0 // TB1
  143. //
  144. // Heaters / Fans
  145. //
  146. #define HEATER_0_PIN PF10 // +HE0-
  147. #define HEATER_1_PIN PB0 // +HE1-
  148. #define HEATER_2_PIN PF9 // +HE2-
  149. #define HEATER_BED_PIN PA0 // +HOT-BED-
  150. #define FAN_PIN PB1 // +FAN-
  151. /**
  152. * Note: MKS Robin Pro board is using SPI2 interface. Make sure your stm32duino library is configured accordingly
  153. */
  154. //#define MAX6675_SS_PIN PE5 // TC1 - CS1
  155. //#define MAX6675_SS_PIN PF11 // TC2 - CS2
  156. #define POWER_LOSS_PIN PA2 // PW_DET
  157. #define PS_ON_PIN PG11 // PW_OFF
  158. #define FIL_RUNOUT_PIN PA4 // MT_DET1
  159. //#define FIL_RUNOUT_PIN PE6 // MT_DET2
  160. //#define FIL_RUNOUT_PIN PG14 // MT_DET3
  161. //
  162. // SD Card
  163. //
  164. #ifndef SDCARD_CONNECTION
  165. #define SDCARD_CONNECTION ONBOARD
  166. #endif
  167. #if SD_CONNECTION_IS(LCD)
  168. #define ENABLE_SPI2
  169. #define SD_DETECT_PIN PG3
  170. #define SCK_PIN PB13
  171. #define MISO_PIN PB14
  172. #define MOSI_PIN PB15
  173. #define SS_PIN PG6
  174. #elif SD_CONNECTION_IS(ONBOARD)
  175. #define SDIO_SUPPORT
  176. #define SD_DETECT_PIN PD12
  177. #define ONBOARD_SD_CS_PIN PC11
  178. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  179. #error "No custom SD drive cable defined for this board."
  180. #endif
  181. /**
  182. * Note: MKS Robin TFT screens use various TFT controllers.
  183. * If the screen stays white, disable 'LCD_RESET_PIN'
  184. * to let the bootloader init the screen.
  185. */
  186. #if ENABLED(FSMC_GRAPHICAL_TFT)
  187. #define FSMC_CS_PIN PD7 // NE4
  188. #define FSMC_RS_PIN PD11 // A0
  189. #define LCD_RESET_PIN PF6
  190. #define LCD_BACKLIGHT_PIN PD13
  191. #if NEED_TOUCH_PINS
  192. #define TOUCH_CS_PIN PA7
  193. #else
  194. #define BEEPER_PIN PC5
  195. #define BTN_ENC PG2
  196. #define BTN_EN1 PG5
  197. #define BTN_EN2 PG4
  198. #endif
  199. #elif IS_TFTGLCD_PANEL
  200. #if ENABLED(TFTGLCD_PANEL_SPI)
  201. #define TFTGLCD_CS PG5
  202. #endif
  203. #elif HAS_WIRED_LCD
  204. #define BEEPER_PIN PC5
  205. #define BTN_ENC PG2
  206. #define LCD_PINS_ENABLE PG0
  207. #define LCD_PINS_RS PG1
  208. #define BTN_EN1 PG5
  209. #define BTN_EN2 PG4
  210. // MKS MINI12864 and MKS LCD12864B. If using MKS LCD12864A (Need to remove RPK2 resistor)
  211. #if ENABLED(MKS_MINI_12864)
  212. #define LCD_BACKLIGHT_PIN -1
  213. #define LCD_RESET_PIN -1
  214. #define DOGLCD_A0 PF12
  215. #define DOGLCD_CS PF15
  216. #define DOGLCD_SCK PB13
  217. #define DOGLCD_MOSI PB15
  218. #else // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
  219. #define LCD_PINS_D4 PF14
  220. #if ENABLED(ULTIPANEL)
  221. #define LCD_PINS_D5 PF15
  222. #define LCD_PINS_D6 PF12
  223. #define LCD_PINS_D7 PF13
  224. #endif
  225. #endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
  226. #endif
  227. #ifndef BOARD_ST7920_DELAY_1
  228. #define BOARD_ST7920_DELAY_1 DELAY_NS(125)
  229. #endif
  230. #ifndef BOARD_ST7920_DELAY_2
  231. #define BOARD_ST7920_DELAY_2 DELAY_NS(125)
  232. #endif
  233. #ifndef BOARD_ST7920_DELAY_3
  234. #define BOARD_ST7920_DELAY_3 DELAY_NS(125)
  235. #endif