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

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