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

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