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.h 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * Arduino Mega with RAMPS v1.4 (or v1.3) 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. * RAMPS_13_EFB (Hotend, Fan, Bed)
  35. * RAMPS_13_EEB (Hotend0, Hotend1, Bed)
  36. * RAMPS_13_EFF (Hotend, Fan0, Fan1)
  37. * RAMPS_13_EEF (Hotend0, Hotend1, Fan)
  38. * RAMPS_13_SF (Spindle, Controller Fan)
  39. *
  40. * Other pins_MYBOARD.h files may override these defaults
  41. *
  42. * Differences between
  43. * RAMPS_13 | RAMPS_14
  44. * 7 | 11
  45. */
  46. #if ENABLED(AZSMZ_12864) && DISABLED(ALLOW_SAM3X8E)
  47. #error "No pins defined for RAMPS with AZSMZ_12864."
  48. #endif
  49. #include "env_validate.h"
  50. // Custom flags and defines for the build
  51. //#define BOARD_CUSTOM_BUILD_FLAGS -D__FOO__
  52. #ifndef BOARD_INFO_NAME
  53. #define BOARD_INFO_NAME "RAMPS 1.4"
  54. #endif
  55. //
  56. // Servos
  57. //
  58. #ifndef SERVO0_PIN
  59. #ifdef IS_RAMPS_13
  60. #define SERVO0_PIN 7
  61. #else
  62. #define SERVO0_PIN 11
  63. #endif
  64. #endif
  65. #ifndef SERVO1_PIN
  66. #define SERVO1_PIN 6
  67. #endif
  68. #ifndef SERVO2_PIN
  69. #define SERVO2_PIN 5
  70. #endif
  71. #ifndef SERVO3_PIN
  72. #define SERVO3_PIN 4
  73. #endif
  74. //
  75. // Foam Cutter requirements
  76. //
  77. #if ENABLED(FOAMCUTTER_XYUV)
  78. #ifndef MOSFET_C_PIN
  79. #define MOSFET_C_PIN -1
  80. #endif
  81. #if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) && NUM_SERVOS < 2
  82. #define SPINDLE_LASER_PWM_PIN 8 // Hardware PWM
  83. #endif
  84. #ifndef Z_MIN_PIN
  85. #define Z_MIN_PIN -1
  86. #endif
  87. #ifndef Z_MAX_PIN
  88. #define Z_MAX_PIN -1
  89. #endif
  90. #ifndef I_STOP_PIN
  91. #define I_STOP_PIN 18
  92. #endif
  93. #ifndef J_STOP_PIN
  94. #define J_STOP_PIN 19
  95. #endif
  96. #endif
  97. //
  98. // Limit Switches
  99. //
  100. #ifndef X_STOP_PIN
  101. #ifndef X_MIN_PIN
  102. #define X_MIN_PIN 3
  103. #endif
  104. #ifndef X_MAX_PIN
  105. #define X_MAX_PIN 2
  106. #endif
  107. #endif
  108. #ifndef Y_STOP_PIN
  109. #ifndef Y_MIN_PIN
  110. #define Y_MIN_PIN 14
  111. #endif
  112. #ifndef Y_MAX_PIN
  113. #define Y_MAX_PIN 15
  114. #endif
  115. #endif
  116. #ifndef Z_STOP_PIN
  117. #ifndef Z_MIN_PIN
  118. #define Z_MIN_PIN 18
  119. #endif
  120. #ifndef Z_MAX_PIN
  121. #define Z_MAX_PIN 19
  122. #endif
  123. #endif
  124. //
  125. // Z Probe (when not Z_MIN_PIN)
  126. //
  127. #ifndef Z_MIN_PROBE_PIN
  128. #define Z_MIN_PROBE_PIN 32
  129. #endif
  130. //
  131. // Steppers
  132. //
  133. #define X_STEP_PIN 54
  134. #define X_DIR_PIN 55
  135. #define X_ENABLE_PIN 38
  136. #ifndef X_CS_PIN
  137. #define X_CS_PIN 53
  138. #endif
  139. #define Y_STEP_PIN 60
  140. #define Y_DIR_PIN 61
  141. #define Y_ENABLE_PIN 56
  142. #ifndef Y_CS_PIN
  143. #define Y_CS_PIN 49
  144. #endif
  145. #ifndef Z_STEP_PIN
  146. #define Z_STEP_PIN 46
  147. #endif
  148. #ifndef Z_DIR_PIN
  149. #define Z_DIR_PIN 48
  150. #endif
  151. #ifndef Z_ENABLE_PIN
  152. #define Z_ENABLE_PIN 62
  153. #endif
  154. #ifndef Z_CS_PIN
  155. #define Z_CS_PIN 40
  156. #endif
  157. #ifndef E0_STEP_PIN
  158. #define E0_STEP_PIN 26
  159. #endif
  160. #ifndef E0_DIR_PIN
  161. #define E0_DIR_PIN 28
  162. #endif
  163. #ifndef E0_ENABLE_PIN
  164. #define E0_ENABLE_PIN 24
  165. #endif
  166. #ifndef E0_CS_PIN
  167. #define E0_CS_PIN 42
  168. #endif
  169. #ifndef E1_STEP_PIN
  170. #define E1_STEP_PIN 36
  171. #endif
  172. #ifndef E1_DIR_PIN
  173. #define E1_DIR_PIN 34
  174. #endif
  175. #ifndef E1_ENABLE_PIN
  176. #define E1_ENABLE_PIN 30
  177. #endif
  178. #ifndef E1_CS_PIN
  179. #define E1_CS_PIN 44
  180. #endif
  181. //
  182. // Temperature Sensors
  183. //
  184. #ifndef TEMP_0_PIN
  185. #define TEMP_0_PIN 13 // Analog Input
  186. #endif
  187. #ifndef TEMP_1_PIN
  188. #define TEMP_1_PIN 15 // Analog Input
  189. #endif
  190. #ifndef TEMP_BED_PIN
  191. #define TEMP_BED_PIN 14 // Analog Input
  192. #endif
  193. //
  194. // SPI for MAX Thermocouple
  195. //
  196. #ifndef TEMP_0_CS_PIN
  197. #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card (SDSS) or 49 (SD_DETECT_PIN)
  198. #endif
  199. //
  200. // Heaters / Fans
  201. //
  202. #ifndef MOSFET_A_PIN
  203. #define MOSFET_A_PIN 10
  204. #endif
  205. #ifndef MOSFET_B_PIN
  206. #define MOSFET_B_PIN 9
  207. #endif
  208. #ifndef MOSFET_C_PIN
  209. #define MOSFET_C_PIN 8
  210. #endif
  211. #ifndef MOSFET_D_PIN
  212. #define MOSFET_D_PIN -1
  213. #endif
  214. #define HEATER_0_PIN MOSFET_A_PIN
  215. #if FET_ORDER_EFB // Hotend, Fan, Bed
  216. #define HEATER_BED_PIN MOSFET_C_PIN
  217. #elif FET_ORDER_EEF // Hotend, Hotend, Fan
  218. #define HEATER_1_PIN MOSFET_B_PIN
  219. #elif FET_ORDER_EEB // Hotend, Hotend, Bed
  220. #define HEATER_1_PIN MOSFET_B_PIN
  221. #define HEATER_BED_PIN MOSFET_C_PIN
  222. #elif FET_ORDER_EFF // Hotend, Fan, Fan
  223. #define FAN1_PIN MOSFET_C_PIN
  224. #elif DISABLED(FET_ORDER_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
  225. #define HEATER_BED_PIN MOSFET_C_PIN
  226. #if EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL)
  227. #define HEATER_1_PIN MOSFET_D_PIN
  228. #else
  229. #define FAN1_PIN MOSFET_D_PIN
  230. #endif
  231. #endif
  232. #ifndef FAN_PIN
  233. #if EITHER(FET_ORDER_EFB, FET_ORDER_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
  234. #define FAN_PIN MOSFET_B_PIN
  235. #elif EITHER(FET_ORDER_EEF, FET_ORDER_SF) // Hotend, Hotend, Fan or Spindle, Fan
  236. #define FAN_PIN MOSFET_C_PIN
  237. #elif FET_ORDER_EEB // Hotend, Hotend, Bed
  238. #define FAN_PIN 4 // IO pin. Buffer needed
  239. #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  240. #define FAN_PIN MOSFET_B_PIN
  241. #endif
  242. #endif
  243. //
  244. // Misc. Functions
  245. //
  246. #ifndef SDSS
  247. #define SDSS AUX3_06_PIN
  248. #endif
  249. #define LED_PIN 13
  250. #ifndef FILWIDTH_PIN
  251. #define FILWIDTH_PIN 5 // Analog Input on AUX2
  252. #endif
  253. // RAMPS 1.4 DIO 4 on the servos connector
  254. #ifndef FIL_RUNOUT_PIN
  255. #define FIL_RUNOUT_PIN 4
  256. #endif
  257. #ifndef PS_ON_PIN
  258. #define PS_ON_PIN 12
  259. #endif
  260. #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN)
  261. #if NUM_SERVOS <= 1 // Prefer the servo connector
  262. #define CASE_LIGHT_PIN 6 // Hardware PWM
  263. #elif HAS_FREE_AUX2_PINS
  264. #define CASE_LIGHT_PIN 44 // Hardware PWM
  265. #endif
  266. #endif
  267. //
  268. // M3/M4/M5 - Spindle/Laser Control
  269. //
  270. #if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN)
  271. #if NUM_SERVOS < 2 // Use servo connector if possible
  272. #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown!
  273. #ifndef SPINDLE_LASER_PWM_PIN
  274. #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM
  275. #endif
  276. #define SPINDLE_DIR_PIN 5
  277. #elif HAS_FREE_AUX2_PINS
  278. #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown!
  279. #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
  280. #define SPINDLE_DIR_PIN 65
  281. #else
  282. #error "No auto-assignable Spindle/Laser pins available."
  283. #endif
  284. #endif
  285. //
  286. // TMC software SPI
  287. //
  288. #if ENABLED(TMC_USE_SW_SPI)
  289. #ifndef TMC_SW_MOSI
  290. #define TMC_SW_MOSI 66
  291. #endif
  292. #ifndef TMC_SW_MISO
  293. #define TMC_SW_MISO 44
  294. #endif
  295. #ifndef TMC_SW_SCK
  296. #define TMC_SW_SCK 64
  297. #endif
  298. #endif
  299. #if HAS_TMC_UART
  300. /**
  301. * TMC2208/TMC2209 stepper drivers
  302. *
  303. * Hardware serial communication ports.
  304. * If undefined software serial is used according to the pins below
  305. *
  306. * Serial2 -- AUX-4 Pin 18 (D16 TX2) and AUX-4 Pin 17 (D17 RX2)
  307. * Serial1 -- Pins D18 and D19 are used for Z-MIN and Z-MAX
  308. */
  309. //#define X_HARDWARE_SERIAL Serial1
  310. //#define X2_HARDWARE_SERIAL Serial1
  311. //#define Y_HARDWARE_SERIAL Serial1
  312. //#define Y2_HARDWARE_SERIAL Serial1
  313. //#define Z_HARDWARE_SERIAL Serial1
  314. //#define Z2_HARDWARE_SERIAL Serial1
  315. //#define E0_HARDWARE_SERIAL Serial1
  316. //#define E1_HARDWARE_SERIAL Serial1
  317. //#define E2_HARDWARE_SERIAL Serial1
  318. //#define E3_HARDWARE_SERIAL Serial1
  319. //#define E4_HARDWARE_SERIAL Serial1
  320. #ifndef X_SERIAL_TX_PIN
  321. #define X_SERIAL_TX_PIN 40
  322. #endif
  323. #ifndef X_SERIAL_RX_PIN
  324. #define X_SERIAL_RX_PIN 63
  325. #endif
  326. #ifndef X2_SERIAL_TX_PIN
  327. #define X2_SERIAL_TX_PIN -1
  328. #endif
  329. #ifndef X2_SERIAL_RX_PIN
  330. #define X2_SERIAL_RX_PIN -1
  331. #endif
  332. #ifndef Y_SERIAL_TX_PIN
  333. #define Y_SERIAL_TX_PIN 59
  334. #endif
  335. #ifndef Y_SERIAL_RX_PIN
  336. #define Y_SERIAL_RX_PIN 64
  337. #endif
  338. #ifndef Y2_SERIAL_TX_PIN
  339. #define Y2_SERIAL_TX_PIN -1
  340. #endif
  341. #ifndef Y2_SERIAL_RX_PIN
  342. #define Y2_SERIAL_RX_PIN -1
  343. #endif
  344. #ifndef Z_SERIAL_TX_PIN
  345. #define Z_SERIAL_TX_PIN 42
  346. #endif
  347. #ifndef Z_SERIAL_RX_PIN
  348. #define Z_SERIAL_RX_PIN 65
  349. #endif
  350. #ifndef Z2_SERIAL_TX_PIN
  351. #define Z2_SERIAL_TX_PIN -1
  352. #endif
  353. #ifndef Z2_SERIAL_RX_PIN
  354. #define Z2_SERIAL_RX_PIN -1
  355. #endif
  356. #ifndef E0_SERIAL_TX_PIN
  357. #define E0_SERIAL_TX_PIN 44
  358. #endif
  359. #ifndef E0_SERIAL_RX_PIN
  360. #define E0_SERIAL_RX_PIN 66
  361. #endif
  362. #ifndef E1_SERIAL_TX_PIN
  363. #define E1_SERIAL_TX_PIN -1
  364. #endif
  365. #ifndef E1_SERIAL_RX_PIN
  366. #define E1_SERIAL_RX_PIN -1
  367. #endif
  368. #ifndef E2_SERIAL_TX_PIN
  369. #define E2_SERIAL_TX_PIN -1
  370. #endif
  371. #ifndef E2_SERIAL_RX_PIN
  372. #define E2_SERIAL_RX_PIN -1
  373. #endif
  374. #ifndef E3_SERIAL_TX_PIN
  375. #define E3_SERIAL_TX_PIN -1
  376. #endif
  377. #ifndef E3_SERIAL_RX_PIN
  378. #define E3_SERIAL_RX_PIN -1
  379. #endif
  380. #ifndef E4_SERIAL_TX_PIN
  381. #define E4_SERIAL_TX_PIN -1
  382. #endif
  383. #ifndef E4_SERIAL_RX_PIN
  384. #define E4_SERIAL_RX_PIN -1
  385. #endif
  386. #ifndef E5_SERIAL_TX_PIN
  387. #define E5_SERIAL_TX_PIN -1
  388. #endif
  389. #ifndef E5_SERIAL_RX_PIN
  390. #define E5_SERIAL_RX_PIN -1
  391. #endif
  392. #ifndef E6_SERIAL_TX_PIN
  393. #define E6_SERIAL_TX_PIN -1
  394. #endif
  395. #ifndef E6_SERIAL_RX_PIN
  396. #define E6_SERIAL_RX_PIN -1
  397. #endif
  398. #ifndef E7_SERIAL_TX_PIN
  399. #define E7_SERIAL_TX_PIN -1
  400. #endif
  401. #ifndef E7_SERIAL_RX_PIN
  402. #define E7_SERIAL_RX_PIN -1
  403. #endif
  404. #endif
  405. //
  406. // Průša i3 MK2 Multiplexer Support
  407. //
  408. #if HAS_PRUSA_MMU1
  409. #ifndef E_MUX0_PIN
  410. #define E_MUX0_PIN 40 // Z_CS_PIN
  411. #endif
  412. #ifndef E_MUX1_PIN
  413. #define E_MUX1_PIN 42 // E0_CS_PIN
  414. #endif
  415. #ifndef E_MUX2_PIN
  416. #define E_MUX2_PIN 44 // E1_CS_PIN
  417. #endif
  418. #endif
  419. //
  420. // AUX1 5V GND D2 D1
  421. // 2 4 6 8
  422. // 1 3 5 7
  423. // 5V GND A3 A4
  424. //
  425. #define AUX1_05_PIN 57 // (A3)
  426. #define AUX1_06_PIN 2
  427. #define AUX1_07_PIN 58 // (A4)
  428. #define AUX1_08_PIN 1
  429. //
  430. // AUX2 GND A9 D40 D42 A11
  431. // 2 4 6 8 10
  432. // 1 3 5 7 9
  433. // VCC A5 A10 D44 A12
  434. //
  435. #define AUX2_03_PIN 59 // (A5)
  436. #define AUX2_04_PIN 63 // (A9)
  437. #define AUX2_05_PIN 64 // (A10)
  438. #define AUX2_06_PIN 40
  439. #define AUX2_07_PIN 44
  440. #define AUX2_08_PIN 42
  441. #define AUX2_09_PIN 66 // (A12)
  442. #define AUX2_10_PIN 65 // (A11)
  443. //
  444. // AUX3 GND D52 D50 5V
  445. // 7 5 3 1
  446. // 8 6 4 2
  447. // NC D53 D51 D49
  448. //
  449. #define AUX3_02_PIN 49
  450. #define AUX3_03_PIN 50
  451. #define AUX3_04_PIN 51
  452. #define AUX3_05_PIN 52
  453. #define AUX3_06_PIN 53
  454. //
  455. // AUX4 5V GND D32 D47 D45 D43 D41 D39 D37 D35 D33 D31 D29 D27 D25 D23 D17 D16
  456. //
  457. #define AUX4_03_PIN 32
  458. #define AUX4_04_PIN 47
  459. #define AUX4_05_PIN 45
  460. #define AUX4_06_PIN 43
  461. #define AUX4_07_PIN 41
  462. #define AUX4_08_PIN 39
  463. #define AUX4_09_PIN 37
  464. #define AUX4_10_PIN 35
  465. #define AUX4_11_PIN 33
  466. #define AUX4_12_PIN 31
  467. #define AUX4_13_PIN 29
  468. #define AUX4_14_PIN 27
  469. #define AUX4_15_PIN 25
  470. #define AUX4_16_PIN 23
  471. #define AUX4_17_PIN 17
  472. #define AUX4_18_PIN 16
  473. /**
  474. * LCD adapters come in different variants. The socket keys can be
  475. * on either side, and may be backwards on some boards / displays.
  476. */
  477. #ifndef EXP1_08_PIN
  478. #define EXP1_03_PIN AUX4_17_PIN
  479. #define EXP1_04_PIN AUX4_18_PIN
  480. #define EXP1_05_PIN AUX4_16_PIN
  481. #define EXP1_06_PIN AUX4_15_PIN
  482. #define EXP1_07_PIN AUX4_14_PIN
  483. #define EXP1_08_PIN AUX4_13_PIN
  484. #define EXP2_01_PIN AUX3_03_PIN
  485. #define EXP2_02_PIN AUX3_05_PIN
  486. #define EXP2_04_PIN AUX3_06_PIN
  487. #define EXP2_06_PIN AUX3_04_PIN
  488. #define EXP2_07_PIN AUX3_02_PIN
  489. #if ENABLED(G3D_PANEL)
  490. /** Gadgets3D Smart Adapter
  491. * ------ ------
  492. * 4-11 | 1 2 | 4-12 (MISO) 3-03 | 1 2 | 3-05 (SCK)
  493. * 4-17 | 3 4 | 4-18 4-10 | 3 4 | 3-06
  494. * 4-16 5 6 | 4-15 4-09 5 6 | 3-04 (MOSI)
  495. * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07
  496. * (GND) 4-02 | 9 10 | 4-01 (5V) -- | 9 10 | --
  497. * ------ ------
  498. * EXP1 EXP2
  499. */
  500. #define EXP1_01_PIN AUX4_11_PIN
  501. #define EXP1_02_PIN AUX4_12_PIN
  502. #define EXP2_03_PIN AUX4_10_PIN
  503. #define EXP2_05_PIN AUX4_09_PIN
  504. #define EXP2_08_PIN AUX4_07_PIN
  505. #else
  506. /** Smart Adapter (c) RRD
  507. * ------ ------
  508. * 4-09 | 1 2 | 4-10 (MISO) 3-03 | 1 2 | 3-05 (SCK)
  509. * 4-17 | 3 4 | 4-18 4-12 | 3 4 | 3-06
  510. * 4-16 5 6 | 4-15 4-11 5 6 | 3-04 (MOSI)
  511. * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07
  512. * (GND) 3-07 | 9 10 | 3-01 (5V) (GND) 3-07 | 9 10 | --
  513. * ------ ------
  514. * EXP1 EXP2
  515. */
  516. #define EXP1_01_PIN AUX4_09_PIN
  517. #define EXP1_02_PIN AUX4_10_PIN
  518. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  519. #define EXP2_03_PIN AUX4_11_PIN
  520. #define EXP2_05_PIN AUX4_12_PIN
  521. #define EXP2_08_PIN -1 // RESET
  522. #else
  523. #define EXP2_03_PIN AUX4_12_PIN
  524. #define EXP2_05_PIN AUX4_11_PIN
  525. #define EXP2_08_PIN AUX4_07_PIN
  526. #endif
  527. #endif
  528. #endif
  529. //////////////////////////
  530. // LCDs and Controllers //
  531. //////////////////////////
  532. #if HAS_WIRED_LCD
  533. //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
  534. //
  535. // LCD Display output pins
  536. //
  537. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  538. #define LCD_PINS_RS EXP2_07_PIN // CS chip select /SS chip slave select
  539. #define LCD_PINS_ENABLE EXP2_06_PIN // SID (MOSI)
  540. #define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock
  541. #elif BOTH(IS_NEWPANEL, PANEL_ONE)
  542. #define LCD_PINS_RS AUX2_06_PIN
  543. #define LCD_PINS_ENABLE AUX2_08_PIN
  544. #define LCD_PINS_D4 AUX2_10_PIN
  545. #define LCD_PINS_D5 AUX2_09_PIN
  546. #define LCD_PINS_D6 AUX2_07_PIN
  547. #define LCD_PINS_D7 AUX2_05_PIN
  548. #elif ENABLED(TFTGLCD_PANEL_SPI)
  549. #define TFTGLCD_CS EXP2_05_PIN
  550. #else
  551. #if ENABLED(CR10_STOCKDISPLAY)
  552. #define LCD_PINS_RS EXP1_07_PIN
  553. #define LCD_PINS_ENABLE EXP1_08_PIN
  554. #define LCD_PINS_D4 EXP1_06_PIN
  555. #if !IS_NEWPANEL
  556. #define BEEPER_PIN EXP1_01_PIN
  557. #endif
  558. #elif ENABLED(ZONESTAR_LCD)
  559. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  560. #error "CAUTION! ZONESTAR_LCD on RAMPS requires wiring modifications. It plugs into AUX2 but GND and 5V need to be swapped. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  561. #endif
  562. #define LCD_PINS_RS AUX2_05_PIN
  563. #define LCD_PINS_ENABLE AUX2_07_PIN
  564. #define LCD_PINS_D4 AUX2_04_PIN
  565. #define LCD_PINS_D5 AUX2_06_PIN
  566. #define LCD_PINS_D6 AUX2_08_PIN
  567. #define LCD_PINS_D7 AUX2_10_PIN
  568. #elif ENABLED(AZSMZ_12864)
  569. // Pins only defined for RAMPS_SMART currently
  570. #else
  571. #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
  572. #define LCD_PINS_DC EXP1_06_PIN // Set as output on init
  573. #define LCD_PINS_RS EXP1_07_PIN // Pull low for 1s to init
  574. // DOGM SPI LCD Support
  575. #define DOGLCD_A0 LCD_PINS_DC
  576. #define DOGLCD_CS EXP1_04_PIN
  577. #define DOGLCD_MOSI EXP1_03_PIN
  578. #define DOGLCD_SCK EXP1_05_PIN
  579. #else
  580. #define LCD_PINS_RS EXP1_04_PIN
  581. #define LCD_PINS_ENABLE EXP1_03_PIN
  582. #define LCD_PINS_D4 EXP1_05_PIN
  583. #define LCD_PINS_D5 EXP1_06_PIN
  584. #define LCD_PINS_D6 EXP1_07_PIN
  585. #endif
  586. #define LCD_PINS_D7 EXP1_08_PIN
  587. #if !IS_NEWPANEL
  588. #define BEEPER_PIN EXP2_05_PIN
  589. #endif
  590. #endif
  591. #if !IS_NEWPANEL
  592. // Buttons attached to a shift register
  593. // Not wired yet
  594. //#define SHIFT_CLK_PIN 38
  595. //#define SHIFT_LD_PIN AUX2_08_PIN
  596. //#define SHIFT_OUT_PIN AUX2_06_PIN
  597. //#define SHIFT_EN_PIN EXP1_03_PIN
  598. #endif
  599. #endif
  600. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  601. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  602. #endif
  603. //
  604. // LCD Display input pins
  605. //
  606. #if IS_NEWPANEL
  607. #if IS_RRD_SC
  608. #define BEEPER_PIN EXP1_01_PIN
  609. #if ENABLED(CR10_STOCKDISPLAY)
  610. #define BTN_EN1 EXP1_03_PIN
  611. #define BTN_EN2 EXP1_05_PIN
  612. #else
  613. #define BTN_EN1 EXP2_03_PIN
  614. #define BTN_EN2 EXP2_05_PIN
  615. #endif
  616. #define BTN_ENC EXP1_02_PIN
  617. #ifndef SD_DETECT_PIN
  618. #define SD_DETECT_PIN EXP2_07_PIN
  619. #endif
  620. #ifndef KILL_PIN
  621. #define KILL_PIN EXP2_08_PIN
  622. #endif
  623. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  624. #define LCD_BACKLIGHT_PIN AUX4_08_PIN
  625. #endif
  626. #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  627. #define BTN_EN1 AUX2_05_PIN
  628. #define BTN_EN2 AUX2_03_PIN
  629. #define BTN_ENC AUX2_04_PIN
  630. #define SD_DETECT_PIN AUX2_08_PIN
  631. #elif ENABLED(LCD_I2C_PANELOLU2)
  632. #define BTN_EN1 AUX4_04_PIN
  633. #define BTN_EN2 AUX4_06_PIN
  634. #define BTN_ENC AUX4_03_PIN
  635. #define LCD_SDSS SDSS
  636. #define KILL_PIN EXP2_08_PIN
  637. #elif ENABLED(LCD_I2C_VIKI)
  638. #define BTN_EN1 AUX2_06_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains AUX2-06 and AUX2-08.
  639. #define BTN_EN2 AUX2_08_PIN
  640. #define BTN_ENC -1
  641. #define LCD_SDSS SDSS
  642. #define SD_DETECT_PIN EXP2_07_PIN
  643. #elif EITHER(VIKI2, miniVIKI)
  644. #define DOGLCD_CS AUX4_05_PIN
  645. #define DOGLCD_A0 AUX2_07_PIN
  646. #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
  647. #define BEEPER_PIN EXP2_05_PIN
  648. #define STAT_LED_RED_PIN AUX4_03_PIN
  649. #define STAT_LED_BLUE_PIN EXP1_02_PIN
  650. #define BTN_EN1 22
  651. #define BTN_EN2 7
  652. #define BTN_ENC AUX4_08_PIN
  653. #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board
  654. #define KILL_PIN EXP2_03_PIN
  655. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  656. #define DOGLCD_CS EXP1_08_PIN
  657. #define DOGLCD_A0 EXP1_07_PIN
  658. #define BEEPER_PIN EXP1_05_PIN
  659. #define LCD_BACKLIGHT_PIN EXP2_05_PIN
  660. #define BTN_EN1 EXP1_02_PIN
  661. #define BTN_EN2 EXP1_01_PIN
  662. #define BTN_ENC EXP2_03_PIN
  663. #define LCD_SDSS SDSS
  664. #define SD_DETECT_PIN EXP2_07_PIN
  665. #define KILL_PIN EXP2_08_PIN
  666. #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864)
  667. #define BEEPER_PIN EXP1_01_PIN
  668. #define BTN_ENC EXP1_02_PIN
  669. #ifndef SD_DETECT_PIN
  670. #define SD_DETECT_PIN EXP2_07_PIN
  671. #endif
  672. #ifndef KILL_PIN
  673. #define KILL_PIN EXP2_08_PIN
  674. #endif
  675. #if ENABLED(MKS_MINI_12864)
  676. #define DOGLCD_A0 EXP1_07_PIN
  677. #define DOGLCD_CS EXP1_06_PIN
  678. // not connected to a pin
  679. #define LCD_BACKLIGHT_PIN -1 // 65 (MKS mini12864 can't adjust backlight by software!)
  680. #define BTN_EN1 EXP2_03_PIN
  681. #define BTN_EN2 EXP2_05_PIN
  682. #elif ENABLED(FYSETC_MINI_12864)
  683. // From https://wiki.fysetc.com/Mini12864_Panel/
  684. #define DOGLCD_A0 EXP1_04_PIN
  685. #define DOGLCD_CS EXP1_03_PIN
  686. #define BTN_EN1 EXP2_05_PIN
  687. #define BTN_EN2 EXP2_03_PIN
  688. //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
  689. // results in LCD soft SPI mode 3, SD soft SPI mode 0
  690. #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
  691. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  692. #ifndef RGB_LED_R_PIN
  693. #define RGB_LED_R_PIN EXP1_06_PIN
  694. #endif
  695. #ifndef RGB_LED_G_PIN
  696. #define RGB_LED_G_PIN EXP1_07_PIN
  697. #endif
  698. #ifndef RGB_LED_B_PIN
  699. #define RGB_LED_B_PIN EXP1_08_PIN
  700. #endif
  701. #elif ENABLED(FYSETC_MINI_12864_2_1)
  702. #define NEOPIXEL_PIN EXP1_06_PIN
  703. #endif
  704. #endif
  705. #elif ENABLED(MINIPANEL)
  706. #define BEEPER_PIN AUX2_08_PIN
  707. #define LCD_BACKLIGHT_PIN AUX2_10_PIN
  708. #define DOGLCD_A0 AUX2_07_PIN
  709. #define DOGLCD_CS AUX2_09_PIN
  710. #define BTN_EN1 AUX2_06_PIN
  711. #define BTN_EN2 AUX2_04_PIN
  712. #define BTN_ENC AUX2_03_PIN
  713. #define SD_DETECT_PIN AUX3_02_PIN
  714. #define KILL_PIN AUX2_05_PIN
  715. #elif ENABLED(ZONESTAR_LCD)
  716. #define ADC_KEYPAD_PIN 12
  717. #elif ENABLED(AZSMZ_12864)
  718. // Pins only defined for RAMPS_SMART currently
  719. #elif ENABLED(G3D_PANEL)
  720. #define BEEPER_PIN EXP1_01_PIN
  721. #define SD_DETECT_PIN EXP2_07_PIN
  722. #define KILL_PIN EXP2_08_PIN
  723. #define BTN_EN1 EXP2_05_PIN
  724. #define BTN_EN2 EXP2_03_PIN
  725. #define BTN_ENC EXP1_02_PIN
  726. #elif IS_TFTGLCD_PANEL
  727. #define SD_DETECT_PIN EXP2_07_PIN
  728. #else
  729. #define BEEPER_PIN EXP2_05_PIN
  730. #if ENABLED(PANEL_ONE) // Buttons connect directly to AUX-2
  731. #define BTN_EN1 AUX2_03_PIN
  732. #define BTN_EN2 AUX2_04_PIN
  733. #define BTN_ENC AUX3_02_PIN
  734. #else
  735. #define BTN_EN1 EXP1_01_PIN
  736. #define BTN_EN2 EXP1_02_PIN
  737. #define BTN_ENC EXP2_03_PIN
  738. #endif
  739. #endif
  740. #endif // IS_NEWPANEL
  741. #endif // HAS_WIRED_LCD
  742. #if IS_RRW_KEYPAD && !HAS_ADC_BUTTONS
  743. #define SHIFT_OUT_PIN AUX2_06_PIN
  744. #define SHIFT_CLK_PIN AUX2_07_PIN
  745. #define SHIFT_LD_PIN AUX2_08_PIN
  746. #ifndef BTN_EN1
  747. #define BTN_EN1 AUX2_05_PIN
  748. #endif
  749. #ifndef BTN_EN2
  750. #define BTN_EN2 AUX2_03_PIN
  751. #endif
  752. #ifndef BTN_ENC
  753. #define BTN_ENC AUX2_04_PIN
  754. #endif
  755. #endif
  756. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  757. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  758. #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
  759. #endif
  760. /**
  761. * FYSETC TFT-81050 display pinout
  762. *
  763. * Board Display
  764. * ------ ------
  765. * (MISO) 50 | 1 2 | 52 (SCK) 5V |10 9 | GND
  766. * (LCD_CS) 33 | 3 4 | 53 (SD_CS) RESET | 8 7 | (SD_DET)
  767. * 31 5 6 | 51 (MOSI) (MOSI) 6 5 | (LCD_CS)
  768. * (SD_DET) 49 | 7 8 | RESET (SD_CS) | 4 3 | (MOD_RESET)
  769. * GND | 9 10 | -- (SCK) | 2 1 | (MISO)
  770. * ------ ------
  771. * EXP2 EXP1
  772. *
  773. * Needs custom cable:
  774. *
  775. * Board Adapter Display
  776. * ----------------------------------
  777. * EXP2-1 <--diode--- EXP1-1 MISO
  778. * EXP2-2 ----------- EXP1-2 SCK
  779. * EXP2-4 ----------- EXP1-3 MOD_RST
  780. * EXP2-4 ----------- EXP1-4 SD_CS
  781. * EXP2-3 ----------- EXP1-5 LCD_CS
  782. * EXP2-6 ----------- EXP1-6 MOSI
  783. * EXP2-7 ----------- EXP1-7 SD DET
  784. * EXP2-8 ----------- EXP1-8 RESET
  785. * EXP2-1 ----------- EXP1-9 MISO->GND
  786. * EXP1-10 ---------- EXP1-10 5V
  787. *
  788. * NOTE: The MISO pin should not get a 5V signal.
  789. * To fix, insert a 1N4148 diode in the MISO line.
  790. */
  791. #define BEEPER_PIN EXP1_01_PIN
  792. #define SD_DETECT_PIN EXP2_07_PIN
  793. #define CLCD_MOD_RESET EXP2_05_PIN
  794. #define CLCD_SPI_CS EXP2_03_PIN
  795. #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050