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

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