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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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 (STM32F130ZET6) board pin assignments
  25. *
  26. * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware
  27. */
  28. #if NOT_TARGET(STM32F1, STM32F1xx)
  29. #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
  30. #elif HOTENDS > 2 || E_STEPPERS > 2
  31. #error "MKS Robin supports up to 2 hotends / E-steppers. Comment out this line to continue."
  32. #endif
  33. #define BOARD_INFO_NAME "MKS Robin"
  34. #define BOARD_NO_NATIVE_USB
  35. //
  36. // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
  37. //
  38. #define DISABLE_JTAG
  39. //
  40. // Enable SD EEPROM to prevent infinite boot loop
  41. //
  42. #ifdef ARDUINO_ARCH_STM32
  43. #define FLASH_EEPROM_EMULATION
  44. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  45. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  46. #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE)
  47. #else
  48. #define SDCARD_EEPROM_EMULATION
  49. #endif
  50. //
  51. // Servos
  52. //
  53. #define SERVO0_PIN PC3 // XS1 - 5
  54. #define SERVO1_PIN PA1 // XS1 - 6
  55. #define SERVO2_PIN PF9 // XS2 - 5
  56. #define SERVO3_PIN PF8 // XS2 - 6
  57. //
  58. // Limit Switches
  59. //
  60. #define X_MIN_PIN PB12
  61. #define X_MAX_PIN PB0
  62. #define Y_MIN_PIN PC5
  63. #define Y_MAX_PIN PC4
  64. #define Z_MIN_PIN PA4
  65. #define Z_MAX_PIN PF7
  66. //
  67. // Steppers
  68. //
  69. #define X_ENABLE_PIN PB9
  70. #define X_STEP_PIN PB8
  71. #define X_DIR_PIN PB5
  72. #define Y_ENABLE_PIN PB4
  73. #define Y_STEP_PIN PG15
  74. #define Y_DIR_PIN PG10
  75. #define Z_ENABLE_PIN PD7
  76. #define Z_STEP_PIN PD3
  77. #define Z_DIR_PIN PG14
  78. #define E0_ENABLE_PIN PG13
  79. #define E0_STEP_PIN PG8
  80. #define E0_DIR_PIN PA15
  81. #define E1_ENABLE_PIN PA12
  82. #define E1_STEP_PIN PA11
  83. #define E1_DIR_PIN PA8
  84. //
  85. // Temperature Sensors
  86. //
  87. #define TEMP_0_PIN PC1 // TH1
  88. #define TEMP_1_PIN PC2 // TH2
  89. #define TEMP_BED_PIN PC0 // TB1
  90. //
  91. // Heaters / Fans
  92. //
  93. #define HEATER_0_PIN PC7 // HEATER1
  94. #define HEATER_1_PIN PA6 // HEATER2
  95. #define HEATER_BED_PIN PC6 // HOT BED
  96. #define FAN_PIN PA7 // FAN
  97. /**
  98. * Note: MKS Robin board is using SPI2 interface. Make sure your stm32duino library is configured accordingly
  99. */
  100. //#define MAX6675_SS_PIN PE5 // TC1 - CS1
  101. //#define MAX6675_SS_PIN PE6 // TC2 - CS2
  102. #define POWER_LOSS_PIN PA2 // PW_DET
  103. #define PS_ON_PIN PA3 // PW_OFF
  104. #define FIL_RUNOUT_PIN PF11 // MT_DET
  105. #ifdef ARDUINO_ARCH_STM32F1
  106. #define BEEPER_PIN PC13
  107. #else
  108. #define BEEPER_PIN -1
  109. #endif
  110. #define LED_PIN PB2
  111. #if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT
  112. #define TFT_CS_PIN PG12 // NE4
  113. #define TFT_RS_PIN PF0 // A0
  114. #endif
  115. #if HAS_FSMC_TFT
  116. /**
  117. * Note: MKS Robin TFT screens use various TFT controllers
  118. * Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240)
  119. * ILI9488 is not supported
  120. * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
  121. *
  122. * If the screen stays white, disable 'LCD_RESET_PIN'
  123. * to let the bootloader init the screen.
  124. *
  125. * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
  126. * because Marlin uses the reset as a failsafe to revive a glitchy LCD.
  127. */
  128. //#define LCD_RESET_PIN PF6
  129. #define LCD_BACKLIGHT_PIN PG11
  130. #define FSMC_CS_PIN TFT_CS_PIN
  131. #define FSMC_RS_PIN TFT_RS_PIN
  132. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  133. #define FSMC_DMA_DEV DMA2
  134. #define FSMC_DMA_CHANNEL DMA_CH5
  135. #elif HAS_GRAPHICAL_TFT
  136. #define TFT_RESET_PIN PF6
  137. #define TFT_BACKLIGHT_PIN PG11
  138. #endif
  139. #if NEED_TOUCH_PINS
  140. #define TOUCH_CS_PIN PB1 // SPI2_NSS
  141. #define TOUCH_SCK_PIN PB13 // SPI2_SCK
  142. #define TOUCH_MISO_PIN PB14 // SPI2_MISO
  143. #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
  144. #define TOUCH_INT_PIN -1
  145. #endif
  146. // SPI1(PA7) & SPI3(PB5) not available
  147. #define SPI_DEVICE 2
  148. #if ENABLED(SDIO_SUPPORT)
  149. #define SCK_PIN PB13 // SPI2
  150. #define MISO_PIN PB14 // SPI2
  151. #define MOSI_PIN PB15 // SPI2
  152. #define SD_DETECT_PIN PF12 // SD_CD
  153. #else
  154. // SD as custom software SPI (SDIO pins)
  155. #define SCK_PIN PC12
  156. #define MISO_PIN PC8
  157. #define MOSI_PIN PD2
  158. #define SS_PIN -1
  159. #define ONBOARD_SD_CS_PIN PC11
  160. #define SDSS PD2
  161. #define SD_DETECT_PIN -1
  162. #endif
  163. #if HAS_TMC_UART
  164. /**
  165. * TMC2208/TMC2209 stepper drivers
  166. *
  167. * Hardware serial communication ports.
  168. * If undefined software serial is used according to the pins below
  169. */
  170. //#define X_HARDWARE_SERIAL MSerial1
  171. //#define Y_HARDWARE_SERIAL MSerial1
  172. //#define Z_HARDWARE_SERIAL MSerial1
  173. //#define E0_HARDWARE_SERIAL MSerial1
  174. //#define E1_HARDWARE_SERIAL MSerial1
  175. // Unused servo pins may be repurposed with SoftwareSerialM
  176. //#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN -- XS2 - 6
  177. //#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN -- XS2 - 5
  178. //#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN -- XS1 - 6
  179. //#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN -- XS1 - 5
  180. //#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
  181. //#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
  182. //#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
  183. //#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
  184. // Reduce baud rate for software serial reliability
  185. #if HAS_TMC_SW_SERIAL
  186. #define TMC_BAUD_RATE 19200
  187. #endif
  188. #endif