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.h 6.9KB

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