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

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