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_E3_common.h 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. #if NOT_TARGET(__STM32F1__)
  27. #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
  28. #endif
  29. #define BOARD_NO_NATIVE_USB
  30. #define BOARD_WEBSITE_URL "github.com/makerbase-mks"
  31. //#define DISABLE_DEBUG
  32. #define DISABLE_JTAG
  33. //
  34. // EEPROM
  35. //
  36. #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
  37. #define FLASH_EEPROM_EMULATION
  38. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  39. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  40. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
  41. #endif
  42. //
  43. // Servos
  44. //
  45. #define SERVO0_PIN PA3
  46. //
  47. // Limit Switches
  48. //
  49. #define X_STOP_PIN PA12
  50. #define Y_STOP_PIN PA11
  51. #define Z_MIN_PIN PC6
  52. #define Z_MAX_PIN PB1
  53. //
  54. // Steppers
  55. //
  56. #define X_STEP_PIN PC0
  57. #define X_DIR_PIN PB2
  58. #define X_ENABLE_PIN PC13
  59. #define Y_STEP_PIN PC2
  60. #define Y_DIR_PIN PB9
  61. #define Y_ENABLE_PIN PB12
  62. #define Z_STEP_PIN PB7
  63. #define Z_DIR_PIN PB6
  64. #define Z_ENABLE_PIN PB8
  65. #define E0_STEP_PIN PB4
  66. #define E0_DIR_PIN PB3
  67. #define E0_ENABLE_PIN PB5
  68. #if HAS_TMC220x
  69. /**
  70. * TMC2208/TMC2209 stepper drivers
  71. *
  72. * Hardware serial communication ports.
  73. * If undefined software serial is used according to the pins below
  74. */
  75. //#define X_HARDWARE_SERIAL MSerial1
  76. //#define Y_HARDWARE_SERIAL MSerial1
  77. //#define Z_HARDWARE_SERIAL MSerial1
  78. //#define E0_HARDWARE_SERIAL MSerial1
  79. //
  80. // Software serial
  81. //
  82. #define X_SERIAL_TX_PIN PC7
  83. #define X_SERIAL_RX_PIN PC7
  84. #define Y_SERIAL_TX_PIN PD2
  85. #define Y_SERIAL_RX_PIN PD2
  86. #define Z_SERIAL_TX_PIN PC12
  87. #define Z_SERIAL_RX_PIN PC12
  88. #define E0_SERIAL_TX_PIN PC11
  89. #define E0_SERIAL_RX_PIN PC11
  90. // Reduce baud rate to improve software serial reliability
  91. #define TMC_BAUD_RATE 19200
  92. #endif
  93. //
  94. // Heaters 0,1 / Fans / Bed
  95. //
  96. #define HEATER_0_PIN PC9
  97. #define FAN_PIN PA8
  98. #define HEATER_BED_PIN PC8
  99. //
  100. // Temperature Sensors
  101. //
  102. #define TEMP_BED_PIN PA1 // TB
  103. #define TEMP_0_PIN PA0 // TH1
  104. #define FIL_RUNOUT_PIN PB10 // MT_DET
  105. /**
  106. * _____ _____ _____
  107. * (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND
  108. * (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) (BTN_EN1) PB11 | 3 4 | PA15 (SD_SS) (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS)
  109. * (LCD_D4) PA6 | 5 6 PA7 (LCD_D5) (BTN_EN2) PB0 | 5 6 PB15 (SD_MOSI) (LCD_D4) PA6 | 5 6 PB0 (BTN_EN2)
  110. * (LCD_D6) PC4 | 7 8 | PC5 (LCD_D7) (SD_DETECT) PC10 | 7 8 | RESET RESET | 7 8 | PB11 (BTN_EN1)
  111. * GND | 9 10| 5V GND | 9 10| NC (BTN_ENC) PC3 | 9 10| PC1 (BEEPER)
  112. * ----- ----- -----
  113. * EXP1 EXP2 EXP3
  114. */
  115. #if HAS_WIRED_LCD
  116. #define BEEPER_PIN PC1
  117. #define BTN_ENC PC3
  118. #define LCD_PINS_ENABLE PA4
  119. #define LCD_PINS_RS PA5
  120. #define BTN_EN1 PB11
  121. #define BTN_EN2 PB0
  122. // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
  123. #if ENABLED(MKS_MINI_12864)
  124. #define LCD_BACKLIGHT_PIN -1
  125. #define LCD_RESET_PIN -1
  126. #define DOGLCD_A0 PC4
  127. #define DOGLCD_CS PA7
  128. #define DOGLCD_SCK PB13
  129. #define DOGLCD_MOSI PB15
  130. #else
  131. #define LCD_PINS_D4 PA6
  132. #if IS_ULTIPANEL
  133. #define LCD_PINS_D5 PA7
  134. #define LCD_PINS_D6 PC4
  135. #define LCD_PINS_D7 PC5
  136. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  137. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  138. #endif
  139. #endif
  140. #endif // !MKS_MINI_12864
  141. #endif // HAS_WIRED_LCD
  142. //
  143. // SD Card
  144. //
  145. #define SPI_DEVICE 2
  146. #define SD_DETECT_PIN PC10
  147. #define SCK_PIN PB13
  148. #define MISO_PIN PB14
  149. #define MOSI_PIN PB15
  150. #define SS_PIN PA15
  151. #ifndef BOARD_ST7920_DELAY_1
  152. #define BOARD_ST7920_DELAY_1 DELAY_NS(125)
  153. #endif
  154. #ifndef BOARD_ST7920_DELAY_2
  155. #define BOARD_ST7920_DELAY_2 DELAY_NS(125)
  156. #endif
  157. #ifndef BOARD_ST7920_DELAY_3
  158. #define BOARD_ST7920_DELAY_3 DELAY_NS(125)
  159. #endif