My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

pins_RAMPS_RE_ARM.h 15KB

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