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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2019 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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * MKS SGEN-L pin assignments
  24. */
  25. #ifndef TARGET_LPC1768
  26. #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
  27. #endif
  28. #define BOARD_NAME "MKS SGEN-L"
  29. #define BOARD_WEBSITE_URL "https://github.com/makerbase-mks/MKS-SGEN_L"
  30. //
  31. // Servo pin
  32. //
  33. #define SERVO0_PIN P1_23 // SERVO P1.23
  34. #define SERVO1_PIN P2_00 // SERVO P2.0
  35. //
  36. // Limit Switches
  37. //
  38. #define X_MIN_PIN P1_29
  39. #define X_MAX_PIN P1_28
  40. #define Y_MIN_PIN P1_27
  41. #define Y_MAX_PIN P1_26
  42. #define Z_MIN_PIN P1_25
  43. #define Z_MAX_PIN P1_24
  44. //
  45. // Z Probe (when not Z_MIN_PIN)
  46. //
  47. #ifndef Z_MIN_PROBE_PIN
  48. #define Z_MIN_PROBE_PIN P1_24
  49. #endif
  50. //
  51. // Steppers
  52. //
  53. #define X_STEP_PIN P2_02
  54. #define X_DIR_PIN P2_03
  55. #define X_ENABLE_PIN P2_01
  56. #ifndef X_CS_PIN
  57. #define X_CS_PIN P1_01
  58. #endif
  59. #define Y_STEP_PIN P0_19
  60. #define Y_DIR_PIN P0_20
  61. #define Y_ENABLE_PIN P2_08
  62. #ifndef Y_CS_PIN
  63. #define Y_CS_PIN P1_08
  64. #endif
  65. #define Z_STEP_PIN P0_22
  66. #define Z_DIR_PIN P2_11
  67. #define Z_ENABLE_PIN P0_21
  68. #ifndef Z_CS_PIN
  69. #define Z_CS_PIN P1_10
  70. #endif
  71. #define E0_STEP_PIN P2_13
  72. #define E0_DIR_PIN P0_11
  73. #define E0_ENABLE_PIN P2_12
  74. #ifndef E0_CS_PIN
  75. #define E0_CS_PIN P1_15
  76. #endif
  77. #define E1_STEP_PIN P0_01
  78. #define E1_DIR_PIN P0_00
  79. #define E1_ENABLE_PIN P0_10
  80. #ifndef E1_CS_PIN
  81. #define E1_CS_PIN P1_17
  82. #endif
  83. //
  84. // Software SPI pins for TMC2130 stepper drivers
  85. //
  86. #if ENABLED(TMC_USE_SW_SPI)
  87. #define TMC_SW_MOSI P4_28
  88. #define TMC_SW_MISO P0_05
  89. #define TMC_SW_SCK P0_04
  90. #endif
  91. #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)
  92. /**
  93. * TMC2208 stepper drivers
  94. *
  95. * Hardware serial communication ports.
  96. * If undefined software serial is used according to the pins below
  97. */
  98. //#define X_HARDWARE_SERIAL Serial
  99. //#define X2_HARDWARE_SERIAL Serial1
  100. //#define Y_HARDWARE_SERIAL Serial1
  101. //#define Y2_HARDWARE_SERIAL Serial1
  102. //#define Z_HARDWARE_SERIAL Serial1
  103. //#define Z2_HARDWARE_SERIAL Serial1
  104. //#define E0_HARDWARE_SERIAL Serial1
  105. //#define E1_HARDWARE_SERIAL Serial1
  106. //#define E2_HARDWARE_SERIAL Serial1
  107. //#define E3_HARDWARE_SERIAL Serial1
  108. //#define E4_HARDWARE_SERIAL Serial1
  109. //
  110. // Software serial
  111. //
  112. #define X_SERIAL_TX_PIN P1_04
  113. #define X_SERIAL_RX_PIN P1_01
  114. #define Y_SERIAL_TX_PIN P1_09
  115. #define Y_SERIAL_RX_PIN P1_08
  116. #define Z_SERIAL_TX_PIN P1_14
  117. #define Z_SERIAL_RX_PIN P1_10
  118. #define E0_SERIAL_TX_PIN P1_16
  119. #define E0_SERIAL_RX_PIN P1_15
  120. #define E1_SERIAL_TX_PIN P4_29
  121. #define E1_SERIAL_RX_PIN P1_17
  122. #define Z2_SERIAL_TX_PIN P4_29
  123. #define Z2_SERIAL_RX_PIN P1_17
  124. #endif // TMC2208 || TMC2209
  125. //
  126. // Temperature Sensors
  127. // 3.3V max when defined as an analog input
  128. //
  129. #define TEMP_0_PIN 0 // Analog Input A0 (TH1)
  130. #define TEMP_BED_PIN 1 // Analog Input A1 (TB)
  131. #define TEMP_1_PIN 2 // Analog Input A2 (TH2)
  132. //
  133. // Heaters / Fans
  134. //
  135. #define HEATER_BED_PIN P2_05
  136. #define HEATER_0_PIN P2_07
  137. #define HEATER_1_PIN P2_06
  138. #ifndef FAN_PIN
  139. #define FAN_PIN P2_04
  140. #endif
  141. //
  142. // Misc. Functions
  143. //
  144. #define LED_PIN P1_18 // Used as a status indicator
  145. #define LED2_PIN P1_19
  146. #define LED3_PIN P1_20
  147. #define LED4_PIN P1_21
  148. /**
  149. * _____ _____
  150. * (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK)
  151. * (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2)
  152. * (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 1.20 (SD_MOSI)
  153. * (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST
  154. * GND | · · | 5V GND | · · | NC
  155. * ----- -----
  156. * EXP1 EXP2
  157. */
  158. #if HAS_SPI_LCD
  159. #define BEEPER_PIN P1_31
  160. #define BTN_ENC P1_30
  161. #if ENABLED(CR10_STOCKDISPLAY)
  162. #define LCD_PINS_RS P1_0
  163. #define BTN_EN1 P0_18
  164. #define BTN_EN2 P0_15
  165. #define LCD_PINS_ENABLE P1_22
  166. #define LCD_PINS_D4 P0_17
  167. #else
  168. #define LCD_PINS_RS P0_16
  169. #define BTN_EN1 P3_25
  170. #define BTN_EN2 P3_26
  171. #define LCD_PINS_ENABLE P0_18
  172. #define LCD_PINS_D4 P0_15
  173. #define LCD_SDSS P0_28
  174. #define SD_DETECT_PIN P0_27
  175. #if ENABLED(FYSETC_MINI_12864)
  176. #define DOGLCD_CS P0_18
  177. #define DOGLCD_A0 P0_16
  178. #define DOGLCD_SCK P0_7
  179. #define DOGLCD_MOSI P1_20
  180. #define FORCE_SOFT_SPI
  181. #define LCD_BACKLIGHT_PIN -1
  182. #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
  183. // results in LCD soft SPI mode 3, SD soft SPI mode 0
  184. #define LCD_RESET_PIN P0_15 // Must be high or open for LCD to operate normally.
  185. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  186. #ifndef RGB_LED_R_PIN
  187. #define RGB_LED_R_PIN P0_17
  188. #endif
  189. #ifndef RGB_LED_G_PIN
  190. #define RGB_LED_G_PIN P1_0
  191. #endif
  192. #ifndef RGB_LED_B_PIN
  193. #define RGB_LED_B_PIN P1_22
  194. #endif
  195. #elif ENABLED(FYSETC_MINI_12864_2_1)
  196. #define NEOPIXEL_PIN P0_17
  197. #endif
  198. #else // !FYSETC_MINI_12864
  199. #if ENABLED(MKS_MINI_12864)
  200. #define DOGLCD_CS P0_17
  201. #define DOGLCD_A0 P1_0
  202. #endif
  203. #if ENABLED(ULTIPANEL)
  204. #define LCD_PINS_D5 P0_17
  205. #define LCD_PINS_D6 P1_0
  206. #define LCD_PINS_D7 P1_22
  207. #endif
  208. #endif // !FYSETC_MINI_12864
  209. #endif
  210. #endif // HAS_SPI_LCD
  211. #ifndef SDCARD_CONNECTION
  212. #define SDCARD_CONNECTION ONBOARD
  213. #endif
  214. #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
  215. #if SD_CONNECTION_IS(LCD)
  216. #define SCK_PIN P0_07
  217. #define MISO_PIN P0_08
  218. #define MOSI_PIN P0_09
  219. #define SS_PIN P0_28
  220. #elif SD_CONNECTION_IS(ONBOARD)
  221. #define SD_DETECT_PIN P0_27
  222. #define SCK_PIN P0_07
  223. #define MISO_PIN P0_08
  224. #define MOSI_PIN P0_09
  225. #define SS_PIN ONBOARD_SD_CS_PIN
  226. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  227. #error "No custom SD drive cable defined for this board."
  228. #endif
  229. //
  230. // Other Pins
  231. //
  232. //#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0)
  233. //#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0)
  234. //#define PS_ON_PIN P1_23 // SERVO P1.23