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 14KB

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