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

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