Guest User

Untitled

a guest
Mar 19th, 2017
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. /**
  24. * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments
  25. *
  26. * Applies to the following boards:
  27. *
  28. * RAMPS_14_EFB (Hotend, Fan, Bed)
  29. * RAMPS_14_EEB (Hotend0, Hotend1, Bed)
  30. * RAMPS_14_EFF (Hotend, Fan0, Fan1)
  31. * RAMPS_14_EEF (Hotend0, Hotend1, Fan)
  32. * RAMPS_14_SF (Spindle, Controller Fan)
  33. *
  34. * RAMPS_13_EFB (Hotend, Fan, Bed)
  35. * RAMPS_13_EEB (Hotend0, Hotend1, Bed)
  36. * RAMPS_13_EFF (Hotend, Fan0, Fan1)
  37. * RAMPS_13_EEF (Hotend0, Hotend1, Fan)
  38. * RAMPS_13_SF (Spindle, Controller Fan)
  39. *
  40. * Other pins_MYBOARD.h files may override these defaults
  41. *
  42. * Differences between
  43. * RAMPS_13 | RAMPS_14
  44. * 7 | 11
  45. */
  46.  
  47. #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
  48. #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
  49. #endif
  50.  
  51. #ifndef BOARD_NAME
  52. #define BOARD_NAME "RAMPS 1.4"
  53. #endif
  54.  
  55. #define LARGE_FLASH true
  56.  
  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. #define SERVO3_PIN 4
  68.  
  69. //
  70. // Limit Switches
  71. //
  72. #define X_MIN_PIN 3
  73. #ifndef X_MAX_PIN
  74. #define X_MAX_PIN -1 //2 desconectat
  75. #endif
  76. #define Y_MIN_PIN 14
  77. #define Y_MAX_PIN -1 // 15
  78. #define Z_MIN_PIN 18
  79. #define Z_MAX_PIN -1 //19
  80.  
  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. #define SLED_PIN -1
  89.  
  90. //
  91. // Steppers
  92. //
  93. #define X_STEP_PIN 54
  94. #define X_DIR_PIN 55
  95. #define X_ENABLE_PIN 38
  96. #define X_CS_PIN 53
  97.  
  98. #define Y_STEP_PIN 60
  99. #define Y_DIR_PIN 61
  100. #define Y_ENABLE_PIN 56
  101. #define Y_CS_PIN 49
  102.  
  103. #define Z_STEP_PIN 46
  104. #define Z_DIR_PIN 48
  105. #define Z_ENABLE_PIN 62
  106. #define Z_CS_PIN 40
  107.  
  108. #define E0_STEP_PIN 26
  109. #define E0_DIR_PIN 28
  110. #define E0_ENABLE_PIN 24
  111. #define E0_CS_PIN 42
  112.  
  113. #define E1_STEP_PIN 36
  114. #define E1_DIR_PIN 34
  115. #define E1_ENABLE_PIN 30
  116. #define E1_CS_PIN 44
  117.  
  118. //
  119. // Temperature Sensors
  120. //
  121. #define TEMP_0_PIN 13 // Analog Input
  122. #define TEMP_1_PIN 15 // Analog Input
  123. #define TEMP_BED_PIN 14 // Analog Input
  124.  
  125. // SPI for Max6675 or Max31855 Thermocouple
  126. #if DISABLED(SDSUPPORT)
  127. #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
  128. #else
  129. #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
  130. #endif
  131.  
  132. //
  133. // Augmentation for auto-assigning RAMPS plugs
  134. //
  135. #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)
  136. #if HOTENDS > 1
  137. #if TEMP_SENSOR_BED
  138. #define IS_RAMPS_EEB
  139. #else
  140. #define IS_RAMPS_EEF
  141. #endif
  142. #elif TEMP_SENSOR_BED
  143. #define IS_RAMPS_EFB
  144. #else
  145. #define IS_RAMPS_EFF
  146. #endif
  147. #endif
  148.  
  149. //
  150. // Heaters / Fans
  151. //
  152. #ifndef MOSFET_D_PIN
  153. #define MOSFET_D_PIN -1
  154. #endif
  155. #ifndef RAMPS_D8_PIN
  156. #define RAMPS_D8_PIN 8
  157. #endif
  158. #ifndef RAMPS_D9_PIN
  159. #define RAMPS_D9_PIN 9
  160. #endif
  161. #ifndef RAMPS_D10_PIN
  162. #define RAMPS_D10_PIN 10
  163. #endif
  164.  
  165. #define HEATER_0_PIN RAMPS_D10_PIN
  166.  
  167. #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
  168. #define FAN_PIN RAMPS_D9_PIN
  169. #define HEATER_BED_PIN RAMPS_D8_PIN
  170. #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
  171. #define HEATER_1_PIN RAMPS_D9_PIN
  172. #define FAN_PIN RAMPS_D8_PIN
  173. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  174. #define HEATER_1_PIN RAMPS_D9_PIN
  175. #define HEATER_BED_PIN RAMPS_D8_PIN
  176. #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan
  177. #define FAN_PIN RAMPS_D9_PIN
  178. #define FAN1_PIN RAMPS_D8_PIN
  179. #elif ENABLED(IS_RAMPS_SF) // Spindle, Fan
  180. #define FAN_PIN RAMPS_D8_PIN
  181. #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  182. #define FAN_PIN RAMPS_D9_PIN
  183. #define HEATER_BED_PIN RAMPS_D8_PIN
  184. #if HOTENDS == 1
  185. #define FAN1_PIN MOSFET_D_PIN
  186. #else
  187. #define HEATER_1_PIN MOSFET_D_PIN
  188. #endif
  189. #endif
  190.  
  191. #ifndef FAN_PIN
  192. #define FAN_PIN 4 // IO pin. Buffer needed
  193. #endif
  194.  
  195. //
  196. // Misc. Functions
  197. //
  198. #define SDSS 53
  199. #define LED_PIN 13
  200.  
  201. // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
  202. #define FILWIDTH_PIN 5 // Analog Input
  203.  
  204. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  205. #define FIL_RUNOUT_PIN 4
  206.  
  207. #define PS_ON_PIN 12
  208.  
  209. //
  210. // LCD / Controller
  211. //
  212. #if ENABLED(ULTRA_LCD)
  213.  
  214. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  215. #define LCD_PINS_RS 49 // CS chip select /SS chip slave select
  216. #define LCD_PINS_ENABLE 51 // SID (MOSI)
  217. #define LCD_PINS_D4 52 // SCK (CLK) clock
  218. #elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE)
  219. #define LCD_PINS_RS 40
  220. #define LCD_PINS_ENABLE 42
  221. #define LCD_PINS_D4 65
  222. #define LCD_PINS_D5 66
  223. #define LCD_PINS_D6 44
  224. #define LCD_PINS_D7 64
  225. #else
  226. #define LCD_PINS_RS 16
  227. #define LCD_PINS_ENABLE 17
  228. #define LCD_PINS_D4 23
  229. #define LCD_PINS_D5 25
  230. #define LCD_PINS_D6 27
  231. #define LCD_PINS_D7 29
  232. #if DISABLED(NEWPANEL)
  233. #define BEEPER_PIN 33
  234. // Buttons are attached to a shift register
  235. // Not wired yet
  236. //#define SHIFT_CLK 38
  237. //#define SHIFT_LD 42
  238. //#define SHIFT_OUT 40
  239. //#define SHIFT_EN 17
  240. #endif
  241. #endif
  242.  
  243. #if ENABLED(NEWPANEL)
  244.  
  245. #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
  246. #define BEEPER_PIN 37
  247.  
  248. #define BTN_EN1 31
  249. #define BTN_EN2 33
  250. #define BTN_ENC 35
  251.  
  252. #define SD_DETECT_PIN 49
  253. #define KILL_PIN 41
  254.  
  255. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  256. #define LCD_BACKLIGHT_PIN 39
  257. #endif
  258.  
  259. #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  260. #define BTN_EN1 64
  261. #define BTN_EN2 59
  262. #define BTN_ENC 63
  263. #define SD_DETECT_PIN 42
  264. #elif ENABLED(LCD_I2C_PANELOLU2)
  265. #define BTN_EN1 47 // reverse if the encoder turns the wrong way.
  266. #define BTN_EN2 43
  267. #define BTN_ENC 32
  268. #define LCD_SDSS 53
  269. #define SD_DETECT_PIN -1
  270. #define KILL_PIN 41
  271. #elif ENABLED(LCD_I2C_VIKI)
  272. #define BTN_EN1 22 // reverse if the encoder turns the wrong way.
  273. #define BTN_EN2 7 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf
  274. // tells about 40/42.
  275. // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13.
  276. #define BTN_ENC -1
  277. #define LCD_SDSS 53
  278. #define SD_DETECT_PIN 49
  279. #elif ENABLED(VIKI2) || ENABLED(miniVIKI)
  280. #define BEEPER_PIN 33
  281.  
  282. // Pins for DOGM SPI LCD Support
  283. #define DOGLCD_A0 44
  284. #define DOGLCD_CS 45
  285. #define LCD_SCREEN_ROT_180
  286.  
  287. #define BTN_EN1 22
  288. #define BTN_EN2 7
  289. #define BTN_ENC 39
  290.  
  291. #define SDSS 53
  292. #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board
  293.  
  294. #define KILL_PIN 31
  295.  
  296. #define STAT_LED_RED_PIN 32
  297. #define STAT_LED_BLUE_PIN 35
  298.  
  299. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  300. #define BTN_EN1 35 // reverse if the encoder turns the wrong way.
  301. #define BTN_EN2 37
  302. #define BTN_ENC 31
  303. #define SD_DETECT_PIN 49
  304. #define LCD_SDSS 53
  305. #define KILL_PIN 41
  306. #define BEEPER_PIN 23
  307. #define DOGLCD_CS 29
  308. #define DOGLCD_A0 27
  309. #define LCD_BACKLIGHT_PIN 33
  310. #elif ENABLED(MINIPANEL)
  311. #define BEEPER_PIN 42
  312. // Pins for DOGM SPI LCD Support
  313. #define DOGLCD_A0 44
  314. #define DOGLCD_CS 66
  315. #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
  316. #define SDSS 53
  317.  
  318. #define KILL_PIN 64
  319. // GLCD features
  320. //#define LCD_CONTRAST 190
  321. // Uncomment screen orientation
  322. //#define LCD_SCREEN_ROT_90
  323. //#define LCD_SCREEN_ROT_180
  324. //#define LCD_SCREEN_ROT_270
  325. // The encoder and click button
  326. #define BTN_EN1 40
  327. #define BTN_EN2 63
  328. #define BTN_ENC 59
  329. // not connected to a pin
  330. #define SD_DETECT_PIN 49
  331.  
  332. #else
  333.  
  334. // Beeper on AUX-4
  335. #define BEEPER_PIN 33
  336.  
  337. // buttons are directly attached using AUX-2
  338. #if ENABLED(REPRAPWORLD_KEYPAD)
  339. #define BTN_EN1 64 // encoder
  340. #define BTN_EN2 59 // encoder
  341. #define BTN_ENC 63 // enter button
  342. #define SHIFT_OUT 40 // shift register
  343. #define SHIFT_CLK 44 // shift register
  344. #define SHIFT_LD 42 // shift register
  345. #elif ENABLED(PANEL_ONE)
  346. #define BTN_EN1 59 // AUX2 PIN 3
  347. #define BTN_EN2 63 // AUX2 PIN 4
  348. #define BTN_ENC 49 // AUX3 PIN 7
  349. #else
  350. #define BTN_EN1 37
  351. #define BTN_EN2 35
  352. #define BTN_ENC 31 // the click
  353. #endif
  354.  
  355. #if ENABLED(G3D_PANEL)
  356. #define SD_DETECT_PIN 49
  357. #define KILL_PIN 41
  358. #else
  359. //#define SD_DETECT_PIN -1 // Ramps doesn't use this
  360. #endif
  361.  
  362. #endif
  363. #endif // NEWPANEL
  364.  
  365. #endif // ULTRA_LCD
RAW Paste Data