My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

pins_MKS_MONSTER8.h 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2021 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. #define ALLOW_STM32DUINO
  24. #include "env_validate.h"
  25. #if HOTENDS > 3 || E_STEPPERS > 5
  26. #error "MKS Monster supports up to 3 hotends and 5 E steppers."
  27. #elif HAS_FSMC_TFT
  28. #error "MKS Monster doesn't support FSMC-based TFT displays."
  29. #endif
  30. #define BOARD_INFO_NAME "MKS Monster8 V1.x"
  31. #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support
  32. #define USES_DIAG_JUMPERS
  33. //#define DISABLE_DEBUG
  34. // Avoid conflict with TIMER_TONE
  35. #define STEP_TIMER 10
  36. // Use one of these or SDCard-based Emulation will be used
  37. //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation
  38. //#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation
  39. #define I2C_EEPROM // Need use jumpers set i2c for EEPROM
  40. #define MARLIN_EEPROM_SIZE 0x1000 // 4K
  41. #define I2C_SCL_PIN PB8 // I2C_SCL and CAN_RX
  42. #define I2C_SDA_PIN PB9 // I2C_SDA and CAN_TX
  43. //
  44. // Servos
  45. //
  46. #define SERVO0_PIN PA8 // Enable BLTOUCH
  47. //
  48. // Limit Switches for diag signal
  49. //
  50. #define X_DIAG_PIN PA14 // Driver0 diag signal is connect to X-
  51. #define Y_DIAG_PIN PA15 // Driver1 diag signal is connect to Y-
  52. #define Z_DIAG_PIN PB13 // Driver2 diag signal is connect to Z-
  53. #define E0_DIAG_PIN PA13 // Driver3 diag signal is connect to X+
  54. #define E1_DIAG_PIN PC5 // Driver4 diag signal is connect to Y+
  55. #define E2_DIAG_PIN PB12 // Driver5 diag signal is connect to Z+
  56. #define E3_DIAG_PIN -1 // Driver6 diag signal is not connect
  57. #define E4_DIAG_PIN -1 // Driver7 diag signal is not connect
  58. // Limit Switches for endstop
  59. #define X_MIN_PIN PA14
  60. #define X_MAX_PIN PA13
  61. #define Y_MIN_PIN PA15
  62. #define Y_MAX_PIN PC5
  63. #define Z_MIN_PIN PB13
  64. #define Z_MAX_PIN PB12
  65. //
  66. // Steppers
  67. // Driver 0 1 2 3 4 5 6 7
  68. // For X Y Z E0 E1 E2 E3 E4(default pin settings)
  69. //
  70. //Driver0
  71. #define X_ENABLE_PIN PC15
  72. #define X_STEP_PIN PC14
  73. #define X_DIR_PIN PC13
  74. #ifndef X_CS_PIN
  75. #define X_CS_PIN PE6
  76. #endif
  77. //Driver1
  78. #define Y_ENABLE_PIN PC15
  79. #define Y_STEP_PIN PE5
  80. #define Y_DIR_PIN PE4
  81. #ifndef Y_CS_PIN
  82. #define Y_CS_PIN PE3
  83. #endif
  84. //Driver2
  85. #define Z_ENABLE_PIN PE2
  86. #define Z_STEP_PIN PE1
  87. #define Z_DIR_PIN PE0
  88. #ifndef Z_CS_PIN
  89. #define Z_CS_PIN PB7
  90. #endif
  91. //Driver3
  92. #define E0_ENABLE_PIN PB6
  93. #define E0_STEP_PIN PB5
  94. #define E0_DIR_PIN PB4
  95. #ifndef E0_CS_PIN
  96. #define E0_CS_PIN PB3
  97. #endif
  98. //Driver4
  99. #define E1_ENABLE_PIN PD7
  100. #define E1_STEP_PIN PD6
  101. #define E1_DIR_PIN PD5
  102. #ifndef E1_CS_PIN
  103. #define E1_CS_PIN PD4
  104. #endif
  105. //Driver5
  106. #define E2_ENABLE_PIN PD3
  107. #define E2_STEP_PIN PD2
  108. #define E2_DIR_PIN PD1
  109. #ifndef E2_CS_PIN
  110. #define E2_CS_PIN PD0
  111. #endif
  112. //Driver6
  113. #define E3_ENABLE_PIN PC8
  114. #define E3_STEP_PIN PC7
  115. #define E3_DIR_PIN PC6
  116. #ifndef E3_CS_PIN
  117. #define E3_CS_PIN PD15
  118. #endif
  119. //Driver7
  120. #define E4_ENABLE_PIN PD14
  121. #define E4_STEP_PIN PD13
  122. #define E4_DIR_PIN PD12
  123. #ifndef E4_CS_PIN
  124. #define E4_CS_PIN PD11
  125. #endif
  126. //
  127. // Software SPI pins for TMC2130 stepper drivers
  128. // This board only supports SW SPI for stepper drivers
  129. //
  130. #if HAS_TMC_SPI
  131. #define TMC_USE_SW_SPI
  132. #endif
  133. #if ENABLED(TMC_USE_SW_SPI)
  134. #if !defined(TMC_SW_MOSI) || TMC_SW_MOSI == -1
  135. #define TMC_SW_MOSI PE14
  136. #endif
  137. #if !defined(TMC_SW_MISO) || TMC_SW_MISO == -1
  138. #define TMC_SW_MISO PE13
  139. #endif
  140. #if !defined(TMC_SW_SCK) || TMC_SW_SCK == -1
  141. #define TMC_SW_SCK PE12
  142. #endif
  143. #endif
  144. #if HAS_TMC_UART
  145. //
  146. // Software serial
  147. // No Hardware serial for steppers
  148. //
  149. #define X_SERIAL_TX_PIN PE6
  150. #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
  151. #define Y_SERIAL_TX_PIN PE3
  152. #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
  153. #define Z_SERIAL_TX_PIN PB7
  154. #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
  155. #define E0_SERIAL_TX_PIN PB3
  156. #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
  157. #define E1_SERIAL_TX_PIN PD4
  158. #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
  159. #define E2_SERIAL_TX_PIN PD0
  160. #define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
  161. #define E3_SERIAL_TX_PIN PD15
  162. #define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
  163. #define E4_SERIAL_TX_PIN PD11
  164. #define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN
  165. // Reduce baud rate to improve software serial reliability
  166. #define TMC_BAUD_RATE 19200
  167. #endif
  168. //
  169. // Temperature Sensors
  170. //
  171. #define TEMP_0_PIN PC1 // TH0
  172. #define TEMP_1_PIN PC2 // TH1
  173. #define TEMP_2_PIN PC3 // TH2
  174. #define TEMP_BED_PIN PC0 // TB
  175. //
  176. // Heaters / Fans
  177. //
  178. #define HEATER_0_PIN PB1 // HE0
  179. #define HEATER_1_PIN PB0 // HE1
  180. #define HEATER_2_PIN PA3 // HE2
  181. #define HEATER_BED_PIN PB10 // H-BED
  182. #define FAN_PIN PA2 // FAN0
  183. #define FAN1_PIN PA1 // FAN1
  184. #define FAN2_PIN PA0 // FAN2
  185. //
  186. // Misc. Functions
  187. //
  188. #define PW_DET PC5 // Y+
  189. #define PW_OFF PB12 // Z+
  190. #define MT_DET_1_PIN PW_DET
  191. #define MT_DET_2_PIN PW_OFF
  192. #ifndef FIL_RUNOUT_PIN
  193. #define FIL_RUNOUT_PIN MT_DET_1_PIN
  194. #endif
  195. #ifndef FIL_RUNOUT2_PIN
  196. #define FIL_RUNOUT2_PIN MT_DET_2_PIN
  197. #endif
  198. //
  199. // Power Supply Control
  200. //
  201. #if ENABLED(MKS_PWC)
  202. #define PS_ON_PIN PW_OFF
  203. #define KILL_PIN PW_DET
  204. #define KILL_PIN_STATE HIGH
  205. #endif
  206. // Random Info
  207. #define USB_SERIAL -1 // USB Serial
  208. /**
  209. * ------ ------
  210. * (BEEPER) PB2 |10 9 | PE10 (BTN_ENC) (SPI1 MISO) PA6 |10 9 | PA5 (SPI1 SCK)
  211. * (LCD_EN) PE11 | 8 7 | PD10 (LCD_RS) (BTN_EN1) PE9 | 8 7 | PA4 (SPI1 CS)
  212. * (LCD_D4) PD9 6 5 | PD8 (LCD_D5) (BTN_EN2) PE8 6 5 | PA7 (SPI1 MOSI)
  213. * (LCD_D6) PE15 | 4 3 | PE7 (LCD_D7) (SPI1_RS) PB11 | 4 3 | RESET
  214. * GND | 2 1 | 5V GND | 2 1 | 3.3V
  215. * ------ ------
  216. * EXP1 EXP2
  217. */
  218. #define EXP1_03_PIN PE7
  219. #define EXP1_04_PIN PE15
  220. #define EXP1_05_PIN PD8
  221. #define EXP1_06_PIN PD9
  222. #define EXP1_07_PIN PD10
  223. #define EXP1_08_PIN PE11
  224. #define EXP1_09_PIN PE10
  225. #define EXP1_10_PIN PB2
  226. #define EXP2_03_PIN -1 // RESET
  227. #define EXP2_04_PIN PB11
  228. #define EXP2_05_PIN PA7
  229. #define EXP2_06_PIN PE8
  230. #define EXP2_07_PIN PA4
  231. #define EXP2_08_PIN PE9
  232. #define EXP2_09_PIN PA5
  233. #define EXP2_10_PIN PA6
  234. #if ENABLED(SDSUPPORT)
  235. #ifndef SDCARD_CONNECTION
  236. #define SDCARD_CONNECTION ONBOARD
  237. #endif
  238. #if SD_CONNECTION_IS(ONBOARD)
  239. #define ENABLE_SPI3
  240. #define SD_SS_PIN -1
  241. #define SDSS PC9
  242. #define SD_SCK_PIN PC10
  243. #define SD_MISO_PIN PC11
  244. #define SD_MOSI_PIN PC12
  245. #define SD_DETECT_PIN PC4 // SD_DETECT_PIN doesn't work with NO_SD_HOST_DRIVE disabled
  246. #elif SD_CONNECTION_IS(LCD)
  247. #define ENABLE_SPI1
  248. #define SDSS EXP2_07_PIN
  249. #define SD_SCK_PIN EXP2_09_PIN
  250. #define SD_MISO_PIN EXP2_10_PIN
  251. #define SD_MOSI_PIN EXP2_05_PIN
  252. #define SD_DETECT_PIN EXP2_04_PIN
  253. #endif
  254. #endif
  255. #if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI)
  256. #define TFT_CS_PIN EXP1_04_PIN
  257. #define TFT_SCK_PIN EXP2_09_PIN
  258. #define TFT_MISO_PIN EXP2_10_PIN
  259. #define TFT_MOSI_PIN EXP2_05_PIN
  260. #define TFT_DC_PIN EXP1_03_PIN
  261. #define TFT_A0_PIN TFT_DC_PIN
  262. #define TFT_RESET_PIN EXP1_07_PIN
  263. #define LCD_BACKLIGHT_PIN EXP1_08_PIN
  264. #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN
  265. #define TOUCH_BUTTONS_HW_SPI
  266. #define TOUCH_BUTTONS_HW_SPI_DEVICE 1
  267. #ifndef TFT_WIDTH
  268. #define TFT_WIDTH 480
  269. #endif
  270. #ifndef TFT_HEIGHT
  271. #define TFT_HEIGHT 320
  272. #endif
  273. #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS
  274. #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK
  275. #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO
  276. #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI
  277. #define LCD_READ_ID 0xD3
  278. #define LCD_USE_DMA_SPI
  279. #define TFT_BUFFER_SIZE 14400
  280. #ifndef TOUCH_CALIBRATION_X
  281. #define TOUCH_CALIBRATION_X -17253
  282. #endif
  283. #ifndef TOUCH_CALIBRATION_Y
  284. #define TOUCH_CALIBRATION_Y 11579
  285. #endif
  286. #ifndef TOUCH_OFFSET_X
  287. #define TOUCH_OFFSET_X 514
  288. #endif
  289. #ifndef TOUCH_OFFSET_Y
  290. #define TOUCH_OFFSET_Y -24
  291. #endif
  292. #ifndef TOUCH_ORIENTATION
  293. #define TOUCH_ORIENTATION TOUCH_LANDSCAPE
  294. #endif
  295. #elif HAS_WIRED_LCD
  296. #define LCD_PINS_ENABLE EXP1_08_PIN
  297. #define LCD_PINS_RS EXP1_07_PIN
  298. #define LCD_BACKLIGHT_PIN -1
  299. // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
  300. #if ENABLED(MKS_MINI_12864)
  301. #define ENABLE_SPI1
  302. #define FORCE_SOFT_SPI
  303. #define DOGLCD_A0 EXP1_04_PIN
  304. #define DOGLCD_CS EXP1_05_PIN
  305. #define DOGLCD_SCK EXP2_09_PIN
  306. #define DOGLCD_MOSI EXP2_05_PIN
  307. //#define LCD_BACKLIGHT_PIN -1
  308. //#define LCD_RESET_PIN -1
  309. #elif ENABLED(FYSETC_MINI_12864_2_1)
  310. #define LCD_PINS_DC EXP1_07_PIN
  311. #define DOGLCD_CS EXP1_08_PIN
  312. #define DOGLCD_A0 LCD_PINS_DC
  313. #define LCD_BACKLIGHT_PIN -1
  314. #define LCD_RESET_PIN EXP1_06_PIN
  315. #define NEOPIXEL_PIN EXP1_05_PIN
  316. #define DOGLCD_MOSI EXP2_05_PIN
  317. #define DOGLCD_SCK EXP2_09_PIN
  318. #if SD_CONNECTION_IS(ONBOARD)
  319. #define FORCE_SOFT_SPI
  320. #endif
  321. //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
  322. #else
  323. #define LCD_PINS_D4 EXP1_06_PIN
  324. #if ENABLED(ULTIPANEL)
  325. #define LCD_PINS_D5 EXP1_05_PIN
  326. #define LCD_PINS_D6 EXP1_04_PIN
  327. #define LCD_PINS_D7 EXP1_03_PIN
  328. #endif
  329. #define BOARD_ST7920_DELAY_1 96
  330. #define BOARD_ST7920_DELAY_2 48
  331. #define BOARD_ST7920_DELAY_3 600
  332. #endif // !MKS_MINI_12864
  333. #endif // HAS_WIRED_LCD
  334. #if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD)
  335. #define BEEPER_PIN EXP1_10_PIN
  336. #define BTN_EN1 EXP2_08_PIN
  337. #define BTN_EN2 EXP2_06_PIN
  338. #define BTN_ENC EXP1_09_PIN
  339. #endif