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_RE_ARM.h 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  5. *
  6. * Based on Sprinter and grbl.
  7. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. /**
  24. * Re-ARM with RAMPS v1.4 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. */
  35. // numbers in parenthesis () are the mega2560 equivalent pin numbers
  36. #ifndef TARGET_LPC1768
  37. #error "Oops! Make sure you have LPC1768 selected."
  38. #endif
  39. #ifndef BOARD_NAME
  40. #define BOARD_NAME "Re-ARM RAMPS 1.4"
  41. #endif
  42. //
  43. // Servos
  44. //
  45. #define SERVO0_PIN P1_20 // (11)
  46. #define SERVO1_PIN P1_21 // ( 6) also on J5-1
  47. #define SERVO2_PIN P1_19 // ( 5)
  48. #define SERVO3_PIN P1_18 // ( 4) 5V output
  49. //
  50. // Limit Switches
  51. //
  52. #define X_MIN_PIN P1_24 // ( 3) 10k pullup to 3.3V, 1K series
  53. #define X_MAX_PIN P1_25 // ( 2) 10k pullup to 3.3V, 1K series
  54. #define Y_MIN_PIN P1_26 // (14) 10k pullup to 3.3V, 1K series
  55. #define Y_MAX_PIN P1_27 // (15) 10k pullup to 3.3V, 1K series
  56. #define Z_MIN_PIN P1_29 // (18) 10k pullup to 3.3V, 1K series
  57. #define Z_MAX_PIN P1_28 // (19) 10k pullup to 3.3V, 1K series
  58. //
  59. // Steppers
  60. //
  61. #define X_STEP_PIN P2_1 // (54)
  62. #define X_DIR_PIN P0_11 // (55)
  63. #define X_ENABLE_PIN P0_10 // (38)
  64. #define Y_STEP_PIN P2_2 // (60)
  65. #define Y_DIR_PIN P0_20 // (61)
  66. #define Y_ENABLE_PIN P0_19 // (56)
  67. #define Z_STEP_PIN P2_3 // (46)
  68. #define Z_DIR_PIN P0_22 // (48)
  69. #define Z_ENABLE_PIN P0_21 // (62)
  70. #define E0_STEP_PIN P2_0 // (26)
  71. #define E0_DIR_PIN P0_5 // (28)
  72. #define E0_ENABLE_PIN P0_4 // (24)
  73. #define E1_STEP_PIN P2_8 // (36)
  74. #define E1_DIR_PIN P2_13 // (34)
  75. #define E1_ENABLE_PIN P4_29 // (30)
  76. #define E2_STEP_PIN P2_8 // (36)
  77. #define E2_DIR_PIN P2_13 // (34)
  78. #define E2_ENABLE_PIN P4_29 // (30)
  79. //
  80. // Temperature Sensors
  81. // 3.3V max when defined as an analog input
  82. //
  83. #define TEMP_0_PIN 0 //A0 (T0) - (67) - TEMP_0_PIN
  84. #define TEMP_BED_PIN 1 //A1 (T1) - (68) - TEMP_BED_PIN
  85. #define TEMP_1_PIN 2 //A2 (T2) - (69) - TEMP_1_PIN
  86. #define TEMP_2_PIN 3 //A3 - (63) - J5-3 & AUX-2
  87. #define TEMP_3_PIN 4 //A4 - (37) - BUZZER_PIN
  88. //#define TEMP_4_PIN 5 //A5 - (49) - SD_DETECT_PIN
  89. //#define ?? 6 //A6 - ( 0) - RXD0 - J4-4 & AUX-1
  90. #define FILWIDTH_PIN 7 //A7 - ( 1) - TXD0 - J4-5 & AUX-1
  91. //
  92. // Augmentation for auto-assigning RAMPS plugs
  93. //
  94. #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)
  95. #if HOTENDS > 1
  96. #if TEMP_SENSOR_BED
  97. #define IS_RAMPS_EEB
  98. #else
  99. #define IS_RAMPS_EEF
  100. #endif
  101. #elif TEMP_SENSOR_BED
  102. #define IS_RAMPS_EFB
  103. #else
  104. #define IS_RAMPS_EFF
  105. #endif
  106. #endif
  107. //
  108. // Heaters / Fans
  109. //
  110. #ifndef MOSFET_D_PIN
  111. #define MOSFET_D_PIN -1
  112. #endif
  113. #ifndef RAMPS_D8_PIN
  114. #define RAMPS_D8_PIN P2_7 // (8)
  115. #endif
  116. #ifndef RAMPS_D9_PIN
  117. #define RAMPS_D9_PIN P2_4 // (9)
  118. #endif
  119. #ifndef RAMPS_D10_PIN
  120. #define RAMPS_D10_PIN P2_5 // (10)
  121. #endif
  122. #define HEATER_0_PIN RAMPS_D10_PIN
  123. #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
  124. #define FAN_PIN RAMPS_D9_PIN
  125. #define HEATER_BED_PIN RAMPS_D8_PIN
  126. #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
  127. #define HEATER_1_PIN RAMPS_D9_PIN
  128. #define FAN_PIN RAMPS_D8_PIN
  129. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  130. #define HEATER_1_PIN RAMPS_D9_PIN
  131. #define HEATER_BED_PIN RAMPS_D8_PIN
  132. #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan
  133. #define FAN_PIN RAMPS_D9_PIN
  134. #define FAN1_PIN RAMPS_D8_PIN
  135. #elif ENABLED(IS_RAMPS_SF) // Spindle, Fan
  136. #define FAN_PIN RAMPS_D8_PIN
  137. #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  138. #define FAN_PIN RAMPS_D9_PIN
  139. #define HEATER_BED_PIN RAMPS_D8_PIN
  140. #if HOTENDS == 1
  141. #define FAN1_PIN MOSFET_D_PIN
  142. #else
  143. #define HEATER_1_PIN MOSFET_D_PIN
  144. #endif
  145. #endif
  146. #ifndef FAN_PIN
  147. #define FAN_PIN P1_18 // (4) IO pin. Buffer needed
  148. #endif
  149. //
  150. // Misc. Functions
  151. //
  152. #define LED_PIN P4_28 // (13)
  153. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  154. #define FIL_RUNOUT_PIN P1_18 // (4)
  155. #define PS_ON_PIN P2_12 // (12)
  156. #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
  157. #if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // try to use servo connector
  158. #define CASE_LIGHT_PIN P1_18 // (4) MUST BE HARDWARE PWM
  159. #endif
  160. #endif
  161. //
  162. // M3/M4/M5 - Spindle/Laser Control
  163. //
  164. #if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE)
  165. #if !defined(NUM_SERVOS) || NUM_SERVOS == 1 // must use servo connector
  166. #undef SERVO1
  167. #undef SERVO2
  168. #undef SERVO3
  169. #define SPINDLE_LASER_ENABLE_PIN P1_21 // (6) Pin should have a pullup/pulldown!
  170. #define SPINDLE_LASER_PWM_PIN P1_18 // (4) MUST BE HARDWARE PWM
  171. #define SPINDLE_DIR_PIN P1_19 // (5)
  172. #endif
  173. #endif
  174. //
  175. // Průša i3 MK2 Multiplexer Support
  176. //
  177. #define E_MUX0_PIN P0_3 // ( 0) Z_CS_PIN
  178. #define E_MUX1_PIN P0_2 // ( 1) E0_CS_PIN
  179. #define E_MUX2_PIN P0_26 // (63) E1_CS_PIN
  180. /**
  181. * LCD / Controller
  182. *
  183. * All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required.
  184. */
  185. /**
  186. * Smart LCD adapter
  187. *
  188. * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as
  189. * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use
  190. * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable
  191. * is needed to pick up 5V for the EXP1 connection.
  192. *
  193. * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines
  194. * on the LCD display during accesses of the SD card. The menus/code has been arranged so
  195. * that the garbage/lines are erased immediately after the SD card accesses are completed.
  196. */
  197. #if ENABLED(ULTRA_LCD)
  198. #define BEEPER_PIN P1_30 // (37) not 5V tolerant
  199. #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
  200. #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
  201. #define BTN_ENC P2_11 // (35) J3-3 & AUX-4
  202. #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  203. #define KILL_PIN P1_22 // (41) J5-4 & AUX-4
  204. #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4
  205. #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4
  206. #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
  207. #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3
  208. #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3
  209. #define DOGLCD_A0 P2_6 // (59) J3-8 & AUX-2
  210. #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2
  211. #ifdef ULTIPANEL
  212. #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO
  213. #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER
  214. #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1
  215. #endif
  216. #if ENABLED(NEWPANEL)
  217. #if ENABLED(REPRAPWORLD_KEYPAD)
  218. #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3
  219. #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3
  220. #define SHIFT_LD P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  221. #endif
  222. #else
  223. //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4
  224. //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4
  225. //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4
  226. //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4
  227. #endif
  228. #if ENABLED(VIKI2) || ENABLED(miniVIKI)
  229. // #define LCD_SCREEN_ROT_180
  230. #undef BEEPER_PIN
  231. #define BEEPER_PIN P1_30 // (37) may change if cable changes
  232. #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
  233. #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
  234. #define BTN_ENC P2_11 // (35) J3-3 & AUX-4
  235. #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  236. #define KILL_PIN P1_22 // (41) J5-4 & AUX-4
  237. #undef DOGLCD_CS
  238. #define DOGLCD_CS P0_16 // (16)
  239. #undef LCD_BACKLIGHT_PIN //P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
  240. #undef LCD_PINS_ENABLE //P0_18 // (51) (MOSI) J3-10 & AUX-3
  241. #undef LCD_PINS_D4 //P0_15 // (52) (SCK) J3-9 & AUX-3
  242. #undef LCD_PINS_D5 //P2_6 // (59) J3-8 & AUX-2
  243. #define DOGLCD_A0 P2_6 // (59) J3-8 & AUX-2
  244. #undef LCD_PINS_D6 //P0_26 // (63) J5-3 & AUX-2
  245. #undef LCD_PINS_D7 //P1_21 // ( 6) (SERVO1) J5-1 & SERVO connector
  246. #define DOGLCD_SCK SCK_PIN
  247. #define DOGLCD_MOSI MOSI_PIN
  248. #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes
  249. #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes
  250. #endif
  251. //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3
  252. //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3
  253. //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3
  254. //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 - sometimes called SDSS
  255. #if ENABLED(MINIPANEL)
  256. // GLCD features
  257. //#define LCD_CONTRAST 190
  258. // Uncomment screen orientation
  259. //#define LCD_SCREEN_ROT_90
  260. //#define LCD_SCREEN_ROT_180
  261. //#define LCD_SCREEN_ROT_270
  262. #endif
  263. #endif // ULTRA_LCD
  264. //
  265. // Ethernet pins
  266. //
  267. #ifndef ULTIPANEL
  268. #define ENET_MDIO P1_17 // (71) J12-4
  269. #define ENET_RX_ER P1_14 // (73) J12-6
  270. #define ENET_RXD1 P1_10 // (75) J12-8
  271. #endif
  272. #define ENET_MOC P1_16 // (70) J12-3
  273. #define REF_CLK P1_15 // (72) J12-5
  274. #define ENET_RXD0 P1_9 // (74) J12-7
  275. #define ENET_CRS P1_8 // (76) J12-9
  276. #define ENET_TX_EN P1_4 // (77) J12-10
  277. #define ENET_TXD0 P1_0 // (78) J12-11
  278. #define ENET_TXD1 P1_1 // (79) J12-12
  279. /**
  280. * Fast PWMS
  281. *
  282. * The LPC1768's hardware PWM controller has 6 channels. Each channel
  283. * can be setup to either control a dedicated pin directly or to generate
  284. * an interrupt. The direct method's duty cycle is accurate to within a
  285. * a microsecond. The interrupt method's average duty cycle has the
  286. * the same accuracy but the individual cycles can vary because of higher
  287. * priority interrupts.
  288. *
  289. * All Fast PWMs have a 50Hz rate.
  290. *
  291. * The following pins/signals use the direct method. All other pins use the
  292. * the interrupt method. Note that SERVO2_PIN and RAMPS_D8_PIN use the
  293. * interrupt method.
  294. * P1_20 (11) SERVO0_PIN
  295. * P1_21 ( 6) SERVO1_PIN J5-1
  296. * P0_18 ( 4) SERVO3_PIN 5V output
  297. * *P2_4 ( 9) RAMPS_D9_PIN
  298. * *P2_5 (10) RAMPS_D10_PIN
  299. *
  300. * * - If used as a heater driver then a Fast PWM is NOT assigned. If used as
  301. * a fan driver then enabling FAST_PWM_FAN assigns a Fast PWM to it.
  302. */
  303. /**
  304. * special pins
  305. * P1_30 (37) - not 5V tolerant
  306. * P1_31 (49) - not 5V tolerant
  307. * P0_27 (57) - open collector
  308. * P0_28 (58) - open collector
  309. *
  310. */
  311. /**
  312. * The following mega2560 pins are NOT available in a Re-ARM system
  313. * 7
  314. * 17
  315. * 22
  316. * 23
  317. * 25
  318. * 27
  319. * 29
  320. * 32
  321. * 39
  322. * 40
  323. * 42
  324. * 43
  325. * 44
  326. * 45
  327. * 47
  328. * 64
  329. * 65
  330. * 66
  331. */