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

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