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.5KB

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