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

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