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_NANO_common.h 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. /**
  24. * MKS Robin Nano board common pin assignments
  25. */
  26. #if HOTENDS > 2 || E_STEPPERS > 2
  27. #error "MKS Robin nano boards support up to 2 hotends / E steppers."
  28. #endif
  29. #ifndef USB_MOD
  30. #define BOARD_NO_NATIVE_USB
  31. #endif
  32. // Avoid conflict with TIMER_SERVO when using the STM32 HAL
  33. #define TEMP_TIMER 5
  34. //
  35. // EEPROM
  36. //
  37. #if ENABLED(SRAM_EEPROM_EMULATION)
  38. #undef NO_EEPROM_SELECTED
  39. #endif
  40. #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
  41. #define FLASH_EEPROM_EMULATION
  42. #define EEPROM_PAGE_SIZE (0x800U) // 2K
  43. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  44. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K
  45. #endif
  46. #define SPI_DEVICE 2
  47. //
  48. // Servos
  49. //
  50. #define SERVO0_PIN PA8 // Enable BLTOUCH
  51. //
  52. // Limit Switches
  53. //
  54. #define X_STOP_PIN PA15
  55. #define Z_MAX_PIN PC4
  56. #ifndef USB_MOD
  57. #define Y_STOP_PIN PA12
  58. #define Z_MIN_PIN PA11
  59. #else
  60. #define Y_STOP_PIN PB10
  61. #define Z_MIN_PIN PB11
  62. #endif
  63. //
  64. // Steppers
  65. //
  66. #define X_ENABLE_PIN PE4
  67. #define X_STEP_PIN PE3
  68. #define X_DIR_PIN PE2
  69. #define Y_ENABLE_PIN PE1
  70. #define Y_STEP_PIN PE0
  71. #define Y_DIR_PIN PB9
  72. #define Z_ENABLE_PIN PB8
  73. #define Z_STEP_PIN PB5
  74. #define Z_DIR_PIN PB4
  75. #define E0_ENABLE_PIN PB3
  76. #define E0_STEP_PIN PD6
  77. #define E0_DIR_PIN PD3
  78. #define E1_ENABLE_PIN PA3
  79. #define E1_STEP_PIN PA6
  80. #define E1_DIR_PIN PA1
  81. //
  82. // Temperature Sensors
  83. //
  84. #define TEMP_0_PIN PC1 // TH1
  85. #define TEMP_1_PIN PC2 // TH2
  86. #define TEMP_BED_PIN PC0 // TB1
  87. //
  88. // Heaters / Fans
  89. //
  90. #ifndef HEATER_0_PIN
  91. #define HEATER_0_PIN PC3
  92. #endif
  93. #ifndef FAN_PIN
  94. #define FAN_PIN PB1 // FAN
  95. #endif
  96. #ifndef HEATER_BED_PIN
  97. #define HEATER_BED_PIN PA0
  98. #endif
  99. #if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
  100. #ifndef FAN1_PIN
  101. #define FAN1_PIN PB0
  102. #endif
  103. #elif !defined(HEATER_1_PIN)
  104. #define HEATER_1_PIN PB0
  105. #endif
  106. //
  107. // Power Supply Control
  108. //
  109. #if ENABLED(MKS_PWC)
  110. #if ENABLED(TFT_LVGL_UI)
  111. #if ENABLED(PSU_CONTROL)
  112. #error "PSU_CONTROL is incompatible with MKS_PWC plus TFT_LVGL_UI."
  113. #endif
  114. #undef MKS_PWC
  115. #define SUICIDE_PIN PB2
  116. #define SUICIDE_PIN_STATE LOW
  117. #else
  118. #define PS_ON_PIN PB2 // PW_OFF
  119. #endif
  120. #define KILL_PIN PA2
  121. #define KILL_PIN_STATE HIGH
  122. #endif
  123. //
  124. // Misc. Functions
  125. //
  126. #if HAS_TFT_LVGL_UI
  127. #define MT_DET_1_PIN PA4
  128. #define MT_DET_2_PIN PE6
  129. #define MT_DET_PIN_STATE LOW
  130. #define WIFI_IO0_PIN PC13
  131. #define WIFI_IO1_PIN PC7
  132. #define WIFI_RESET_PIN PA5
  133. #else
  134. //#define POWER_LOSS_PIN PA2 // PW_DET
  135. //#define PS_ON_PIN PB2 // PW_OFF
  136. #define FIL_RUNOUT_PIN PA4
  137. #define FIL_RUNOUT2_PIN PE6
  138. #endif
  139. //
  140. // SD Card
  141. //
  142. #ifndef SDCARD_CONNECTION
  143. #define SDCARD_CONNECTION ONBOARD
  144. #endif
  145. #define SDIO_SUPPORT
  146. #define SDIO_CLOCK 4500000 // 4.5 MHz
  147. #define SD_DETECT_PIN PD12
  148. #define ONBOARD_SD_CS_PIN PC11
  149. //
  150. // LCD / Controller
  151. //
  152. #define BEEPER_PIN PC5
  153. //
  154. // TFT with FSMC interface
  155. //
  156. #if HAS_FSMC_TFT
  157. /**
  158. * Note: MKS Robin TFT screens use various TFT controllers.
  159. * If the screen stays white, disable 'TFT_RESET_PIN'
  160. * to let the bootloader init the screen.
  161. */
  162. #define TFT_RESET_PIN PC6 // FSMC_RST
  163. #define TFT_BACKLIGHT_PIN PD13
  164. #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
  165. #define DOGLCD_SCK -1
  166. #define TOUCH_CS_PIN PA7 // SPI2_NSS
  167. #define TOUCH_SCK_PIN PB13 // SPI2_SCK
  168. #define TOUCH_MISO_PIN PB14 // SPI2_MISO
  169. #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
  170. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  171. #define FSMC_CS_PIN PD7
  172. #define FSMC_RS_PIN PD11
  173. #define FSMC_DMA_DEV DMA2
  174. #define FSMC_DMA_CHANNEL DMA_CH5
  175. #define TFT_CS_PIN FSMC_CS_PIN
  176. #define TFT_RS_PIN FSMC_RS_PIN
  177. #define TOUCH_BUTTONS_HW_SPI
  178. #define TOUCH_BUTTONS_HW_SPI_DEVICE 2
  179. #define TFT_BUFFER_SIZE 14400
  180. #endif
  181. #define HAS_SPI_FLASH 1
  182. #if HAS_SPI_FLASH
  183. #define SPI_FLASH_SIZE 0x1000000 // 16MB
  184. #define SPI_FLASH_CS_PIN PB12
  185. #define SPI_FLASH_MOSI_PIN PB15
  186. #define SPI_FLASH_MISO_PIN PB14
  187. #define SPI_FLASH_SCK_PIN PB13
  188. #endif