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_FYSETC_S6.h 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. #include "env_validate.h"
  24. #if HOTENDS > 3 || E_STEPPERS > 3
  25. #error "FYSETC S6 supports up to 3 hotends / E steppers."
  26. #endif
  27. #ifndef BOARD_INFO_NAME
  28. #define BOARD_INFO_NAME "FYSETC S6"
  29. #endif
  30. #ifndef DEFAULT_MACHINE_NAME
  31. #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
  32. #endif
  33. // Avoid conflict with TIMER_TONE defined in variant
  34. #define STEP_TIMER 10
  35. //
  36. // EEPROM Emulation
  37. //
  38. #if NO_EEPROM_SELECTED
  39. #define FLASH_EEPROM_EMULATION
  40. //#define I2C_EEPROM
  41. #endif
  42. #if ENABLED(FLASH_EEPROM_EMULATION)
  43. // Decrease delays and flash wear by spreading writes across the
  44. // 128 kB sector allocated for EEPROM emulation.
  45. #define FLASH_EEPROM_LEVELING
  46. #elif ENABLED(I2C_EEPROM)
  47. #define MARLIN_EEPROM_SIZE 0x1000 // 4K
  48. #endif
  49. //
  50. // Servos
  51. //
  52. #ifndef SERVO0_PIN
  53. #define SERVO0_PIN PA3
  54. #endif
  55. //
  56. // Limit Switches
  57. //
  58. #define X_MIN_PIN PB14
  59. #define X_MAX_PIN PA1
  60. #define Y_MIN_PIN PB13
  61. #define Y_MAX_PIN PA2
  62. #define Z_MIN_PIN PA0
  63. #define Z_MAX_PIN PA3
  64. //
  65. // Filament Sensor
  66. // share with X_MAX_PIN
  67. //
  68. #ifndef FIL_RUNOUT_PIN
  69. #define FIL_RUNOUT_PIN PA1
  70. #endif
  71. //
  72. // Steppers
  73. //
  74. #define X_STEP_PIN PE11
  75. #define X_DIR_PIN PE10
  76. #ifndef X_ENABLE_PIN
  77. #define X_ENABLE_PIN PE12
  78. #endif
  79. #define X_CS_PIN PE7
  80. #define Y_STEP_PIN PD8
  81. #define Y_DIR_PIN PB12
  82. #define Y_ENABLE_PIN PD9
  83. #define Y_CS_PIN PE15
  84. #define Z_STEP_PIN PD14
  85. #define Z_DIR_PIN PD13
  86. #define Z_ENABLE_PIN PD15
  87. #define Z_CS_PIN PD10
  88. #define E0_STEP_PIN PD5
  89. #define E0_DIR_PIN PD6
  90. #define E0_ENABLE_PIN PD4
  91. #define E0_CS_PIN PD7
  92. #define E1_STEP_PIN PE6
  93. #define E1_DIR_PIN PC13
  94. #define E1_ENABLE_PIN PE5
  95. #define E1_CS_PIN PC14
  96. #define E2_STEP_PIN PE2
  97. #define E2_DIR_PIN PE4
  98. #define E2_ENABLE_PIN PE3
  99. #define E2_CS_PIN PC15
  100. #if HAS_TMC_UART
  101. //
  102. // TMC2208/TMC2209 stepper drivers
  103. //
  104. #ifndef X_SERIAL_TX_PIN
  105. #define X_SERIAL_TX_PIN PE9
  106. #endif
  107. #ifndef X_SERIAL_RX_PIN
  108. #define X_SERIAL_RX_PIN PE8
  109. #endif
  110. #ifndef Y_SERIAL_TX_PIN
  111. #define Y_SERIAL_TX_PIN PE14
  112. #endif
  113. #ifndef Y_SERIAL_RX_PIN
  114. #define Y_SERIAL_RX_PIN PE13
  115. #endif
  116. #ifndef Z_SERIAL_TX_PIN
  117. #define Z_SERIAL_TX_PIN PD11
  118. #endif
  119. #ifndef Z_SERIAL_RX_PIN
  120. #define Z_SERIAL_RX_PIN PD12
  121. #endif
  122. #ifndef E0_SERIAL_TX_PIN
  123. #define E0_SERIAL_TX_PIN PD3
  124. #endif
  125. #ifndef E0_SERIAL_RX_PIN
  126. #define E0_SERIAL_RX_PIN PA15
  127. #endif
  128. #ifndef E1_SERIAL_TX_PIN
  129. #define E1_SERIAL_TX_PIN PC4
  130. #endif
  131. #ifndef E1_SERIAL_RX_PIN
  132. #define E1_SERIAL_RX_PIN PC5
  133. #endif
  134. #ifndef E2_SERIAL_TX_PIN
  135. #define E2_SERIAL_TX_PIN PE1
  136. #endif
  137. #ifndef E2_SERIAL_RX_PIN
  138. #define E2_SERIAL_RX_PIN PE0
  139. #endif
  140. #endif
  141. //
  142. // Temperature Sensors
  143. //
  144. #define TEMP_0_PIN PC0
  145. #define TEMP_1_PIN PC1
  146. #define TEMP_2_PIN PC2
  147. #ifndef TEMP_BED_PIN
  148. #define TEMP_BED_PIN PC3
  149. #endif
  150. //
  151. // Heaters / Fans
  152. //
  153. #ifndef HEATER_0_PIN
  154. #define HEATER_0_PIN PB3
  155. #endif
  156. #ifndef HEATER_1_PIN
  157. #define HEATER_1_PIN PB4
  158. #endif
  159. #ifndef HEATER_2_PIN
  160. #define HEATER_2_PIN PB15
  161. #endif
  162. #ifndef HEATER_BED_PIN
  163. #define HEATER_BED_PIN PC8
  164. #endif
  165. #ifndef FAN_PIN
  166. #define FAN_PIN PB0
  167. #endif
  168. #ifndef FAN1_PIN
  169. #define FAN1_PIN PB1
  170. #endif
  171. #define FAN2_PIN PB2
  172. //
  173. // Misc. Functions
  174. //
  175. //#define LED_PIN PB14
  176. //#define PS_ON_PIN PE11
  177. //#define KILL_PIN PC5
  178. /**
  179. * ------ ------
  180. * PC9 | 1 2 | PA8 PA6 | 1 2 | PA5
  181. * PC11 | 3 4 | PD2 PC6 | 3 4 | PA4
  182. * PC10 5 6 | PC12 PC7 5 6 | PA7
  183. * PD0 | 7 8 | PD1 PB10 | 7 8 | RESET
  184. * GND | 9 10 | 5V GND | 9 10 | 5V
  185. * ------ ------
  186. * EXP1 EXP2
  187. */
  188. #define EXP1_01_PIN PC9
  189. #define EXP1_02_PIN PA8
  190. #define EXP1_03_PIN PC11
  191. #define EXP1_04_PIN PD2
  192. #define EXP1_05_PIN PC10
  193. #define EXP1_06_PIN PC12
  194. #define EXP1_07_PIN PD0
  195. #define EXP1_08_PIN PD1
  196. #define EXP2_01_PIN PA6
  197. #define EXP2_02_PIN PA5
  198. #define EXP2_03_PIN PC6
  199. #define EXP2_04_PIN PA4
  200. #define EXP2_05_PIN PC7
  201. #define EXP2_06_PIN PA7
  202. #define EXP2_07_PIN PB10
  203. #define EXP2_08_PIN -1 // RESET
  204. //
  205. // SPI / SD Card
  206. //
  207. #define SD_SCK_PIN EXP2_02_PIN
  208. #define SD_MISO_PIN EXP2_01_PIN
  209. #define SD_MOSI_PIN EXP2_06_PIN
  210. #define SDSS EXP2_04_PIN
  211. #define SD_DETECT_PIN EXP2_07_PIN
  212. //
  213. // LCD / Controller
  214. //
  215. #if ENABLED(FYSETC_242_OLED_12864)
  216. #define BTN_EN1 EXP1_01_PIN
  217. #define BTN_EN2 EXP1_08_PIN
  218. #define BTN_ENC EXP1_02_PIN
  219. #define BEEPER_PIN EXP2_03_PIN
  220. #define LCD_PINS_DC EXP1_06_PIN
  221. #define LCD_PINS_RS EXP2_05_PIN // LCD_RST
  222. #define DOGLCD_CS EXP1_04_PIN
  223. #define DOGLCD_MOSI EXP1_05_PIN
  224. #define DOGLCD_SCK EXP1_03_PIN
  225. #define DOGLCD_A0 LCD_PINS_DC
  226. #define FORCE_SOFT_SPI
  227. #define KILL_PIN -1 // NC
  228. #define NEOPIXEL_PIN EXP1_07_PIN
  229. #elif HAS_WIRED_LCD
  230. #define BEEPER_PIN EXP1_01_PIN
  231. #define BTN_ENC EXP1_02_PIN
  232. #if ENABLED(CR10_STOCKDISPLAY)
  233. #define LCD_PINS_RS EXP1_07_PIN
  234. #define BTN_EN1 EXP1_03_PIN
  235. #define BTN_EN2 EXP1_05_PIN
  236. #define LCD_PINS_ENABLE EXP1_08_PIN
  237. #define LCD_PINS_D4 EXP1_06_PIN
  238. #else
  239. #define LCD_PINS_RS EXP1_04_PIN
  240. #define BTN_EN1 EXP2_03_PIN
  241. #define BTN_EN2 EXP2_05_PIN
  242. #define LCD_SDSS EXP2_04_PIN
  243. #define LCD_PINS_ENABLE EXP1_03_PIN
  244. #define LCD_PINS_D4 EXP1_05_PIN
  245. #if ENABLED(FYSETC_MINI_12864)
  246. // See https://wiki.fysetc.com/Mini12864_Panel
  247. #define DOGLCD_CS EXP1_03_PIN
  248. #define DOGLCD_A0 EXP1_04_PIN
  249. #if ENABLED(FYSETC_GENERIC_12864_1_1)
  250. #define LCD_BACKLIGHT_PIN EXP1_07_PIN
  251. #endif
  252. #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
  253. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  254. #ifndef RGB_LED_R_PIN
  255. #define RGB_LED_R_PIN EXP1_06_PIN
  256. #endif
  257. #ifndef RGB_LED_G_PIN
  258. #define RGB_LED_G_PIN EXP1_07_PIN
  259. #endif
  260. #ifndef RGB_LED_B_PIN
  261. #define RGB_LED_B_PIN EXP1_08_PIN
  262. #endif
  263. #elif ENABLED(FYSETC_MINI_12864_2_1)
  264. #define NEOPIXEL_PIN EXP1_06_PIN
  265. #endif
  266. #endif
  267. #if IS_ULTIPANEL
  268. #define LCD_PINS_D5 EXP1_06_PIN
  269. #define LCD_PINS_D6 EXP1_07_PIN
  270. #define LCD_PINS_D7 EXP1_08_PIN
  271. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  272. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  273. #endif
  274. #endif
  275. #endif
  276. #endif // HAS_WIRED_LCD
  277. // Alter timing for graphical display
  278. #if IS_U8GLIB_ST7920
  279. #define BOARD_ST7920_DELAY_1 96
  280. #define BOARD_ST7920_DELAY_2 48
  281. #define BOARD_ST7920_DELAY_3 640
  282. #endif
  283. #ifndef RGB_LED_R_PIN
  284. #define RGB_LED_R_PIN PB6
  285. #endif
  286. #ifndef RGB_LED_G_PIN
  287. #define RGB_LED_G_PIN PB5
  288. #endif
  289. #ifndef RGB_LED_B_PIN
  290. #define RGB_LED_B_PIN PB7
  291. #endif
  292. #ifndef RGB_LED_W_PIN
  293. #define RGB_LED_W_PIN -1
  294. #endif