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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. #ifdef IS_RAMPS_13
  53. #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI
  54. #else
  55. #define SERVO0_PIN 11
  56. #endif
  57. #define SERVO1_PIN 6
  58. #define SERVO2_PIN 5
  59. #define SERVO3_PIN 4
  60. #define X_STEP_PIN 54
  61. #define X_DIR_PIN 55
  62. #define X_ENABLE_PIN 38
  63. #define X_MIN_PIN 3
  64. #ifndef X_MAX_PIN
  65. #define X_MAX_PIN 2
  66. #endif
  67. #define Y_STEP_PIN 60
  68. #define Y_DIR_PIN 61
  69. #define Y_ENABLE_PIN 56
  70. #define Y_MIN_PIN 14
  71. #define Y_MAX_PIN 15
  72. #define Z_STEP_PIN 46
  73. #define Z_DIR_PIN 48
  74. #define Z_ENABLE_PIN 62
  75. #define Z_MIN_PIN 18
  76. #define Z_MAX_PIN 19
  77. #define E0_STEP_PIN 26
  78. #define E0_DIR_PIN 28
  79. #define E0_ENABLE_PIN 24
  80. #define E1_STEP_PIN 36
  81. #define E1_DIR_PIN 34
  82. #define E1_ENABLE_PIN 30
  83. #define SDSS 53
  84. #define LED_PIN 13
  85. // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
  86. #define FILWIDTH_PIN 5 // ANALOG NUMBERING
  87. #if ENABLED(Z_MIN_PROBE_ENDSTOP)
  88. // Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
  89. #define Z_MIN_PROBE_PIN 32
  90. #endif
  91. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  92. #define FIL_RUNOUT_PIN 4
  93. #define PS_ON_PIN 12
  94. #define TEMP_0_PIN 13 // ANALOG NUMBERING
  95. #define TEMP_1_PIN 15 // ANALOG NUMBERING
  96. #define TEMP_BED_PIN 14 // ANALOG NUMBERING
  97. #if ENABLED(Z_PROBE_SLED)
  98. #define SLED_PIN -1
  99. #endif
  100. /*
  101. // Augmentation for auto-assigning RAMPS plugs
  102. #if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF)
  103. #if HOTENDS > 1
  104. #if TEMP_SENSOR_BED
  105. #define IS_RAMPS_EEB
  106. #else
  107. #define IS_RAMPS_EEF
  108. #endif
  109. #elif TEMP_SENSOR_BED
  110. #define IS_RAMPS_EFB
  111. #else
  112. #define IS_RAMPS_EFF
  113. #endif
  114. #endif
  115. */
  116. /**
  117. * Hi Voltage PWM Pin Assignments
  118. */
  119. #ifndef HI_VOLT_PIN_D
  120. #define HI_VOLT_PIN_D -1
  121. #endif
  122. #ifndef HI_VOLT_PIN_C
  123. #define HI_VOLT_PIN_C 8
  124. #endif
  125. #ifndef HI_VOLT_PIN_B
  126. #define HI_VOLT_PIN_B 9
  127. #endif
  128. #ifndef HI_VOLT_PIN_A
  129. #define HI_VOLT_PIN_A 10
  130. #endif
  131. #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
  132. #define HEATER_0_PIN HI_VOLT_PIN_A
  133. #define FAN_PIN HI_VOLT_PIN_B
  134. #define HEATER_BED_PIN HI_VOLT_PIN_C
  135. #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
  136. #define HEATER_0_PIN HI_VOLT_PIN_A
  137. #define HEATER_1_PIN HI_VOLT_PIN_B
  138. #define FAN_PIN HI_VOLT_PIN_C
  139. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  140. #define HEATER_0_PIN HI_VOLT_PIN_A
  141. #define HEATER_1_PIN HI_VOLT_PIN_B
  142. #define HEATER_BED_PIN HI_VOLT_PIN_C
  143. #define FAN_PIN 4 // IO pin. Buffer needed
  144. #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan (EFF is reversed?)
  145. #define HEATER_0_PIN HI_VOLT_PIN_C
  146. #define FAN_PIN HI_VOLT_PIN_B
  147. #define FAN1_PIN HI_VOLT_PIN_A
  148. #define CONTROLLERFAN_PIN -1
  149. #elif ENABLED(IS_RAMPS_SF) // Spindle, Fan
  150. #define FAN_PIN HI_VOLT_PIN_C
  151. #else // Non-specific are "EFB" by legacy
  152. #define HEATER_0_PIN HI_VOLT_PIN_A
  153. #define FAN_PIN HI_VOLT_PIN_B
  154. #define HEATER_BED_PIN HI_VOLT_PIN_C
  155. #if HOTENDS == 1
  156. #define FAN1_PIN HI_VOLT_PIN_D
  157. #else
  158. #define HEATER_1_PIN HI_VOLT_PIN_D
  159. #endif
  160. #endif
  161. /**
  162. * LCD Controller Pin Assignments
  163. */
  164. #if ENABLED(ULTRA_LCD)
  165. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  166. #define LCD_PINS_RS 49 //CS chip select /SS chip slave select
  167. #define LCD_PINS_ENABLE 51 //SID (MOSI)
  168. #define LCD_PINS_D4 52 //SCK (CLK) clock
  169. #elif ENABLED(NEWPANEL) && ENABLED(PANEL_ONE)
  170. #define LCD_PINS_RS 40
  171. #define LCD_PINS_ENABLE 42
  172. #define LCD_PINS_D4 65
  173. #define LCD_PINS_D5 66
  174. #define LCD_PINS_D6 44
  175. #define LCD_PINS_D7 64
  176. #else
  177. #define LCD_PINS_RS 16
  178. #define LCD_PINS_ENABLE 17
  179. #define LCD_PINS_D4 23
  180. #define LCD_PINS_D5 25
  181. #define LCD_PINS_D6 27
  182. #define LCD_PINS_D7 29
  183. #if DISABLED(NEWPANEL)
  184. #define BEEPER_PIN 33
  185. // Buttons are attached to a shift register
  186. // Not wired yet
  187. //#define SHIFT_CLK 38
  188. //#define SHIFT_LD 42
  189. //#define SHIFT_OUT 40
  190. //#define SHIFT_EN 17
  191. #endif
  192. #endif
  193. #if ENABLED(NEWPANEL)
  194. #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
  195. #define BEEPER_PIN 37
  196. #define BTN_EN1 31
  197. #define BTN_EN2 33
  198. #define BTN_ENC 35
  199. #define SD_DETECT_PIN 49
  200. #define KILL_PIN 41
  201. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  202. #define LCD_PIN_BL 39
  203. #endif
  204. #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  205. #define BTN_EN1 64
  206. #define BTN_EN2 59
  207. #define BTN_ENC 63
  208. #define SD_DETECT_PIN 42
  209. #elif ENABLED(LCD_I2C_PANELOLU2)
  210. #define BTN_EN1 47 // reverse if the encoder turns the wrong way.
  211. #define BTN_EN2 43
  212. #define BTN_ENC 32
  213. #define LCD_SDSS 53
  214. #define SD_DETECT_PIN -1
  215. #define KILL_PIN 41
  216. #elif ENABLED(LCD_I2C_VIKI)
  217. #define BTN_EN1 22 // reverse if the encoder turns the wrong way.
  218. #define BTN_EN2 7 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf
  219. // tells about 40/42.
  220. // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13.
  221. #define BTN_ENC -1
  222. #define LCD_SDSS 53
  223. #define SD_DETECT_PIN 49
  224. #elif ENABLED(VIKI2) || ENABLED(miniVIKI)
  225. #define BEEPER_PIN 33
  226. // Pins for DOGM SPI LCD Support
  227. #define DOGLCD_A0 44
  228. #define DOGLCD_CS 45
  229. #define LCD_SCREEN_ROT_180
  230. #define BTN_EN1 22
  231. #define BTN_EN2 7
  232. #define BTN_ENC 39
  233. #define SDSS 53
  234. #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board
  235. #define KILL_PIN 31
  236. #if ENABLED(TEMP_STAT_LEDS)
  237. #define STAT_LED_RED 32
  238. #define STAT_LED_BLUE 35
  239. #endif
  240. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  241. #define BTN_EN1 35 // reverse if the encoder turns the wrong way.
  242. #define BTN_EN2 37
  243. #define BTN_ENC 31
  244. #define SD_DETECT_PIN 49
  245. #define LCD_SDSS 53
  246. #define KILL_PIN 41
  247. #define BEEPER_PIN 23
  248. #define DOGLCD_CS 29
  249. #define DOGLCD_A0 27
  250. #define LCD_PIN_BL 33
  251. #elif ENABLED(MINIPANEL)
  252. #define BEEPER_PIN 42
  253. // Pins for DOGM SPI LCD Support
  254. #define DOGLCD_A0 44
  255. #define DOGLCD_CS 66
  256. #define LCD_PIN_BL 65 // backlight LED on A11/D65
  257. #define SDSS 53
  258. #define KILL_PIN 64
  259. // GLCD features
  260. //#define LCD_CONTRAST 190
  261. // Uncomment screen orientation
  262. //#define LCD_SCREEN_ROT_90
  263. //#define LCD_SCREEN_ROT_180
  264. //#define LCD_SCREEN_ROT_270
  265. //The encoder and click button
  266. #define BTN_EN1 40
  267. #define BTN_EN2 63
  268. #define BTN_ENC 59
  269. //not connected to a pin
  270. #define SD_DETECT_PIN 49
  271. #else
  272. // Beeper on AUX-4
  273. #define BEEPER_PIN 33
  274. // buttons are directly attached using AUX-2
  275. #if ENABLED(REPRAPWORLD_KEYPAD)
  276. #define BTN_EN1 64 // encoder
  277. #define BTN_EN2 59 // encoder
  278. #define BTN_ENC 63 // enter button
  279. #define SHIFT_OUT 40 // shift register
  280. #define SHIFT_CLK 44 // shift register
  281. #define SHIFT_LD 42 // shift register
  282. #elif ENABLED(PANEL_ONE)
  283. #define BTN_EN1 59 // AUX2 PIN 3
  284. #define BTN_EN2 63 // AUX2 PIN 4
  285. #define BTN_ENC 49 // AUX3 PIN 7
  286. #else
  287. #define BTN_EN1 37
  288. #define BTN_EN2 35
  289. #define BTN_ENC 31 // the click
  290. #endif
  291. #if ENABLED(G3D_PANEL)
  292. #define SD_DETECT_PIN 49
  293. #define KILL_PIN 41
  294. #else
  295. // #define SD_DETECT_PIN -1 // Ramps doesn't use this
  296. #endif
  297. #endif
  298. #endif // NEWPANEL
  299. #endif // ULTRA_LCD
  300. // SPI for Max6675 or Max31855 Thermocouple
  301. #if DISABLED(SDSUPPORT)
  302. #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card
  303. #else
  304. #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
  305. #endif