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

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