My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

pins_RAMPS.h 13KB

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