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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. #define BOARD_NO_NATIVE_USB
  30. // Avoid conflict with TIMER_SERVO when using the STM32 HAL
  31. #define TEMP_TIMER 5
  32. //
  33. // EEPROM
  34. //
  35. #if ENABLED(SRAM_EEPROM_EMULATION)
  36. #undef NO_EEPROM_SELECTED
  37. #endif
  38. #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
  39. #define FLASH_EEPROM_EMULATION
  40. #define EEPROM_PAGE_SIZE (0x800U) // 2K
  41. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  42. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K
  43. #endif
  44. #define SPI_DEVICE 2
  45. //
  46. // Servos
  47. //
  48. #define SERVO0_PIN PA8 // Enable BLTOUCH
  49. //
  50. // Limit Switches
  51. //
  52. #define X_STOP_PIN PA15
  53. #define Y_STOP_PIN PA12
  54. #define Z_MIN_PIN PA11
  55. #define Z_MAX_PIN PC4
  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. #ifndef FAN_PIN
  87. #define FAN_PIN PB1 // FAN
  88. #endif
  89. #ifndef HEATER_BED_PIN
  90. #define HEATER_BED_PIN PA0
  91. #endif
  92. #if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
  93. #ifndef FAN1_PIN
  94. #define FAN1_PIN PB0
  95. #endif
  96. #elif !defined(HEATER_1_PIN)
  97. #define HEATER_1_PIN PB0
  98. #endif
  99. //
  100. // Power Supply Control
  101. //
  102. #if ENABLED(MKS_PWC)
  103. #if ENABLED(TFT_LVGL_UI)
  104. #if ENABLED(PSU_CONTROL)
  105. #error "PSU_CONTROL is incompatible with MKS_PWC plus TFT_LVGL_UI."
  106. #endif
  107. #undef MKS_PWC
  108. #define SUICIDE_PIN PB2
  109. #define SUICIDE_PIN_STATE LOW
  110. #else
  111. #define PS_ON_PIN PB2 // PW_OFF
  112. #endif
  113. #define KILL_PIN PA2
  114. #define KILL_PIN_STATE HIGH
  115. #endif
  116. //
  117. // Misc. Functions
  118. //
  119. #if HAS_TFT_LVGL_UI
  120. #define MT_DET_1_PIN PA4
  121. #define MT_DET_2_PIN PE6
  122. #define MT_DET_PIN_STATE LOW
  123. #define WIFI_IO0_PIN PC13
  124. #define WIFI_IO1_PIN PC7
  125. #define WIFI_RESET_PIN PA5
  126. #else
  127. //#define POWER_LOSS_PIN PA2 // PW_DET
  128. //#define PS_ON_PIN PB2 // PW_OFF
  129. #define FIL_RUNOUT_PIN PA4
  130. #define FIL_RUNOUT2_PIN PE6
  131. #endif
  132. //
  133. // SD Card
  134. //
  135. #ifndef SDCARD_CONNECTION
  136. #define SDCARD_CONNECTION ONBOARD
  137. #endif
  138. #define SDIO_SUPPORT
  139. #define SDIO_CLOCK 4500000 // 4.5 MHz
  140. #define SD_DETECT_PIN PD12
  141. #define ONBOARD_SD_CS_PIN PC11
  142. //
  143. // LCD / Controller
  144. //
  145. #define BEEPER_PIN PC5
  146. //
  147. // TFT with FSMC interface
  148. //
  149. #if HAS_FSMC_TFT
  150. /**
  151. * Note: MKS Robin TFT screens use various TFT controllers.
  152. * If the screen stays white, disable 'TFT_RESET_PIN'
  153. * to let the bootloader init the screen.
  154. */
  155. #define TFT_RESET_PIN PC6 // FSMC_RST
  156. #define TFT_BACKLIGHT_PIN PD13
  157. #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
  158. #define DOGLCD_SCK -1
  159. #define TOUCH_CS_PIN PA7 // SPI2_NSS
  160. #define TOUCH_SCK_PIN PB13 // SPI2_SCK
  161. #define TOUCH_MISO_PIN PB14 // SPI2_MISO
  162. #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
  163. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  164. #define FSMC_CS_PIN PD7
  165. #define FSMC_RS_PIN PD11
  166. #define FSMC_DMA_DEV DMA2
  167. #define FSMC_DMA_CHANNEL DMA_CH5
  168. #define TFT_CS_PIN FSMC_CS_PIN
  169. #define TFT_RS_PIN FSMC_RS_PIN
  170. #define TOUCH_BUTTONS_HW_SPI
  171. #define TOUCH_BUTTONS_HW_SPI_DEVICE 2
  172. #define TFT_BUFFER_SIZE 14400
  173. #endif
  174. #define HAS_SPI_FLASH 1
  175. #if HAS_SPI_FLASH
  176. #define SPI_FLASH_SIZE 0x1000000 // 16MB
  177. #define SPI_FLASH_CS_PIN PB12
  178. #define SPI_FLASH_MOSI_PIN PB15
  179. #define SPI_FLASH_MISO_PIN PB14
  180. #define SPI_FLASH_SCK_PIN PB13
  181. #endif