My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

pins_MKS_ROBIN_E3_common.h 8.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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 E3 & E3D (STM32F103RCT6) common board pin assignments
  25. */
  26. #include "env_validate.h"
  27. #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
  28. #define BOARD_NO_NATIVE_USB
  29. #define USES_DIAG_JUMPERS
  30. //#define DISABLE_DEBUG
  31. #define DISABLE_JTAG
  32. //
  33. // EEPROM
  34. //
  35. #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
  36. #define FLASH_EEPROM_EMULATION
  37. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  38. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  39. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
  40. #endif
  41. //
  42. // Servos
  43. //
  44. #define SERVO0_PIN PA3
  45. //
  46. // Limit Switches
  47. //
  48. #define X_STOP_PIN PA12
  49. #define Y_STOP_PIN PA11
  50. #define Z_STOP_PIN PC6
  51. //
  52. // Z Probe
  53. //
  54. #ifndef Z_MIN_PROBE_PIN
  55. #define Z_MIN_PROBE_PIN PB1
  56. #endif
  57. //
  58. // Steppers
  59. //
  60. #define X_STEP_PIN PC0
  61. #define X_DIR_PIN PB2
  62. #define X_ENABLE_PIN PC13
  63. #define Y_STEP_PIN PC2
  64. #define Y_DIR_PIN PB9
  65. #define Y_ENABLE_PIN PB12
  66. #ifndef Z_STEP_PIN
  67. #define Z_STEP_PIN PB7
  68. #endif
  69. #ifndef Z_DIR_PIN
  70. #define Z_DIR_PIN PB6
  71. #endif
  72. #define Z_ENABLE_PIN PB8
  73. #define E0_STEP_PIN PB4
  74. #define E0_DIR_PIN PB3
  75. #define E0_ENABLE_PIN PB5
  76. #if HAS_TMC_UART
  77. /**
  78. * TMC2208/TMC2209 stepper drivers
  79. *
  80. * Hardware serial communication ports.
  81. * If undefined software serial is used according to the pins below
  82. */
  83. //#define X_HARDWARE_SERIAL MSerial1
  84. //#define Y_HARDWARE_SERIAL MSerial1
  85. //#define Z_HARDWARE_SERIAL MSerial1
  86. //#define E0_HARDWARE_SERIAL MSerial1
  87. #define X_SERIAL_TX_PIN PC7
  88. #define X_SERIAL_RX_PIN PC7
  89. #define Y_SERIAL_TX_PIN PD2
  90. #define Y_SERIAL_RX_PIN PD2
  91. #define Z_SERIAL_TX_PIN PC12
  92. #define Z_SERIAL_RX_PIN PC12
  93. #define E0_SERIAL_TX_PIN PC11
  94. #define E0_SERIAL_RX_PIN PC11
  95. // Reduce baud rate to improve software serial reliability
  96. #define TMC_BAUD_RATE 19200
  97. #endif
  98. //
  99. // Heaters 0,1 / Fans / Bed
  100. //
  101. #define HEATER_0_PIN PC9
  102. #define FAN_PIN PA8
  103. #define HEATER_BED_PIN PC8
  104. //
  105. // Temperature Sensors
  106. //
  107. #define TEMP_BED_PIN PA1 // TB
  108. #define TEMP_0_PIN PA0 // TH1
  109. #define FIL_RUNOUT_PIN PB10 // MT_DET
  110. //
  111. // Power Supply Control
  112. //
  113. #if ENABLED(MKS_PWC)
  114. #define PS_ON_PIN PA14 // PW_OFF
  115. #define KILL_PIN PB10 // PW_DET
  116. #define KILL_PIN_STATE HIGH
  117. #endif
  118. /**
  119. * ------ ------ ------
  120. * (BEEPER) PC1 |10 9 | PC3 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SD_SCK) (BEEPER) PC1 |10 9 | PC3 (BTN_ENC)
  121. * (LCD_EN) PA4 | 8 7 | PA5 (LCD_RS) (BTN_EN1) PB11 | 8 7 | PA15 (SD_SS) (BTN_EN1) PB11 | 8 7 | RESET
  122. * (LCD_D4) PA6 6 5 | PA7 (LCD_D5) (BTN_EN2) PB0 6 5 | PB15 (SD_MOSI) (BTN_EN2) PB0 6 5 | PA6 (LCD_D4)
  123. * (LCD_D6) PC4 | 4 3 | PC5 (LCD_D7) (SD_DETECT) PC10 | 4 3 | RESET (LCD_RS) PA5 | 4 3 | PA4 (LCD_EN)
  124. * GND | 2 1 | 5V GND | 2 1 | -- GND | 2 1 | 5V
  125. * ------ ------ ------
  126. * EXP1 EXP2 "Ender-3 EXP1"
  127. */
  128. #define EXP1_03_PIN PC5
  129. #define EXP1_04_PIN PC4
  130. #define EXP1_05_PIN PA7
  131. #define EXP1_06_PIN PA6
  132. #define EXP1_07_PIN PA5
  133. #define EXP1_08_PIN PA4
  134. #define EXP1_09_PIN PC3
  135. #define EXP1_10_PIN PC1
  136. #define EXP2_03_PIN -1 // RESET
  137. #define EXP2_04_PIN PC10
  138. #define EXP2_05_PIN PB15
  139. #define EXP2_06_PIN PB0
  140. #define EXP2_07_PIN PA15
  141. #define EXP2_08_PIN PB11
  142. #define EXP2_09_PIN PB13
  143. #define EXP2_10_PIN PB14
  144. // "Ender-3 EXP1"
  145. #define E3_EXP1_03_PIN PA4
  146. #define E3_EXP1_04_PIN PA5
  147. #define E3_EXP1_05_PIN PA6
  148. #define E3_EXP1_06_PIN PB0
  149. #define E3_EXP1_07_PIN -1 // RESET
  150. #define E3_EXP1_08_PIN PB11
  151. #define E3_EXP1_09_PIN PC3
  152. #define E3_EXP1_10_PIN PC1
  153. #if HAS_WIRED_LCD
  154. #define BEEPER_PIN EXP1_10_PIN
  155. #define BTN_ENC EXP1_09_PIN
  156. #define LCD_PINS_ENABLE EXP1_08_PIN
  157. #define LCD_PINS_RS EXP1_07_PIN
  158. #define BTN_EN1 EXP2_08_PIN
  159. #define BTN_EN2 EXP2_06_PIN
  160. // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
  161. #if ENABLED(MKS_MINI_12864)
  162. #define LCD_BACKLIGHT_PIN -1
  163. #define LCD_RESET_PIN -1
  164. #define DOGLCD_A0 EXP1_04_PIN
  165. #define DOGLCD_CS EXP1_05_PIN
  166. #define DOGLCD_SCK EXP2_09_PIN
  167. #define DOGLCD_MOSI EXP2_05_PIN
  168. #elif ENABLED(FYSETC_MINI_12864_2_1)
  169. #define LCD_PINS_DC EXP1_07_PIN
  170. #define DOGLCD_CS EXP1_08_PIN
  171. #define DOGLCD_A0 LCD_PINS_DC
  172. #define LCD_BACKLIGHT_PIN -1
  173. #define LCD_RESET_PIN EXP1_06_PIN
  174. #define NEOPIXEL_PIN EXP1_05_PIN
  175. #define DOGLCD_MOSI EXP2_05_PIN
  176. #define DOGLCD_SCK EXP2_09_PIN
  177. #define FORCE_SOFT_SPI
  178. #define SOFTWARE_SPI
  179. //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
  180. #else
  181. #define LCD_PINS_D4 EXP1_06_PIN
  182. #if IS_ULTIPANEL
  183. #define LCD_PINS_D5 EXP1_05_PIN
  184. #define LCD_PINS_D6 EXP1_04_PIN
  185. #define LCD_PINS_D7 EXP1_03_PIN
  186. #if !defined(BTN_ENC_EN) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  187. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  188. #endif
  189. #endif
  190. #endif // !MKS_MINI_12864
  191. #endif // HAS_WIRED_LCD
  192. // Alter timing for graphical display
  193. #if IS_U8GLIB_ST7920
  194. #ifndef BOARD_ST7920_DELAY_1
  195. #define BOARD_ST7920_DELAY_1 125
  196. #endif
  197. #ifndef BOARD_ST7920_DELAY_2
  198. #define BOARD_ST7920_DELAY_2 125
  199. #endif
  200. #ifndef BOARD_ST7920_DELAY_3
  201. #define BOARD_ST7920_DELAY_3 125
  202. #endif
  203. #endif
  204. // LED driving pin
  205. #ifndef NEOPIXEL_PIN
  206. #define NEOPIXEL_PIN PA2
  207. #endif
  208. //
  209. // SD Card
  210. //
  211. #define SDCARD_CONNECTION ONBOARD
  212. #define SPI_DEVICE 2
  213. #define ONBOARD_SPI_DEVICE 2
  214. #define SDSS SD_SS_PIN
  215. #define ONBOARD_SD_CS_PIN SD_SS_PIN
  216. #define SD_DETECT_PIN PC10 // EXP2_04_PIN
  217. #define NO_SD_HOST_DRIVE
  218. // TODO: This is the only way to set SPI for SD on STM32 (for now)
  219. #define ENABLE_SPI2
  220. #define SD_SCK_PIN EXP2_09_PIN
  221. #define SD_MISO_PIN EXP2_10_PIN
  222. #define SD_MOSI_PIN EXP2_05_PIN
  223. #define SD_SS_PIN EXP2_07_PIN