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_RAMPS_LINUX.h 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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. * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments
  24. *
  25. * Applies to the following boards:
  26. *
  27. * RAMPS_14_EFB (Hotend, Fan, Bed)
  28. * RAMPS_14_EEB (Hotend0, Hotend1, Bed)
  29. * RAMPS_14_EFF (Hotend, Fan0, Fan1)
  30. * RAMPS_14_EEF (Hotend0, Hotend1, Fan)
  31. * RAMPS_14_SF (Spindle, Controller Fan)
  32. *
  33. * RAMPS_13_EFB (Hotend, Fan, Bed)
  34. * RAMPS_13_EEB (Hotend0, Hotend1, Bed)
  35. * RAMPS_13_EFF (Hotend, Fan0, Fan1)
  36. * RAMPS_13_EEF (Hotend0, Hotend1, Fan)
  37. * RAMPS_13_SF (Spindle, Controller Fan)
  38. *
  39. * Other pins_MYBOARD.h files may override these defaults
  40. *
  41. * Differences between
  42. * RAMPS_13 | RAMPS_14
  43. * 7 | 11
  44. */
  45. #ifndef BOARD_NAME
  46. #define BOARD_NAME "RAMPS 1.4"
  47. #endif
  48. #define IS_RAMPS_EFB
  49. //
  50. // Servos
  51. //
  52. #ifdef IS_RAMPS_13
  53. #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI
  54. #else
  55. #define SERVO0_PIN 11
  56. #endif
  57. #define SERVO1_PIN 6
  58. #define SERVO2_PIN 5
  59. #ifndef SERVO3_PIN
  60. #define SERVO3_PIN 4
  61. #endif
  62. //
  63. // Limit Switches
  64. //
  65. #define X_MIN_PIN 3
  66. #ifndef X_MAX_PIN
  67. #define X_MAX_PIN 2
  68. #endif
  69. #define Y_MIN_PIN 14
  70. #define Y_MAX_PIN 15
  71. #define Z_MIN_PIN 18
  72. #define Z_MAX_PIN 19
  73. //
  74. // Z Probe (when not Z_MIN_PIN)
  75. //
  76. #ifndef Z_MIN_PROBE_PIN
  77. #define Z_MIN_PROBE_PIN 32
  78. #endif
  79. //
  80. // Steppers
  81. //
  82. #define X_STEP_PIN 54
  83. #define X_DIR_PIN 55
  84. #define X_ENABLE_PIN 38
  85. #ifndef X_CS_PIN
  86. #define X_CS_PIN 53
  87. #endif
  88. #define Y_STEP_PIN 60
  89. #define Y_DIR_PIN 61
  90. #define Y_ENABLE_PIN 56
  91. #ifndef Y_CS_PIN
  92. #define Y_CS_PIN 49
  93. #endif
  94. #define Z_STEP_PIN 46
  95. #define Z_DIR_PIN 48
  96. #define Z_ENABLE_PIN 62
  97. #ifndef Z_CS_PIN
  98. #define Z_CS_PIN 40
  99. #endif
  100. #define E0_STEP_PIN 26
  101. #define E0_DIR_PIN 28
  102. #define E0_ENABLE_PIN 24
  103. #ifndef E0_CS_PIN
  104. #define E0_CS_PIN 42
  105. #endif
  106. #define E1_STEP_PIN 36
  107. #define E1_DIR_PIN 34
  108. #define E1_ENABLE_PIN 30
  109. #ifndef E1_CS_PIN
  110. #define E1_CS_PIN 44
  111. #endif
  112. //
  113. // Temperature Sensors
  114. //
  115. #define TEMP_0_PIN 0 // Analog Input
  116. #define TEMP_1_PIN 1 // Analog Input
  117. #define TEMP_BED_PIN 2 // Analog Input
  118. // SPI for Max6675 or Max31855 Thermocouple
  119. #if DISABLED(SDSUPPORT)
  120. #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
  121. #else
  122. #define MAX6675_SS_PIN 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
  123. #endif
  124. //
  125. // Augmentation for auto-assigning RAMPS plugs
  126. //
  127. #if DISABLED(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D)
  128. #if HOTENDS > 1
  129. #if TEMP_SENSOR_BED
  130. #define IS_RAMPS_EEB
  131. #else
  132. #define IS_RAMPS_EEF
  133. #endif
  134. #elif TEMP_SENSOR_BED
  135. #define IS_RAMPS_EFB
  136. #else
  137. #define IS_RAMPS_EFF
  138. #endif
  139. #endif
  140. //
  141. // Heaters / Fans
  142. //
  143. #ifndef MOSFET_D_PIN
  144. #define MOSFET_D_PIN -1
  145. #endif
  146. #ifndef RAMPS_D8_PIN
  147. #define RAMPS_D8_PIN 8
  148. #endif
  149. #ifndef RAMPS_D9_PIN
  150. #define RAMPS_D9_PIN 9
  151. #endif
  152. #ifndef RAMPS_D10_PIN
  153. #define RAMPS_D10_PIN 10
  154. #endif
  155. #define HEATER_0_PIN RAMPS_D10_PIN
  156. #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
  157. #define FAN_PIN RAMPS_D9_PIN
  158. #define HEATER_BED_PIN RAMPS_D8_PIN
  159. #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
  160. #define HEATER_1_PIN RAMPS_D9_PIN
  161. #define FAN_PIN RAMPS_D8_PIN
  162. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  163. #define HEATER_1_PIN RAMPS_D9_PIN
  164. #define HEATER_BED_PIN RAMPS_D8_PIN
  165. #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan
  166. #define FAN_PIN RAMPS_D9_PIN
  167. #define FAN1_PIN RAMPS_D8_PIN
  168. #elif ENABLED(IS_RAMPS_SF) // Spindle, Fan
  169. #define FAN_PIN RAMPS_D8_PIN
  170. #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  171. #define FAN_PIN RAMPS_D9_PIN
  172. #define HEATER_BED_PIN RAMPS_D8_PIN
  173. #if HOTENDS == 1
  174. #define FAN1_PIN MOSFET_D_PIN
  175. #else
  176. #define HEATER_1_PIN MOSFET_D_PIN
  177. #endif
  178. #endif
  179. #ifndef FAN_PIN
  180. #define FAN_PIN 4 // IO pin. Buffer needed
  181. #endif
  182. //
  183. // Misc. Functions
  184. //
  185. #define SDSS 53
  186. #define LED_PIN 13
  187. #ifndef FILWIDTH_PIN
  188. #define FILWIDTH_PIN 5 // Analog Input on AUX2
  189. #endif
  190. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  191. #ifndef FIL_RUNOUT_PIN
  192. #define FIL_RUNOUT_PIN 4
  193. #endif
  194. #ifndef PS_ON_PIN
  195. #define PS_ON_PIN 12
  196. #endif
  197. #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN)
  198. #if NUM_SERVOS <= 1 // try to use servo connector first
  199. #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM
  200. #elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2
  201. #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM
  202. #endif
  203. #endif
  204. //
  205. // M3/M4/M5 - Spindle/Laser Control
  206. //
  207. #if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA)
  208. #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first
  209. #define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown!
  210. #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM
  211. #define SPINDLE_DIR_PIN 5
  212. #elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2
  213. #define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown!
  214. #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM
  215. #define SPINDLE_DIR_PIN 65
  216. #endif
  217. #endif
  218. //
  219. // Průša i3 MK2 Multiplexer Support
  220. //
  221. #ifndef E_MUX0_PIN
  222. #define E_MUX0_PIN 40 // Z_CS_PIN
  223. #endif
  224. #ifndef E_MUX1_PIN
  225. #define E_MUX1_PIN 42 // E0_CS_PIN
  226. #endif
  227. #ifndef E_MUX2_PIN
  228. #define E_MUX2_PIN 44 // E1_CS_PIN
  229. #endif
  230. /**
  231. * Default pins for TMC software SPI
  232. */
  233. #if ENABLED(TMC_USE_SW_SPI)
  234. #ifndef TMC_SW_MOSI
  235. #define TMC_SW_MOSI 66
  236. #endif
  237. #ifndef TMC_SW_MISO
  238. #define TMC_SW_MISO 44
  239. #endif
  240. #ifndef TMC_SW_SCK
  241. #define TMC_SW_SCK 64
  242. #endif
  243. #endif
  244. #if HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2209)
  245. /**
  246. * TMC2208/TMC2209 stepper drivers
  247. *
  248. * Hardware serial communication ports.
  249. * If undefined software serial is used according to the pins below
  250. */
  251. //#define X_HARDWARE_SERIAL Serial1
  252. //#define X2_HARDWARE_SERIAL Serial1
  253. //#define Y_HARDWARE_SERIAL Serial1
  254. //#define Y2_HARDWARE_SERIAL Serial1
  255. //#define Z_HARDWARE_SERIAL Serial1
  256. //#define Z2_HARDWARE_SERIAL Serial1
  257. //#define E0_HARDWARE_SERIAL Serial1
  258. //#define E1_HARDWARE_SERIAL Serial1
  259. //#define E2_HARDWARE_SERIAL Serial1
  260. //#define E3_HARDWARE_SERIAL Serial1
  261. //#define E4_HARDWARE_SERIAL Serial1
  262. /**
  263. * Software serial
  264. */
  265. #define X_SERIAL_TX_PIN 40
  266. #define X_SERIAL_RX_PIN 63
  267. #define X2_SERIAL_TX_PIN -1
  268. #define X2_SERIAL_RX_PIN -1
  269. #define Y_SERIAL_TX_PIN 59
  270. #define Y_SERIAL_RX_PIN 64
  271. #define Y2_SERIAL_TX_PIN -1
  272. #define Y2_SERIAL_RX_PIN -1
  273. #define Z_SERIAL_TX_PIN 42
  274. #define Z_SERIAL_RX_PIN 65
  275. #define Z2_SERIAL_TX_PIN -1
  276. #define Z2_SERIAL_RX_PIN -1
  277. #define E0_SERIAL_TX_PIN 44
  278. #define E0_SERIAL_RX_PIN 66
  279. #define E1_SERIAL_TX_PIN -1
  280. #define E1_SERIAL_RX_PIN -1
  281. #define E2_SERIAL_TX_PIN -1
  282. #define E2_SERIAL_RX_PIN -1
  283. #define E3_SERIAL_TX_PIN -1
  284. #define E3_SERIAL_RX_PIN -1
  285. #define E4_SERIAL_TX_PIN -1
  286. #define E4_SERIAL_RX_PIN -1
  287. #endif
  288. //////////////////////////
  289. // LCDs and Controllers //
  290. //////////////////////////
  291. #if HAS_SPI_LCD
  292. //
  293. // LCD Display output pins
  294. //
  295. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  296. #define LCD_PINS_RS 49 // CS chip select /SS chip slave select
  297. #define LCD_PINS_ENABLE 51 // SID (MOSI)
  298. #define LCD_PINS_D4 52 // SCK (CLK) clock
  299. #elif BOTH(NEWPANEL, PANEL_ONE)
  300. #define LCD_PINS_RS 40
  301. #define LCD_PINS_ENABLE 42
  302. #define LCD_PINS_D4 65
  303. #define LCD_PINS_D5 66
  304. #define LCD_PINS_D6 44
  305. #define LCD_PINS_D7 64
  306. #else
  307. #if ENABLED(CR10_STOCKDISPLAY)
  308. #define LCD_PINS_RS 27
  309. #define LCD_PINS_ENABLE 29
  310. #define LCD_PINS_D4 25
  311. #if DISABLED(NEWPANEL)
  312. #define BEEPER_PIN 37
  313. #endif
  314. #elif ENABLED(ZONESTAR_LCD)
  315. #define LCD_PINS_RS 64
  316. #define LCD_PINS_ENABLE 44
  317. #define LCD_PINS_D4 63
  318. #define LCD_PINS_D5 40
  319. #define LCD_PINS_D6 42
  320. #define LCD_PINS_D7 65
  321. #else
  322. #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
  323. #define LCD_PINS_DC 25 // Set as output on init
  324. #define LCD_PINS_RS 27 // Pull low for 1s to init
  325. // DOGM SPI LCD Support
  326. #define DOGLCD_CS 16
  327. #define DOGLCD_MOSI 17
  328. #define DOGLCD_SCK 23
  329. #define DOGLCD_A0 LCD_PINS_DC
  330. #else
  331. #define LCD_PINS_RS 16
  332. #define LCD_PINS_ENABLE 17
  333. #define LCD_PINS_D4 23
  334. #define LCD_PINS_D5 25
  335. #define LCD_PINS_D6 27
  336. #endif
  337. #define LCD_PINS_D7 29
  338. #if DISABLED(NEWPANEL)
  339. #define BEEPER_PIN 33
  340. #endif
  341. #endif
  342. #if DISABLED(NEWPANEL)
  343. // Buttons are attached to a shift register
  344. // Not wired yet
  345. //#define SHIFT_CLK 38
  346. //#define SHIFT_LD 42
  347. //#define SHIFT_OUT 40
  348. //#define SHIFT_EN 17
  349. #endif
  350. #endif
  351. //
  352. // LCD Display input pins
  353. //
  354. #if ENABLED(NEWPANEL)
  355. #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
  356. #define BEEPER_PIN 37
  357. #if ENABLED(CR10_STOCKDISPLAY)
  358. #define BTN_EN1 17
  359. #define BTN_EN2 23
  360. #else
  361. #define BTN_EN1 31
  362. #define BTN_EN2 33
  363. #endif
  364. #define BTN_ENC 35
  365. #define SD_DETECT_PIN 49
  366. #define KILL_PIN 41
  367. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  368. #define LCD_BACKLIGHT_PIN 39
  369. #endif
  370. #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  371. #define BTN_EN1 64
  372. #define BTN_EN2 59
  373. #define BTN_ENC 63
  374. #define SD_DETECT_PIN 42
  375. #elif ENABLED(LCD_I2C_PANELOLU2)
  376. #define BTN_EN1 47
  377. #define BTN_EN2 43
  378. #define BTN_ENC 32
  379. #define LCD_SDSS SDSS
  380. #define KILL_PIN 41
  381. #elif ENABLED(LCD_I2C_VIKI)
  382. #define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42.
  383. #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13.
  384. #define BTN_ENC -1
  385. #define LCD_SDSS SDSS
  386. #define SD_DETECT_PIN 49
  387. #elif ANY(VIKI2, miniVIKI)
  388. #define DOGLCD_CS 45
  389. #define DOGLCD_A0 44
  390. #define LCD_SCREEN_ROT_180
  391. #define BEEPER_PIN 33
  392. #define STAT_LED_RED_PIN 32
  393. #define STAT_LED_BLUE_PIN 35
  394. #define BTN_EN1 22
  395. #define BTN_EN2 7
  396. #define BTN_ENC 39
  397. #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board
  398. #define KILL_PIN 31
  399. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  400. #define DOGLCD_CS 29
  401. #define DOGLCD_A0 27
  402. #define BEEPER_PIN 23
  403. #define LCD_BACKLIGHT_PIN 33
  404. #define BTN_EN1 35
  405. #define BTN_EN2 37
  406. #define BTN_ENC 31
  407. #define LCD_SDSS SDSS
  408. #define SD_DETECT_PIN 49
  409. #define KILL_PIN 41
  410. #elif ENABLED(MKS_MINI_12864) // Added in Marlin 1.1.6
  411. #define DOGLCD_A0 27
  412. #define DOGLCD_CS 25
  413. // GLCD features
  414. // Uncomment screen orientation
  415. //#define LCD_SCREEN_ROT_90
  416. //#define LCD_SCREEN_ROT_180
  417. //#define LCD_SCREEN_ROT_270
  418. #define BEEPER_PIN 37
  419. // not connected to a pin
  420. #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
  421. #define BTN_EN1 31
  422. #define BTN_EN2 33
  423. #define BTN_ENC 35
  424. #define SD_DETECT_PIN 49
  425. #define KILL_PIN 64
  426. #elif ENABLED(MINIPANEL)
  427. #define BEEPER_PIN 42
  428. // not connected to a pin
  429. #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
  430. #define DOGLCD_A0 44
  431. #define DOGLCD_CS 66
  432. // GLCD features
  433. // Uncomment screen orientation
  434. //#define LCD_SCREEN_ROT_90
  435. //#define LCD_SCREEN_ROT_180
  436. //#define LCD_SCREEN_ROT_270
  437. #define BTN_EN1 40
  438. #define BTN_EN2 63
  439. #define BTN_ENC 59
  440. #define SD_DETECT_PIN 49
  441. #define KILL_PIN 64
  442. #elif ENABLED(ZONESTAR_LCD)
  443. #define ADC_KEYPAD_PIN 12
  444. #elif ENABLED(AZSMZ_12864)
  445. // Pins only defined for RAMPS_SMART currently
  446. #else
  447. // Beeper on AUX-4
  448. #define BEEPER_PIN 33
  449. // Buttons are directly attached using AUX-2
  450. #if ENABLED(REPRAPWORLD_KEYPAD)
  451. #define SHIFT_OUT 40
  452. #define SHIFT_CLK 44
  453. #define SHIFT_LD 42
  454. #define BTN_EN1 64
  455. #define BTN_EN2 59
  456. #define BTN_ENC 63
  457. #elif ENABLED(PANEL_ONE)
  458. #define BTN_EN1 59 // AUX2 PIN 3
  459. #define BTN_EN2 63 // AUX2 PIN 4
  460. #define BTN_ENC 49 // AUX3 PIN 7
  461. #else
  462. #define BTN_EN1 37
  463. #define BTN_EN2 35
  464. #define BTN_ENC 31
  465. #endif
  466. #if ENABLED(G3D_PANEL)
  467. #define SD_DETECT_PIN 49
  468. #define KILL_PIN 41
  469. #endif
  470. #endif
  471. #endif // NEWPANEL
  472. #endif // HAS_SPI_LCD