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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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 the LPC1768 environment selected in your IDE."
  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_01 // (54)
  62. #define X_DIR_PIN P0_11 // (55)
  63. #define X_ENABLE_PIN P0_10 // (38)
  64. #ifndef X_CS_PIN
  65. #define X_CS_PIN P1_01 // ETH
  66. #endif
  67. #define Y_STEP_PIN P2_02 // (60)
  68. #define Y_DIR_PIN P0_20 // (61)
  69. #define Y_ENABLE_PIN P0_19 // (56)
  70. #ifndef Y_CS_PIN
  71. #define Y_CS_PIN P1_04 // ETH
  72. #endif
  73. #define Z_STEP_PIN P2_03 // (46)
  74. #define Z_DIR_PIN P0_22 // (48)
  75. #define Z_ENABLE_PIN P0_21 // (62)
  76. #ifndef Z_CS_PIN
  77. #define Z_CS_PIN P1_10 // ETH
  78. #endif
  79. #define E0_STEP_PIN P2_00 // (26)
  80. #define E0_DIR_PIN P0_05 // (28)
  81. #define E0_ENABLE_PIN P0_04 // (24)
  82. #ifndef E0_CS_PIN
  83. #define E0_CS_PIN P1_14 // ETH
  84. #endif
  85. #define E1_STEP_PIN P2_08 // (36)
  86. #define E1_DIR_PIN P2_13 // (34)
  87. #define E1_ENABLE_PIN P4_29 // (30)
  88. #ifndef E1_CS_PIN
  89. #define E1_CS_PIN -1
  90. #endif
  91. //#define E2_STEP_PIN P2_08 // (36)
  92. //#define E2_DIR_PIN P2_13 // (34)
  93. //#define E2_ENABLE_PIN P4_29 // (30)
  94. //#ifndef E2_CS_PIN
  95. // #define E2_CS_PIN -1
  96. //#endif
  97. //
  98. // Software SPI pins for TMC2130 stepper drivers
  99. //
  100. #if ENABLED(TMC_USE_SW_SPI)
  101. #define TMC_SW_MOSI P1_00 // ETH
  102. #define TMC_SW_MISO P1_08 // ETH
  103. #define TMC_SW_SCK P1_09 // ETH
  104. #endif
  105. //
  106. // Temperature Sensors
  107. // 3.3V max when defined as an analog input
  108. //
  109. #define TEMP_0_PIN 0 // A0 (T0) - (67) - TEMP_0_PIN
  110. #define TEMP_BED_PIN 1 // A1 (T1) - (68) - TEMP_BED_PIN
  111. #define TEMP_1_PIN 2 // A2 (T2) - (69) - TEMP_1_PIN
  112. #define TEMP_2_PIN 3 // A3 - (63) - J5-3 & AUX-2
  113. #define TEMP_3_PIN 4 // A4 - (37) - BUZZER_PIN
  114. //#define TEMP_4_PIN 5 // A5 - (49) - SD_DETECT_PIN
  115. //#define ?? 6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1
  116. #define FILWIDTH_PIN 7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1
  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 P2_07 // (8)
  141. #endif
  142. #ifndef RAMPS_D9_PIN
  143. #define RAMPS_D9_PIN P2_04 // (9)
  144. #endif
  145. #ifndef RAMPS_D10_PIN
  146. #define RAMPS_D10_PIN P2_05 // (10)
  147. #endif
  148. #define HEATER_0_PIN RAMPS_D10_PIN
  149. #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
  150. #define HEATER_BED_PIN RAMPS_D8_PIN
  151. #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
  152. #define HEATER_1_PIN RAMPS_D9_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 FAN1_PIN RAMPS_D8_PIN
  158. #elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
  159. #define HEATER_BED_PIN RAMPS_D8_PIN
  160. #if HOTENDS == 1
  161. #define FAN1_PIN MOSFET_D_PIN
  162. #else
  163. #define HEATER_1_PIN MOSFET_D_PIN
  164. #endif
  165. #endif
  166. #ifndef FAN_PIN
  167. #if ENABLED(IS_RAMPS_EFB) || ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
  168. #define FAN_PIN RAMPS_D9_PIN
  169. #elif ENABLED(IS_RAMPS_EEF) || ENABLED(IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan
  170. #define FAN_PIN RAMPS_D8_PIN
  171. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  172. #define FAN_PIN P1_18 // (4) IO pin. Buffer needed
  173. #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  174. #define FAN_PIN RAMPS_D9_PIN
  175. #endif
  176. #endif
  177. //
  178. // Misc. Functions
  179. //
  180. #define LED_PIN P4_28 // (13)
  181. #define SDSS P1_23 // (53)
  182. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  183. #ifndef FIL_RUNOUT_PIN
  184. #define FIL_RUNOUT_PIN P1_18 // (4)
  185. #endif
  186. #define PS_ON_PIN P2_12 // (12)
  187. #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
  188. #if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // try to use servo connector
  189. #define CASE_LIGHT_PIN P1_18 // (4) 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 == 1 // must use servo connector
  197. #undef SERVO1
  198. #undef SERVO2
  199. #undef SERVO3
  200. #define SPINDLE_LASER_ENABLE_PIN P1_21 // (6) Pin should have a pullup/pulldown!
  201. #define SPINDLE_LASER_PWM_PIN P1_18 // (4) MUST BE HARDWARE PWM
  202. #define SPINDLE_DIR_PIN P1_19 // (5)
  203. #endif
  204. #endif
  205. //
  206. // Průša i3 MK2 Multiplexer Support
  207. //
  208. #if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0
  209. #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN
  210. #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN
  211. #endif
  212. #define E_MUX2_PIN P0_26 // (63) E1_CS_PIN
  213. /**
  214. * LCD / Controller
  215. *
  216. * All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required.
  217. */
  218. /**
  219. * Smart LCD adapter
  220. *
  221. * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as
  222. * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use
  223. * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable
  224. * is needed to pick up 5V for the EXP1 connection.
  225. *
  226. * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines
  227. * on the LCD display during accesses of the SD card. The menus/code has been arranged so
  228. * that the garbage/lines are erased immediately after the SD card accesses are completed.
  229. */
  230. #if ENABLED(ULTRA_LCD)
  231. #define BEEPER_PIN P1_30 // (37) not 5V tolerant
  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. #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4
  238. #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4
  239. #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
  240. #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3
  241. #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3
  242. #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
  243. #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2
  244. #ifdef ULTIPANEL
  245. #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO
  246. #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER
  247. #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1
  248. #endif
  249. #if ENABLED(NEWPANEL)
  250. #if ENABLED(REPRAPWORLD_KEYPAD)
  251. #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3
  252. #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3
  253. #define SHIFT_LD P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  254. #endif
  255. #else
  256. //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4
  257. //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4
  258. //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4
  259. //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4
  260. #endif
  261. #if ENABLED(VIKI2) || ENABLED(miniVIKI)
  262. // #define LCD_SCREEN_ROT_180
  263. #undef BEEPER_PIN
  264. #define BEEPER_PIN P1_30 // (37) may change if cable changes
  265. #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
  266. #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
  267. #define BTN_ENC P2_11 // (35) J3-3 & AUX-4
  268. #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  269. #define KILL_PIN P1_22 // (41) J5-4 & AUX-4
  270. #undef DOGLCD_CS
  271. #define DOGLCD_CS P0_16 // (16)
  272. #undef LCD_BACKLIGHT_PIN //P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
  273. #undef LCD_PINS_ENABLE //P0_18 // (51) (MOSI) J3-10 & AUX-3
  274. #undef LCD_PINS_D4 //P0_15 // (52) (SCK) J3-9 & AUX-3
  275. #undef LCD_PINS_D5 //P2_06 // (59) J3-8 & AUX-2
  276. #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
  277. #undef LCD_PINS_D6 //P0_26 // (63) J5-3 & AUX-2
  278. #undef LCD_PINS_D7 //P1_21 // ( 6) (SERVO1) J5-1 & SERVO connector
  279. #define DOGLCD_SCK SCK_PIN
  280. #define DOGLCD_MOSI MOSI_PIN
  281. #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes
  282. #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes
  283. #endif
  284. //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3
  285. //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3
  286. //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3
  287. //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 - sometimes called SDSS
  288. #if ENABLED(MINIPANEL)
  289. // GLCD features
  290. //#define LCD_CONTRAST 190
  291. // Uncomment screen orientation
  292. //#define LCD_SCREEN_ROT_90
  293. //#define LCD_SCREEN_ROT_180
  294. //#define LCD_SCREEN_ROT_270
  295. #endif
  296. #endif // ULTRA_LCD
  297. //
  298. // Ethernet pins
  299. //
  300. #ifndef ULTIPANEL
  301. #define ENET_MDIO P1_17 // (71) J12-4
  302. #define ENET_RX_ER P1_14 // (73) J12-6
  303. #define ENET_RXD1 P1_10 // (75) J12-8
  304. #endif
  305. #define ENET_MOC P1_16 // (70) J12-3
  306. #define REF_CLK P1_15 // (72) J12-5
  307. #define ENET_RXD0 P1_09 // (74) J12-7
  308. #define ENET_CRS P1_08 // (76) J12-9
  309. #define ENET_TX_EN P1_04 // (77) J12-10
  310. #define ENET_TXD0 P1_00 // (78) J12-11
  311. #define ENET_TXD1 P1_01 // (79) J12-12
  312. /**
  313. * Fast PWMS
  314. *
  315. * The LPC1768's hardware PWM controller has 6 channels. Each channel
  316. * can be setup to either control a dedicated pin directly or to generate
  317. * an interrupt. The direct method's duty cycle is accurate to within a
  318. * a microsecond. The interrupt method's average duty cycle has the
  319. * the same accuracy but the individual cycles can vary because of higher
  320. * priority interrupts.
  321. *
  322. * All Fast PWMs have a 50Hz rate.
  323. *
  324. * The following pins/signals use the direct method. All other pins use the
  325. * the interrupt method. Note that SERVO2_PIN and RAMPS_D8_PIN use the
  326. * interrupt method.
  327. * P1_20 (11) SERVO0_PIN
  328. * P1_21 ( 6) SERVO1_PIN J5-1
  329. * P0_18 ( 4) SERVO3_PIN 5V output
  330. * *P2_04 ( 9) RAMPS_D9_PIN
  331. * *P2_05 (10) RAMPS_D10_PIN
  332. *
  333. * * - If used as a heater driver then a Fast PWM is NOT assigned. If used as
  334. * a fan driver then enabling FAST_PWM_FAN assigns a Fast PWM to it.
  335. */
  336. /**
  337. * special pins
  338. * P1_30 (37) - not 5V tolerant
  339. * P1_31 (49) - not 5V tolerant
  340. * P0_27 (57) - open collector
  341. * P0_28 (58) - open collector
  342. *
  343. */
  344. /**
  345. * The following mega2560 pins are NOT available in a Re-ARM system
  346. * 7
  347. * 17
  348. * 22
  349. * 23
  350. * 25
  351. * 27
  352. * 29
  353. * 32
  354. * 39
  355. * 40
  356. * 42
  357. * 43
  358. * 44
  359. * 45
  360. * 47
  361. * 64
  362. * 65
  363. * 66
  364. */