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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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. #pragma once
  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 parentheses () are the corresponding mega2560 pin numbers
  36. #ifndef TARGET_LPC1768
  37. #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
  38. #endif
  39. #define BOARD_NAME "Re-ARM RAMPS 1.4"
  40. //
  41. // Servos
  42. //
  43. #define SERVO0_PIN P1_20 // (11)
  44. #define SERVO1_PIN P1_21 // ( 6) also on J5-1
  45. #define SERVO2_PIN P1_19 // ( 5)
  46. #define SERVO3_PIN P1_18 // ( 4) 5V output
  47. //
  48. // Limit Switches
  49. //
  50. #define X_MIN_PIN P1_24 // ( 3) 10k pullup to 3.3V, 1K series
  51. #define X_MAX_PIN P1_25 // ( 2) 10k pullup to 3.3V, 1K series
  52. #define Y_MIN_PIN P1_26 // (14) 10k pullup to 3.3V, 1K series
  53. #define Y_MAX_PIN P1_27 // (15) 10k pullup to 3.3V, 1K series
  54. #define Z_MIN_PIN P1_29 // (18) 10k pullup to 3.3V, 1K series
  55. #define Z_MAX_PIN P1_28 // (19) 10k pullup to 3.3V, 1K series
  56. //
  57. // Steppers
  58. //
  59. #define X_STEP_PIN P2_01 // (54)
  60. #define X_DIR_PIN P0_11 // (55)
  61. #define X_ENABLE_PIN P0_10 // (38)
  62. #ifndef X_CS_PIN
  63. #define X_CS_PIN P1_01 // ETH
  64. #endif
  65. #define Y_STEP_PIN P2_02 // (60)
  66. #define Y_DIR_PIN P0_20 // (61)
  67. #define Y_ENABLE_PIN P0_19 // (56)
  68. #ifndef Y_CS_PIN
  69. #define Y_CS_PIN P1_04 // ETH
  70. #endif
  71. #define Z_STEP_PIN P2_03 // (46)
  72. #define Z_DIR_PIN P0_22 // (48)
  73. #define Z_ENABLE_PIN P0_21 // (62)
  74. #ifndef Z_CS_PIN
  75. #define Z_CS_PIN P1_10 // ETH
  76. #endif
  77. #define E0_STEP_PIN P2_00 // (26)
  78. #define E0_DIR_PIN P0_05 // (28)
  79. #define E0_ENABLE_PIN P0_04 // (24)
  80. #ifndef E0_CS_PIN
  81. #define E0_CS_PIN P1_14 // ETH
  82. #endif
  83. #define E1_STEP_PIN P2_08 // (36)
  84. #define E1_DIR_PIN P2_13 // (34)
  85. #define E1_ENABLE_PIN P4_29 // (30)
  86. #ifndef E1_CS_PIN
  87. #define E1_CS_PIN -1
  88. #endif
  89. //
  90. // Software SPI pins for TMC2130 stepper drivers
  91. //
  92. #if ENABLED(TMC_USE_SW_SPI)
  93. #ifndef TMC_SW_MOSI
  94. #define TMC_SW_MOSI P1_00 // ETH
  95. #endif
  96. #ifndef TMC_SW_MISO
  97. #define TMC_SW_MISO P1_08 // ETH
  98. #endif
  99. #ifndef TMC_SW_SCK
  100. #define TMC_SW_SCK P1_09 // ETH
  101. #endif
  102. #endif
  103. #if HAS_TMC220x
  104. /**
  105. * TMC2208/TMC2209 stepper drivers
  106. *
  107. * Hardware serial communication ports.
  108. * If undefined software serial is used according to the pins below
  109. */
  110. /**
  111. * Software serial
  112. */
  113. // P2_08 E1-Step
  114. // P2_13 E1-Dir
  115. #define X_SERIAL_TX_PIN P2_13
  116. #define X_SERIAL_RX_PIN P2_13
  117. #define Y_SERIAL_TX_PIN P0_00
  118. #define Y_SERIAL_RX_PIN P0_00
  119. #define Z_SERIAL_TX_PIN P0_01
  120. #define Z_SERIAL_RX_PIN P0_01
  121. #define E0_SERIAL_TX_PIN P2_08
  122. #define E0_SERIAL_RX_PIN P2_08
  123. #endif
  124. //
  125. // Temperature Sensors
  126. // 3.3V max when defined as an analog input
  127. //
  128. #define TEMP_0_PIN 0 // A0 (T0) - (67) - TEMP_0_PIN
  129. #define TEMP_BED_PIN 1 // A1 (T1) - (68) - TEMP_BED_PIN
  130. #define TEMP_1_PIN 2 // A2 (T2) - (69) - TEMP_1_PIN
  131. #define TEMP_2_PIN 3 // A3 - (63) - J5-3 & AUX-2
  132. #define TEMP_3_PIN 4 // A4 - (37) - BUZZER_PIN
  133. //#define TEMP_4_PIN 5 // A5 - (49) - SD_DETECT_PIN
  134. //#define ?? 6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1
  135. #define FILWIDTH_PIN 7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1
  136. //
  137. // Augmentation for auto-assigning RAMPS plugs
  138. //
  139. #if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D)
  140. #if HOTENDS > 1
  141. #if TEMP_SENSOR_BED
  142. #define IS_RAMPS_EEB
  143. #else
  144. #define IS_RAMPS_EEF
  145. #endif
  146. #elif TEMP_SENSOR_BED
  147. #define IS_RAMPS_EFB
  148. #else
  149. #define IS_RAMPS_EFF
  150. #endif
  151. #endif
  152. //
  153. // Heaters / Fans
  154. //
  155. #ifndef MOSFET_D_PIN
  156. #define MOSFET_D_PIN -1
  157. #endif
  158. #ifndef RAMPS_D8_PIN
  159. #define RAMPS_D8_PIN P2_07 // (8)
  160. #endif
  161. #ifndef RAMPS_D9_PIN
  162. #define RAMPS_D9_PIN P2_04 // (9)
  163. #endif
  164. #ifndef RAMPS_D10_PIN
  165. #define RAMPS_D10_PIN P2_05 // (10)
  166. #endif
  167. #define HEATER_0_PIN RAMPS_D10_PIN
  168. #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
  169. #define HEATER_BED_PIN RAMPS_D8_PIN
  170. #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
  171. #define HEATER_1_PIN RAMPS_D9_PIN
  172. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  173. #define HEATER_1_PIN RAMPS_D9_PIN
  174. #define HEATER_BED_PIN RAMPS_D8_PIN
  175. #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan
  176. #define FAN1_PIN RAMPS_D8_PIN
  177. #elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
  178. #define HEATER_BED_PIN RAMPS_D8_PIN
  179. #if HOTENDS == 1
  180. #define FAN1_PIN MOSFET_D_PIN
  181. #else
  182. #define HEATER_1_PIN MOSFET_D_PIN
  183. #endif
  184. #endif
  185. #ifndef FAN_PIN
  186. #if EITHER(IS_RAMPS_EFB, IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
  187. #define FAN_PIN RAMPS_D9_PIN
  188. #elif EITHER(IS_RAMPS_EEF, IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan
  189. #define FAN_PIN RAMPS_D8_PIN
  190. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  191. #define FAN_PIN P1_18 // (4) IO pin. Buffer needed
  192. #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  193. #define FAN_PIN RAMPS_D9_PIN
  194. #endif
  195. #endif
  196. //
  197. // Misc. Functions
  198. //
  199. #define LED_PIN P4_28 // (13)
  200. // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector
  201. #ifndef FIL_RUNOUT_PIN
  202. #define FIL_RUNOUT_PIN P1_18 // (4)
  203. #endif
  204. #define PS_ON_PIN P2_12 // (12)
  205. #if !defined(MAX6675_SS_PIN) && DISABLED(USE_ZMAX_PLUG)
  206. #define MAX6675_SS_PIN P1_28
  207. #endif
  208. #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENA_PIN)
  209. #if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // Try to use servo connector
  210. #define CASE_LIGHT_PIN P1_18 // (4) MUST BE HARDWARE PWM
  211. #endif
  212. #endif
  213. //
  214. // M3/M4/M5 - Spindle/Laser Control
  215. // Use servo pins, if available
  216. //
  217. #if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA)
  218. #if NUM_SERVOS > 1
  219. #if ENABLED(SPINDLE_FEATURE)
  220. #error "SPINDLE_FEATURE requires 3 free servo pins."
  221. #else
  222. #error "LASER_FEATURE requires 3 free servo pins."
  223. #endif
  224. #endif
  225. #define SPINDLE_LASER_ENA_PIN SERVO1_PIN // (6) Pin should have a pullup/pulldown!
  226. #define SPINDLE_LASER_PWM_PIN SERVO3_PIN // (4) MUST BE HARDWARE PWM
  227. #define SPINDLE_DIR_PIN SERVO2_PIN // (5)
  228. #endif
  229. //
  230. // Průša i3 MK2 Multiplexer Support
  231. //
  232. #if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0
  233. #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN
  234. #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN
  235. #endif
  236. #define E_MUX2_PIN P0_26 // (63) E1_CS_PIN
  237. /**
  238. * LCD / Controller
  239. *
  240. * All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required.
  241. *
  242. * - https://github.com/wolfmanjm/universal-panel-adapter
  243. * - http://panucattdevices.freshdesk.com/support/solutions/articles/1000243195-lcd-display-installation
  244. */
  245. /**
  246. * Smart LCD adapter
  247. *
  248. * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as
  249. * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use
  250. * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable
  251. * is needed to pick up 5V for the EXP1 connection.
  252. *
  253. * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines
  254. * on the LCD display during accesses of the SD card. The menus/code has been arranged so
  255. * that the garbage/lines are erased immediately after the SD card accesses are completed.
  256. */
  257. #if ENABLED(CR10_STOCKDISPLAY)
  258. // Re-Arm can support Creality stock display without SD card reader and single cable on EXP3.
  259. // Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one
  260. // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3.
  261. // Requires REVERSE_ENCODER_DIRECTION in Configuration.h
  262. #define BEEPER_PIN P2_11 // J3-3 & AUX-4
  263. #define BTN_EN1 P0_16 // J3-7 & AUX-4
  264. #define BTN_EN2 P1_23 // J3-5 & AUX-4
  265. #define BTN_ENC P3_25 // J3-4 & AUX-4
  266. #define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS)
  267. #define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI)
  268. #define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK)
  269. #elif HAS_SPI_LCD
  270. //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3
  271. //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3
  272. //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3
  273. //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS)
  274. #if ENABLED(FYSETC_MINI_12864)
  275. #define BEEPER_PIN P1_01
  276. #define BTN_ENC P1_04
  277. #else
  278. #define BEEPER_PIN P1_30 // (37) not 5V tolerant
  279. #define BTN_ENC P2_11 // (35) J3-3 & AUX-4
  280. #endif
  281. #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
  282. #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
  283. #define SD_DETECT_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant)
  284. #define KILL_PIN P1_22 // (41) J5-4 & AUX-4
  285. #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4
  286. #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4
  287. #if ENABLED(NEWPANEL)
  288. #if ENABLED(REPRAPWORLD_KEYPAD)
  289. #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3
  290. #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3
  291. #define SHIFT_LD P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant)
  292. #endif
  293. #else
  294. //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4
  295. //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4
  296. //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4
  297. //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4
  298. #endif
  299. #if ANY(VIKI2, miniVIKI)
  300. // #define LCD_SCREEN_ROT_180
  301. #define DOGLCD_CS P0_16 // (16)
  302. #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
  303. #define DOGLCD_SCK SCK_PIN
  304. #define DOGLCD_MOSI MOSI_PIN
  305. #define STAT_LED_BLUE_PIN P0_26 //(63) may change if cable changes
  306. #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes
  307. #else
  308. #if ENABLED(FYSETC_MINI_12864)
  309. #define DOGLCD_SCK P0_15
  310. #define DOGLCD_MOSI P0_18
  311. // EXP1 on LCD adapter is not usable - using Ethernet connector instead
  312. #define DOGLCD_CS P1_09
  313. #define DOGLCD_A0 P1_14
  314. //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
  315. // results in LCD soft SPI mode 3, SD soft SPI mode 0
  316. #define LCD_RESET_PIN P0_16 // Must be high or open for LCD to operate normally.
  317. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  318. #ifndef RGB_LED_R_PIN
  319. #define RGB_LED_R_PIN P1_00
  320. #endif
  321. #ifndef RGB_LED_G_PIN
  322. #define RGB_LED_G_PIN P1_01
  323. #endif
  324. #ifndef RGB_LED_B_PIN
  325. #define RGB_LED_B_PIN P1_08
  326. #endif
  327. #elif ENABLED(FYSETC_MINI_12864_2_1)
  328. #define NEOPIXEL_PIN P1_00
  329. #endif
  330. #else
  331. #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2
  332. #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
  333. #endif
  334. #define LCD_BACKLIGHT_PIN P0_16 //(16) J3-7 & AUX-4 - only used on DOGLCD controllers
  335. #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3
  336. #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3
  337. #if ENABLED(ULTIPANEL)
  338. #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO
  339. #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER
  340. #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1
  341. #endif
  342. #endif
  343. #if ENABLED(MINIPANEL)
  344. // GLCD features
  345. // Uncomment screen orientation
  346. //#define LCD_SCREEN_ROT_90
  347. //#define LCD_SCREEN_ROT_180
  348. //#define LCD_SCREEN_ROT_270
  349. #endif
  350. #endif // HAS_SPI_LCD
  351. //
  352. // Ethernet pins
  353. //
  354. #if DISABLED(ULTIPANEL)
  355. #define ENET_MDIO P1_17 // (71) J12-4
  356. #define ENET_RX_ER P1_14 // (73) J12-6
  357. #define ENET_RXD1 P1_10 // (75) J12-8
  358. #endif
  359. #define ENET_MOC P1_16 // (70) J12-3
  360. #define REF_CLK P1_15 // (72) J12-5
  361. #define ENET_RXD0 P1_09 // (74) J12-7
  362. #define ENET_CRS P1_08 // (76) J12-9
  363. #define ENET_TX_EN P1_04 // (77) J12-10
  364. #define ENET_TXD0 P1_00 // (78) J12-11
  365. #define ENET_TXD1 P1_01 // (79) J12-12
  366. //
  367. // SD Support
  368. //
  369. #ifndef SDCARD_CONNECTION
  370. #define SDCARD_CONNECTION ONBOARD
  371. #endif
  372. #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
  373. #if SD_CONNECTION_IS(LCD)
  374. #define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3
  375. #define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3
  376. #define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3
  377. #define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin
  378. #elif SD_CONNECTION_IS(ONBOARD)
  379. #undef SD_DETECT_PIN
  380. #define SCK_PIN P0_07
  381. #define MISO_PIN P0_08
  382. #define MOSI_PIN P0_09
  383. #define SS_PIN ONBOARD_SD_CS_PIN
  384. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  385. #error "No custom SD drive cable defined for this board."
  386. #endif
  387. /**
  388. * Fast PWMs
  389. *
  390. * The LPC1768's hardware PWM controller has 6 channels. Each channel
  391. * can be setup to either control a dedicated pin directly or to generate
  392. * an interrupt. The direct method's duty cycle is accurate to within a
  393. * a microsecond. The interrupt method's average duty cycle has the
  394. * the same accuracy but the individual cycles can vary because of higher
  395. * priority interrupts.
  396. *
  397. * All Fast PWMs have a 50Hz rate.
  398. *
  399. * The following pins/signals use the direct method. All other pins use the
  400. * the interrupt method. Note that SERVO2_PIN and RAMPS_D8_PIN use the
  401. * interrupt method.
  402. *
  403. * P1_20 (11) SERVO0_PIN
  404. * P1_21 ( 6) SERVO1_PIN J5-1
  405. * P0_18 ( 4) SERVO3_PIN 5V output
  406. * *P2_04 ( 9) RAMPS_D9_PIN
  407. * *P2_05 (10) RAMPS_D10_PIN
  408. *
  409. * * - If used as a heater driver then a Fast PWM is NOT assigned. If used as
  410. * a fan driver then enabling FAST_PWM_FAN assigns a Fast PWM to it.
  411. */
  412. /**
  413. * Special pins
  414. * P1_30 (37) (NOT 5V tolerant)
  415. * P1_31 (49) (NOT 5V tolerant)
  416. * P0_27 (57) (Open collector)
  417. * P0_28 (58) (Open collector)
  418. */
  419. /**
  420. * The following mega2560 pins are NOT available in a Re-ARM system:
  421. *
  422. * 7, 17, 22, 23, 25, 27, 29, 32, 39, 40, 42, 43, 44, 45, 47, 64, 65, 66
  423. */