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_ROBIN_PRO.h 6.7KB

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. /**
  24. * MKS Robin pro (STM32F103ZET6) board pin assignments
  25. */
  26. #ifndef __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_TMC220x
  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 Serial
  115. //#define X2_HARDWARE_SERIAL Serial1
  116. //#define Y_HARDWARE_SERIAL Serial1
  117. //#define Y2_HARDWARE_SERIAL Serial1
  118. //#define Z_HARDWARE_SERIAL Serial1
  119. //#define Z2_HARDWARE_SERIAL Serial1
  120. //#define E0_HARDWARE_SERIAL Serial1
  121. //#define E1_HARDWARE_SERIAL Serial1
  122. //#define E2_HARDWARE_SERIAL Serial1
  123. //#define E3_HARDWARE_SERIAL Serial1
  124. //#define E4_HARDWARE_SERIAL Serial1
  125. //
  126. // Software serial
  127. //
  128. #define X_SERIAL_TX_PIN PF7
  129. #define X_SERIAL_RX_PIN PF8
  130. #define Y_SERIAL_TX_PIN PF4
  131. #define Y_SERIAL_RX_PIN PF3
  132. #define Z_SERIAL_TX_PIN PF5
  133. #define Z_SERIAL_RX_PIN PF6
  134. #define E0_SERIAL_TX_PIN PG13
  135. #define E0_SERIAL_RX_PIN PG15
  136. #define E1_SERIAL_TX_PIN PG12
  137. #define E1_SERIAL_RX_PIN PG10
  138. #define E2_SERIAL_TX_PIN PC13
  139. #define E2_SERIAL_RX_PIN PG9
  140. #endif
  141. //
  142. // Temperature Sensors
  143. //
  144. #define TEMP_0_PIN PC1 // TH1
  145. #define TEMP_1_PIN PC2 // TH2
  146. #define TEMP_2_PIN PC3 // TH3
  147. #define TEMP_BED_PIN PC0 // TB1
  148. //
  149. // Heaters / Fans
  150. //
  151. #define HEATER_0_PIN PF10 // +HE0-
  152. #define HEATER_1_PIN PB0 // +HE1-
  153. #define HEATER_2_PIN PF9 // +HE2-
  154. #define HEATER_BED_PIN PA0 // +HOT-BED-
  155. #define FAN_PIN PB1 // +FAN-
  156. /**
  157. * Note: MKS Robin Pro board is using SPI2 interface. Make sure your stm32duino library is configured accordingly
  158. */
  159. //#define MAX6675_SS_PIN PE5 // TC1 - CS1
  160. //#define MAX6675_SS_PIN PF11 // TC2 - CS2
  161. #define POWER_LOSS_PIN PA2 // PW_DET
  162. #define PS_ON_PIN PG11 // PW_OFF
  163. #define FIL_RUNOUT_PIN PA4 // MT_DET1
  164. //#define FIL_RUNOUT_PIN PE6 // MT_DET2
  165. //#define FIL_RUNOUT_PIN PG14 // MT_DET3
  166. //
  167. // SD Card
  168. //
  169. #ifndef SDCARD_CONNECTION
  170. #define SDCARD_CONNECTION ONBOARD
  171. #endif
  172. #if SD_CONNECTION_IS(LCD)
  173. #define ENABLE_SPI2
  174. #define SD_DETECT_PIN PG3
  175. #define SCK_PIN PB13
  176. #define MISO_PIN PB14
  177. #define MOSI_PIN PB15
  178. #define SS_PIN PG6
  179. #elif SD_CONNECTION_IS(ONBOARD)
  180. #define SDIO_SUPPORT
  181. #define SD_DETECT_PIN PD12
  182. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  183. #error "No custom SD drive cable defined for this board."
  184. #endif
  185. /**
  186. * Note: MKS Robin TFT screens use various TFT controllers.
  187. * If the screen stays white, disable 'LCD_RESET_PIN'
  188. * to let the bootloader init the screen.
  189. */
  190. #if ENABLED(FSMC_GRAPHICAL_TFT)
  191. #define FSMC_CS_PIN PD7 // NE4
  192. #define FSMC_RS_PIN PD11 // A0
  193. #define LCD_RESET_PIN PF6
  194. #define NO_LCD_REINIT // Suppress LCD re-initialization
  195. #define LCD_BACKLIGHT_PIN PD13
  196. #if ENABLED(TOUCH_BUTTONS)
  197. #define TOUCH_CS_PIN PA7
  198. #else
  199. #define BEEPER_PIN PC5
  200. #define BTN_ENC PG2
  201. #define BTN_EN1 PG5
  202. #define BTN_EN2 PG4
  203. #endif
  204. #elif HAS_SPI_LCD
  205. #define BEEPER_PIN PC5
  206. #define BTN_ENC PG2
  207. #define LCD_PINS_ENABLE PG0
  208. #define LCD_PINS_RS PG1
  209. #define BTN_EN1 PG5
  210. #define BTN_EN2 PG4
  211. // MKS MINI12864 and MKS LCD12864B. If using MKS LCD12864A (Need to remove RPK2 resistor)
  212. #if ENABLED(MKS_MINI_12864)
  213. #define LCD_BACKLIGHT_PIN -1
  214. #define LCD_RESET_PIN -1
  215. #define DOGLCD_A0 PF12
  216. #define DOGLCD_CS PF15
  217. #define DOGLCD_SCK PB13
  218. #define DOGLCD_MOSI PB15
  219. #else // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
  220. #define LCD_PINS_D4 PF14
  221. #if ENABLED(ULTIPANEL)
  222. #define LCD_PINS_D5 PF15
  223. #define LCD_PINS_D6 PF12
  224. #define LCD_PINS_D7 PF13
  225. #endif
  226. #endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
  227. #endif
  228. #ifndef ST7920_DELAY_1
  229. #define ST7920_DELAY_1 DELAY_NS(125)
  230. #endif
  231. #ifndef ST7920_DELAY_2
  232. #define ST7920_DELAY_2 DELAY_NS(125)
  233. #endif
  234. #ifndef ST7920_DELAY_3
  235. #define ST7920_DELAY_3 DELAY_NS(125)
  236. #endif