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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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 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 P1_18 // (4) IO pin. Buffer needed
  174. #endif
  175. //
  176. // Misc. Functions
  177. //
  178. #define LED_PIN P4_28 // (13)
  179. #define SDSS P1_23 // (53)
  180. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  181. #ifndef FIL_RUNOUT_PIN
  182. #define FIL_RUNOUT_PIN P1_18 // (4)
  183. #endif
  184. #define PS_ON_PIN P2_12 // (12)
  185. #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN)
  186. #if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // try to use servo connector
  187. #define CASE_LIGHT_PIN P1_18 // (4) MUST BE HARDWARE PWM
  188. #endif
  189. #endif
  190. //
  191. // M3/M4/M5 - Spindle/Laser Control
  192. //
  193. #if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE)
  194. #if !defined(NUM_SERVOS) || NUM_SERVOS == 1 // must use servo connector
  195. #undef SERVO1
  196. #undef SERVO2
  197. #undef SERVO3
  198. #define SPINDLE_LASER_ENABLE_PIN P1_21 // (6) Pin should have a pullup/pulldown!
  199. #define SPINDLE_LASER_PWM_PIN P1_18 // (4) MUST BE HARDWARE PWM
  200. #define SPINDLE_DIR_PIN P1_19 // (5)
  201. #endif
  202. #endif
  203. //
  204. // Průša i3 MK2 Multiplexer Support
  205. //
  206. #if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0
  207. #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN
  208. #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN
  209. #endif
  210. #define E_MUX2_PIN P0_26 // (63) E1_CS_PIN
  211. /**
  212. * LCD / Controller
  213. *
  214. * All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required.
  215. */
  216. /**
  217. * Smart LCD adapter
  218. *
  219. * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as
  220. * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use
  221. * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable
  222. * is needed to pick up 5V for the EXP1 connection.
  223. *
  224. * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines
  225. * on the LCD display during accesses of the SD card. The menus/code has been arranged so
  226. * that the garbage/lines are erased immediately after the SD card accesses are completed.
  227. */
  228. #if ENABLED(ULTRA_LCD)
  229. #define BEEPER_PIN P1_30 // (37) not 5V tolerant
  230. #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
  231. #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
  232. #define BTN_ENC P2_11 // (35) J3-3 & AUX-4
  233. #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  234. #define KILL_PIN P1_22 // (41) J5-4 & AUX-4
  235. #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4
  236. #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4
  237. #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
  238. #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3
  239. #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3
  240. #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
  241. #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2
  242. #ifdef ULTIPANEL
  243. #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO
  244. #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER
  245. #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1
  246. #endif
  247. #if ENABLED(NEWPANEL)
  248. #if ENABLED(REPRAPWORLD_KEYPAD)
  249. #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3
  250. #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3
  251. #define SHIFT_LD P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  252. #endif
  253. #else
  254. //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4
  255. //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4
  256. //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4
  257. //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4
  258. #endif
  259. #if ENABLED(VIKI2) || ENABLED(miniVIKI)
  260. // #define LCD_SCREEN_ROT_180
  261. #undef BEEPER_PIN
  262. #define BEEPER_PIN P1_30 // (37) may change if cable changes
  263. #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
  264. #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
  265. #define BTN_ENC P2_11 // (35) J3-3 & AUX-4
  266. #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3
  267. #define KILL_PIN P1_22 // (41) J5-4 & AUX-4
  268. #undef DOGLCD_CS
  269. #define DOGLCD_CS P0_16 // (16)
  270. #undef LCD_BACKLIGHT_PIN //P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
  271. #undef LCD_PINS_ENABLE //P0_18 // (51) (MOSI) J3-10 & AUX-3
  272. #undef LCD_PINS_D4 //P0_15 // (52) (SCK) J3-9 & AUX-3
  273. #undef LCD_PINS_D5 //P2_06 // (59) J3-8 & AUX-2
  274. #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
  275. #undef LCD_PINS_D6 //P0_26 // (63) J5-3 & AUX-2
  276. #undef LCD_PINS_D7 //P1_21 // ( 6) (SERVO1) J5-1 & SERVO connector
  277. #define DOGLCD_SCK SCK_PIN
  278. #define DOGLCD_MOSI MOSI_PIN
  279. #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes
  280. #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes
  281. #endif
  282. //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3
  283. //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3
  284. //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3
  285. //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 - sometimes called SDSS
  286. #if ENABLED(MINIPANEL)
  287. // GLCD features
  288. //#define LCD_CONTRAST 190
  289. // Uncomment screen orientation
  290. //#define LCD_SCREEN_ROT_90
  291. //#define LCD_SCREEN_ROT_180
  292. //#define LCD_SCREEN_ROT_270
  293. #endif
  294. #endif // ULTRA_LCD
  295. //
  296. // Ethernet pins
  297. //
  298. #ifndef ULTIPANEL
  299. #define ENET_MDIO P1_17 // (71) J12-4
  300. #define ENET_RX_ER P1_14 // (73) J12-6
  301. #define ENET_RXD1 P1_10 // (75) J12-8
  302. #endif
  303. #define ENET_MOC P1_16 // (70) J12-3
  304. #define REF_CLK P1_15 // (72) J12-5
  305. #define ENET_RXD0 P1_09 // (74) J12-7
  306. #define ENET_CRS P1_08 // (76) J12-9
  307. #define ENET_TX_EN P1_04 // (77) J12-10
  308. #define ENET_TXD0 P1_00 // (78) J12-11
  309. #define ENET_TXD1 P1_01 // (79) J12-12
  310. /**
  311. * Fast PWMS
  312. *
  313. * The LPC1768's hardware PWM controller has 6 channels. Each channel
  314. * can be setup to either control a dedicated pin directly or to generate
  315. * an interrupt. The direct method's duty cycle is accurate to within a
  316. * a microsecond. The interrupt method's average duty cycle has the
  317. * the same accuracy but the individual cycles can vary because of higher
  318. * priority interrupts.
  319. *
  320. * All Fast PWMs have a 50Hz rate.
  321. *
  322. * The following pins/signals use the direct method. All other pins use the
  323. * the interrupt method. Note that SERVO2_PIN and RAMPS_D8_PIN use the
  324. * interrupt method.
  325. * P1_20 (11) SERVO0_PIN
  326. * P1_21 ( 6) SERVO1_PIN J5-1
  327. * P0_18 ( 4) SERVO3_PIN 5V output
  328. * *P2_04 ( 9) RAMPS_D9_PIN
  329. * *P2_05 (10) RAMPS_D10_PIN
  330. *
  331. * * - If used as a heater driver then a Fast PWM is NOT assigned. If used as
  332. * a fan driver then enabling FAST_PWM_FAN assigns a Fast PWM to it.
  333. */
  334. /**
  335. * special pins
  336. * P1_30 (37) - not 5V tolerant
  337. * P1_31 (49) - not 5V tolerant
  338. * P0_27 (57) - open collector
  339. * P0_28 (58) - open collector
  340. *
  341. */
  342. /**
  343. * The following mega2560 pins are NOT available in a Re-ARM system
  344. * 7
  345. * 17
  346. * 22
  347. * 23
  348. * 25
  349. * 27
  350. * 29
  351. * 32
  352. * 39
  353. * 40
  354. * 42
  355. * 43
  356. * 44
  357. * 45
  358. * 47
  359. * 64
  360. * 65
  361. * 66
  362. */