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

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