My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

pins_MKS_ROBIN_NANO.h 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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 nano (STM32F130VET6) board pin assignments
  25. */
  26. #if !defined(STM32F1) && !defined(STM32F1xx)
  27. #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
  28. #elif HOTENDS > 2 || E_STEPPERS > 2
  29. #error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue."
  30. #endif
  31. #define BOARD_INFO_NAME "MKS Robin Nano"
  32. //
  33. // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
  34. //
  35. #define DISABLE_JTAG
  36. //
  37. // EEPROM
  38. //
  39. #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
  40. #define FLASH_EEPROM_EMULATION
  41. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  42. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  43. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
  44. #endif
  45. #define ENABLE_SPI2
  46. //
  47. // Limit Switches
  48. //
  49. #define X_STOP_PIN PA15
  50. #define Y_STOP_PIN PA12
  51. #define Z_MIN_PIN PA11
  52. #define Z_MAX_PIN PC4
  53. #ifndef FIL_RUNOUT_PIN
  54. #define FIL_RUNOUT_PIN PA4 // MT_DET
  55. #endif
  56. //
  57. // Steppers
  58. //
  59. #define X_ENABLE_PIN PE4
  60. #define X_STEP_PIN PE3
  61. #define X_DIR_PIN PE2
  62. #define Y_ENABLE_PIN PE1
  63. #define Y_STEP_PIN PE0
  64. #define Y_DIR_PIN PB9
  65. #define Z_ENABLE_PIN PB8
  66. #define Z_STEP_PIN PB5
  67. #define Z_DIR_PIN PB4
  68. #define E0_ENABLE_PIN PB3
  69. #define E0_STEP_PIN PD6
  70. #define E0_DIR_PIN PD3
  71. #define E1_ENABLE_PIN PA3
  72. #define E1_STEP_PIN PA6
  73. #define E1_DIR_PIN PA1
  74. //
  75. // Temperature Sensors
  76. //
  77. #define TEMP_0_PIN PC1 // TH1
  78. #define TEMP_1_PIN PC2 // TH2
  79. #define TEMP_BED_PIN PC0 // TB1
  80. //
  81. // Heaters / Fans
  82. //
  83. #ifndef HEATER_0_PIN
  84. #define HEATER_0_PIN PC3
  85. #endif
  86. #if HOTENDS == 1
  87. #ifndef FAN1_PIN
  88. #define FAN1_PIN PB0
  89. #endif
  90. #else
  91. #ifndef HEATER_1_PIN
  92. #define HEATER_1_PIN PB0
  93. #endif
  94. #endif
  95. #ifndef FAN_PIN
  96. #define FAN_PIN PB1 // FAN
  97. #endif
  98. #ifndef HEATER_BED_PIN
  99. #define HEATER_BED_PIN PA0
  100. #endif
  101. //
  102. // Thermocouples
  103. //
  104. //#define MAX6675_SS_PIN PE5 // TC1 - CS1
  105. //#define MAX6675_SS_PIN PE6 // TC2 - CS2
  106. //
  107. // Misc. Functions
  108. //
  109. #define POWER_LOSS_PIN PA2 // PW_DET
  110. #define PS_ON_PIN PA3 // PW_OFF
  111. //#define SUICIDE_PIN PB2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY
  112. //#define SUICIDE_PIN_INVERTING false
  113. //#define KILL_PIN PA2 // Enable MKSPWC support ROBIN NANO v1.2 ONLY
  114. //#define KILL_PIN_INVERTING true // Enable MKSPWC support ROBIN NANO v1.2 ONLY
  115. #define SERVO0_PIN PA8 // Enable BLTOUCH support ROBIN NANO v1.2 ONLY
  116. //#define LED_PIN PB2
  117. #define MT_DET_1_PIN PA4
  118. #define MT_DET_2_PIN PE6
  119. #define MT_DET_PIN_INVERTING false
  120. #define WIFI_IO0_PIN PC13
  121. //
  122. // SD Card
  123. //
  124. #ifndef SDCARD_CONNECTION
  125. #define SDCARD_CONNECTION ONBOARD
  126. #endif
  127. #define SDIO_SUPPORT
  128. #define SDIO_CLOCK 4500000 // 4.5 MHz
  129. #define SD_DETECT_PIN PD12
  130. #define ONBOARD_SD_CS_PIN PC11
  131. //
  132. // LCD / Controller
  133. //
  134. #define BEEPER_PIN PC5
  135. /**
  136. * Note: MKS Robin TFT screens use various TFT controllers.
  137. * If the screen stays white, disable 'LCD_RESET_PIN'
  138. * to let the bootloader init the screen.
  139. */
  140. // Shared FSMC Configs
  141. #if HAS_FSMC_TFT
  142. #define FSMC_CS_PIN PD7 // NE4
  143. #define FSMC_RS_PIN PD11 // A0
  144. #define TOUCH_CS_PIN PA7 // SPI2_NSS
  145. #define TOUCH_SCK_PIN PB13 // SPI2_SCK
  146. #define TOUCH_MISO_PIN PB14 // SPI2_MISO
  147. #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
  148. #define LCD_RESET_PIN PC6 // FSMC_RST
  149. #define LCD_BACKLIGHT_PIN PD13
  150. #define TFT_RESET_PIN PC6 // FSMC_RST
  151. #define TFT_BACKLIGHT_PIN PD13
  152. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  153. #define FSMC_CS_PIN PD7
  154. #define FSMC_RS_PIN PD11
  155. #define FSMC_DMA_DEV DMA2
  156. #define FSMC_DMA_CHANNEL DMA_CH5
  157. #define TOUCH_BUTTONS_HW_SPI
  158. #define TOUCH_BUTTONS_HW_SPI_DEVICE 2
  159. #endif
  160. // LVGL Configs
  161. #if ENABLED(TFT_LVGL_UI_FSMC)
  162. #ifndef XPT2046_X_CALIBRATION
  163. #define XPT2046_X_CALIBRATION 17880
  164. #endif
  165. #ifndef XPT2046_Y_CALIBRATION
  166. #define XPT2046_Y_CALIBRATION -12234
  167. #endif
  168. #ifndef XPT2046_X_OFFSET
  169. #define XPT2046_X_OFFSET -45
  170. #endif
  171. #ifndef XPT2046_Y_OFFSET
  172. #define XPT2046_Y_OFFSET 349
  173. #endif
  174. // Emulated DOGM Configs
  175. #elif ENABLED(FSMC_GRAPHICAL_TFT)
  176. #define DOGLCD_MOSI -1 // prevent redefine Conditionals_post.h
  177. #define DOGLCD_SCK -1
  178. #ifndef GRAPHICAL_TFT_UPSCALE
  179. #define GRAPHICAL_TFT_UPSCALE 3
  180. #endif
  181. #ifndef TFT_WIDTH
  182. #define TFT_WIDTH 480
  183. #endif
  184. #ifndef TFT_PIXEL_OFFSET_X
  185. #define TFT_PIXEL_OFFSET_X 48
  186. #endif
  187. #ifndef TFT_HEIGHT
  188. #define TFT_HEIGHT 320
  189. #endif
  190. #ifndef TFT_PIXEL_OFFSET_Y
  191. #define TFT_PIXEL_OFFSET_Y 32
  192. #endif
  193. #ifndef XPT2046_X_CALIBRATION
  194. #define XPT2046_X_CALIBRATION 12149
  195. #endif
  196. #ifndef XPT2046_Y_CALIBRATION
  197. #define XPT2046_Y_CALIBRATION -8746
  198. #endif
  199. #ifndef XPT2046_X_OFFSET
  200. #define XPT2046_X_OFFSET -35
  201. #endif
  202. #ifndef XPT2046_Y_OFFSET
  203. #define XPT2046_Y_OFFSET 256
  204. #endif
  205. #elif ENABLED(TFT_320x240) // TFT32/28
  206. #define TFT_RESET_PIN PC6
  207. #define TFT_BACKLIGHT_PIN PD13
  208. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  209. #define FSMC_CS_PIN PD7
  210. #define FSMC_RS_PIN PD11
  211. #define FSMC_DMA_DEV DMA2
  212. #define FSMC_DMA_CHANNEL DMA_CH5
  213. #ifndef XPT2046_X_CALIBRATION
  214. #define XPT2046_X_CALIBRATION -12246
  215. #endif
  216. #ifndef XPT2046_Y_CALIBRATION
  217. #define XPT2046_Y_CALIBRATION 9453
  218. #endif
  219. #ifndef XPT2046_X_OFFSET
  220. #define XPT2046_X_OFFSET 360
  221. #endif
  222. #ifndef XPT2046_Y_OFFSET
  223. #define XPT2046_Y_OFFSET -22
  224. #endif
  225. #define TOUCH_CS_PIN PA7 // SPI2_NSS
  226. #define TOUCH_SCK_PIN PB13 // SPI2_SCK
  227. #define TOUCH_MISO_PIN PB14 // SPI2_MISO
  228. #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
  229. #define TFT_DRIVER ILI9341
  230. #define TFT_BUFFER_SIZE 14400
  231. // YV for normal screen mounting
  232. //#define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV
  233. // XV for 180° rotated screen mounting
  234. #define ILI9341_ORIENTATION ILI9341_MADCTL_MX | ILI9341_MADCTL_MV
  235. #define ILI9341_COLOR_RGB
  236. #elif ENABLED(TFT_480x320)
  237. #ifndef XPT2046_X_CALIBRATION
  238. #define XPT2046_X_CALIBRATION 17880
  239. #endif
  240. #ifndef XPT2046_Y_CALIBRATION
  241. #define XPT2046_Y_CALIBRATION -12234
  242. #endif
  243. #ifndef XPT2046_X_OFFSET
  244. #define XPT2046_X_OFFSET -45
  245. #endif
  246. #ifndef XPT2046_Y_OFFSET
  247. #define XPT2046_Y_OFFSET 349
  248. #endif
  249. #define TFT_DRIVER ILI9488
  250. #define TFT_BUFFER_SIZE 14400
  251. #define ILI9488_ORIENTATION ILI9488_MADCTL_MX | ILI9488_MADCTL_MV
  252. #endif
  253. #define HAS_SPI_FLASH 1
  254. #define SPI_FLASH_SIZE 0x1000000 // 16MB
  255. #if HAS_SPI_FLASH
  256. #define W25QXX_CS_PIN PB12
  257. #define W25QXX_MOSI_PIN PB15
  258. #define W25QXX_MISO_PIN PB14
  259. #define W25QXX_SCK_PIN PB13
  260. #endif