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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  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 AUX3_03_PIN
  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 AUX3_07_PIN
  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. // Augmentation for auto-assigning RAMPS plugs
  178. //
  179. #if NONE(IS_RAMPS_EEB, IS_RAMPS_EEF, IS_RAMPS_EFB, IS_RAMPS_EFF, IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D)
  180. #if HAS_MULTI_HOTEND
  181. #if TEMP_SENSOR_BED
  182. #define IS_RAMPS_EEB
  183. #else
  184. #define IS_RAMPS_EEF
  185. #endif
  186. #elif TEMP_SENSOR_BED
  187. #define IS_RAMPS_EFB
  188. #else
  189. #define IS_RAMPS_EFF
  190. #endif
  191. #endif
  192. //
  193. // Heaters / Fans
  194. //
  195. #ifndef MOSFET_D_PIN
  196. #define MOSFET_D_PIN -1
  197. #endif
  198. #ifndef RAMPS_D8_PIN
  199. #define RAMPS_D8_PIN 8
  200. #endif
  201. #ifndef RAMPS_D9_PIN
  202. #define RAMPS_D9_PIN 9
  203. #endif
  204. #ifndef RAMPS_D10_PIN
  205. #define RAMPS_D10_PIN 10
  206. #endif
  207. #define HEATER_0_PIN RAMPS_D10_PIN
  208. #if ENABLED(IS_RAMPS_EFB) // Hotend, Fan, Bed
  209. #define HEATER_BED_PIN RAMPS_D8_PIN
  210. #elif ENABLED(IS_RAMPS_EEF) // Hotend, Hotend, Fan
  211. #define HEATER_1_PIN RAMPS_D9_PIN
  212. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  213. #define HEATER_1_PIN RAMPS_D9_PIN
  214. #define HEATER_BED_PIN RAMPS_D8_PIN
  215. #elif ENABLED(IS_RAMPS_EFF) // Hotend, Fan, Fan
  216. #define FAN1_PIN RAMPS_D8_PIN
  217. #elif DISABLED(IS_RAMPS_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
  218. #define HEATER_BED_PIN RAMPS_D8_PIN
  219. #if EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL)
  220. #define HEATER_1_PIN MOSFET_D_PIN
  221. #else
  222. #define FAN1_PIN MOSFET_D_PIN
  223. #endif
  224. #endif
  225. #ifndef FAN_PIN
  226. #if EITHER(IS_RAMPS_EFB, IS_RAMPS_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
  227. #define FAN_PIN RAMPS_D9_PIN
  228. #elif EITHER(IS_RAMPS_EEF, IS_RAMPS_SF) // Hotend, Hotend, Fan or Spindle, Fan
  229. #define FAN_PIN RAMPS_D8_PIN
  230. #elif ENABLED(IS_RAMPS_EEB) // Hotend, Hotend, Bed
  231. #define FAN_PIN 4 // IO pin. Buffer needed
  232. #else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
  233. #define FAN_PIN RAMPS_D9_PIN
  234. #endif
  235. #endif
  236. //
  237. // Misc. Functions
  238. //
  239. #ifndef SDSS
  240. #define SDSS AUX3_03_PIN
  241. #endif
  242. #define LED_PIN 13
  243. #ifndef FILWIDTH_PIN
  244. #define FILWIDTH_PIN 5 // Analog Input on AUX2
  245. #endif
  246. // RAMPS 1.4 DIO 4 on the servos connector
  247. #ifndef FIL_RUNOUT_PIN
  248. #define FIL_RUNOUT_PIN 4
  249. #endif
  250. #ifndef PS_ON_PIN
  251. #define PS_ON_PIN 12
  252. #endif
  253. #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN)
  254. #if NUM_SERVOS <= 1 // Prefer the servo connector
  255. #define CASE_LIGHT_PIN 6 // Hardware PWM
  256. #elif HAS_FREE_AUX2_PINS
  257. #define CASE_LIGHT_PIN 44 // Hardware PWM
  258. #endif
  259. #endif
  260. //
  261. // M3/M4/M5 - Spindle/Laser Control
  262. //
  263. #if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN)
  264. #if !NUM_SERVOS // Use servo connector if possible
  265. #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown!
  266. #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM
  267. #define SPINDLE_DIR_PIN 5
  268. #elif HAS_FREE_AUX2_PINS
  269. #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown!
  270. #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
  271. #define SPINDLE_DIR_PIN 65
  272. #else
  273. #error "No auto-assignable Spindle/Laser pins available."
  274. #endif
  275. #endif
  276. //
  277. // TMC software SPI
  278. //
  279. #if ENABLED(TMC_USE_SW_SPI)
  280. #ifndef TMC_SW_MOSI
  281. #define TMC_SW_MOSI 66
  282. #endif
  283. #ifndef TMC_SW_MISO
  284. #define TMC_SW_MISO 44
  285. #endif
  286. #ifndef TMC_SW_SCK
  287. #define TMC_SW_SCK 64
  288. #endif
  289. #endif
  290. #if HAS_TMC_UART
  291. /**
  292. * TMC2208/TMC2209 stepper drivers
  293. *
  294. * Hardware serial communication ports.
  295. * If undefined software serial is used according to the pins below
  296. *
  297. * Serial2 -- AUX-4 Pin 18 (D16 TX2) and AUX-4 Pin 17 (D17 RX2)
  298. * Serial1 -- Pins D18 and D19 are used for Z-MIN and Z-MAX
  299. */
  300. //#define X_HARDWARE_SERIAL Serial1
  301. //#define X2_HARDWARE_SERIAL Serial1
  302. //#define Y_HARDWARE_SERIAL Serial1
  303. //#define Y2_HARDWARE_SERIAL Serial1
  304. //#define Z_HARDWARE_SERIAL Serial1
  305. //#define Z2_HARDWARE_SERIAL Serial1
  306. //#define E0_HARDWARE_SERIAL Serial1
  307. //#define E1_HARDWARE_SERIAL Serial1
  308. //#define E2_HARDWARE_SERIAL Serial1
  309. //#define E3_HARDWARE_SERIAL Serial1
  310. //#define E4_HARDWARE_SERIAL Serial1
  311. #ifndef X_SERIAL_TX_PIN
  312. #define X_SERIAL_TX_PIN 40
  313. #endif
  314. #ifndef X_SERIAL_RX_PIN
  315. #define X_SERIAL_RX_PIN 63
  316. #endif
  317. #ifndef X2_SERIAL_TX_PIN
  318. #define X2_SERIAL_TX_PIN -1
  319. #endif
  320. #ifndef X2_SERIAL_RX_PIN
  321. #define X2_SERIAL_RX_PIN -1
  322. #endif
  323. #ifndef Y_SERIAL_TX_PIN
  324. #define Y_SERIAL_TX_PIN 59
  325. #endif
  326. #ifndef Y_SERIAL_RX_PIN
  327. #define Y_SERIAL_RX_PIN 64
  328. #endif
  329. #ifndef Y2_SERIAL_TX_PIN
  330. #define Y2_SERIAL_TX_PIN -1
  331. #endif
  332. #ifndef Y2_SERIAL_RX_PIN
  333. #define Y2_SERIAL_RX_PIN -1
  334. #endif
  335. #ifndef Z_SERIAL_TX_PIN
  336. #define Z_SERIAL_TX_PIN 42
  337. #endif
  338. #ifndef Z_SERIAL_RX_PIN
  339. #define Z_SERIAL_RX_PIN 65
  340. #endif
  341. #ifndef Z2_SERIAL_TX_PIN
  342. #define Z2_SERIAL_TX_PIN -1
  343. #endif
  344. #ifndef Z2_SERIAL_RX_PIN
  345. #define Z2_SERIAL_RX_PIN -1
  346. #endif
  347. #ifndef E0_SERIAL_TX_PIN
  348. #define E0_SERIAL_TX_PIN 44
  349. #endif
  350. #ifndef E0_SERIAL_RX_PIN
  351. #define E0_SERIAL_RX_PIN 66
  352. #endif
  353. #ifndef E1_SERIAL_TX_PIN
  354. #define E1_SERIAL_TX_PIN -1
  355. #endif
  356. #ifndef E1_SERIAL_RX_PIN
  357. #define E1_SERIAL_RX_PIN -1
  358. #endif
  359. #ifndef E2_SERIAL_TX_PIN
  360. #define E2_SERIAL_TX_PIN -1
  361. #endif
  362. #ifndef E2_SERIAL_RX_PIN
  363. #define E2_SERIAL_RX_PIN -1
  364. #endif
  365. #ifndef E3_SERIAL_TX_PIN
  366. #define E3_SERIAL_TX_PIN -1
  367. #endif
  368. #ifndef E3_SERIAL_RX_PIN
  369. #define E3_SERIAL_RX_PIN -1
  370. #endif
  371. #ifndef E4_SERIAL_TX_PIN
  372. #define E4_SERIAL_TX_PIN -1
  373. #endif
  374. #ifndef E4_SERIAL_RX_PIN
  375. #define E4_SERIAL_RX_PIN -1
  376. #endif
  377. #ifndef E5_SERIAL_TX_PIN
  378. #define E5_SERIAL_TX_PIN -1
  379. #endif
  380. #ifndef E5_SERIAL_RX_PIN
  381. #define E5_SERIAL_RX_PIN -1
  382. #endif
  383. #ifndef E6_SERIAL_TX_PIN
  384. #define E6_SERIAL_TX_PIN -1
  385. #endif
  386. #ifndef E6_SERIAL_RX_PIN
  387. #define E6_SERIAL_RX_PIN -1
  388. #endif
  389. #ifndef E7_SERIAL_TX_PIN
  390. #define E7_SERIAL_TX_PIN -1
  391. #endif
  392. #ifndef E7_SERIAL_RX_PIN
  393. #define E7_SERIAL_RX_PIN -1
  394. #endif
  395. #endif
  396. //
  397. // Průša i3 MK2 Multiplexer Support
  398. //
  399. #ifndef E_MUX0_PIN
  400. #define E_MUX0_PIN 40 // Z_CS_PIN
  401. #endif
  402. #ifndef E_MUX1_PIN
  403. #define E_MUX1_PIN 42 // E0_CS_PIN
  404. #endif
  405. #ifndef E_MUX2_PIN
  406. #define E_MUX2_PIN 44 // E1_CS_PIN
  407. #endif
  408. //
  409. // AUX3 : GND D52 D50 5V
  410. // NC D53 D51 D49
  411. #define AUX3_03_PIN 53
  412. #define AUX3_04_PIN 52
  413. #define AUX3_05_PIN 51
  414. #define AUX3_06_PIN 50
  415. #define AUX3_07_PIN 49
  416. //
  417. // AUX4 : D16 D17 D23 D25 D27 D29 D31 D33 D35 D37 D39 D41 D43 D45 D47 D32 GND 5V
  418. //
  419. #define AUX4_03_PIN 32
  420. #define AUX4_04_PIN 47
  421. #define AUX4_05_PIN 45
  422. #define AUX4_06_PIN 43
  423. #define AUX4_07_PIN 41
  424. #define AUX4_08_PIN 39
  425. #define AUX4_09_PIN 37
  426. #define AUX4_10_PIN 35
  427. #define AUX4_11_PIN 33
  428. #define AUX4_12_PIN 31
  429. #define AUX4_13_PIN 29
  430. #define AUX4_14_PIN 27
  431. #define AUX4_15_PIN 25
  432. #define AUX4_16_PIN 23
  433. #define AUX4_17_PIN 17
  434. #define AUX4_18_PIN 16
  435. /**
  436. * LCD adapter. NOTE: These come in two variants. The socket keys can be
  437. * on either side, and may be backwards on some boards / displays.
  438. * ------ ------
  439. * D37 |10 9 | D35 (MISO) D50 |10 9 | D52 (SCK)
  440. * D17 | 8 7 | D16 D31 | 8 7 | D53
  441. * D23 6 5 D25 D33 6 5 D51 (MOSI)
  442. * D27 | 4 3 | D29 D49 | 4 3 | D41
  443. * GND | 2 1 | 5V GND | 2 1 | NC
  444. * ------ ------
  445. * EXP1 EXP2
  446. */
  447. #ifndef EXP1_03_PIN
  448. #define EXP1_03_PIN AUX4_13_PIN
  449. #define EXP1_04_PIN AUX4_14_PIN
  450. #define EXP1_05_PIN AUX4_15_PIN
  451. #define EXP1_06_PIN AUX4_16_PIN
  452. #define EXP1_07_PIN AUX4_18_PIN
  453. #define EXP1_08_PIN AUX4_17_PIN
  454. #define EXP1_09_PIN AUX4_10_PIN
  455. #define EXP1_10_PIN AUX4_09_PIN
  456. #define EXP2_03_PIN AUX4_07_PIN
  457. #define EXP2_04_PIN AUX3_07_PIN
  458. #define EXP2_05_PIN AUX3_05_PIN
  459. #define EXP2_06_PIN AUX4_11_PIN
  460. #define EXP2_07_PIN AUX3_03_PIN
  461. #define EXP2_08_PIN AUX4_12_PIN
  462. #define EXP2_09_PIN AUX3_04_PIN
  463. #define EXP2_10_PIN AUX3_06_PIN
  464. #endif
  465. //////////////////////////
  466. // LCDs and Controllers //
  467. //////////////////////////
  468. #if HAS_WIRED_LCD
  469. // Uncomment screen orientation
  470. //#define LCD_SCREEN_ROT_90
  471. //#define LCD_SCREEN_ROT_180
  472. //#define LCD_SCREEN_ROT_270
  473. //
  474. // LCD Display output pins
  475. //
  476. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  477. #define LCD_PINS_RS EXP2_04_PIN // CS chip select /SS chip slave select
  478. #define LCD_PINS_ENABLE EXP2_05_PIN // SID (MOSI)
  479. #define LCD_PINS_D4 EXP2_09_PIN // SCK (CLK) clock
  480. #elif BOTH(IS_NEWPANEL, PANEL_ONE)
  481. #define LCD_PINS_RS 40
  482. #define LCD_PINS_ENABLE 42
  483. #define LCD_PINS_D4 65
  484. #define LCD_PINS_D5 66
  485. #define LCD_PINS_D6 44
  486. #define LCD_PINS_D7 64
  487. #elif ENABLED(TFTGLCD_PANEL_SPI)
  488. #define TFTGLCD_CS EXP2_06_PIN
  489. #else
  490. #if ENABLED(CR10_STOCKDISPLAY)
  491. #define LCD_PINS_RS EXP1_04_PIN
  492. #define LCD_PINS_ENABLE EXP1_03_PIN
  493. #define LCD_PINS_D4 EXP1_05_PIN
  494. #if !IS_NEWPANEL
  495. #define BEEPER_PIN EXP1_10_PIN
  496. #endif
  497. #elif ENABLED(ZONESTAR_LCD)
  498. #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."
  499. #define LCD_PINS_RS 64
  500. #define LCD_PINS_ENABLE 44
  501. #define LCD_PINS_D4 63
  502. #define LCD_PINS_D5 40
  503. #define LCD_PINS_D6 42
  504. #define LCD_PINS_D7 65
  505. #else
  506. #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
  507. #define LCD_PINS_DC EXP1_05_PIN // Set as output on init
  508. #define LCD_PINS_RS EXP1_04_PIN // Pull low for 1s to init
  509. // DOGM SPI LCD Support
  510. #define DOGLCD_A0 LCD_PINS_DC
  511. #define DOGLCD_CS EXP1_07_PIN
  512. #define DOGLCD_MOSI EXP1_08_PIN
  513. #define DOGLCD_SCK EXP1_06_PIN
  514. #else
  515. #define LCD_PINS_RS EXP1_07_PIN
  516. #define LCD_PINS_ENABLE EXP1_08_PIN
  517. #define LCD_PINS_D4 EXP1_06_PIN
  518. #define LCD_PINS_D5 EXP1_05_PIN
  519. #define LCD_PINS_D6 EXP1_04_PIN
  520. #endif
  521. #define LCD_PINS_D7 EXP1_03_PIN
  522. #if !IS_NEWPANEL
  523. #define BEEPER_PIN EXP2_06_PIN
  524. #endif
  525. #endif
  526. #if !IS_NEWPANEL
  527. // Buttons attached to a shift register
  528. // Not wired yet
  529. //#define SHIFT_CLK_PIN 38
  530. //#define SHIFT_LD_PIN 42
  531. //#define SHIFT_OUT_PIN 40
  532. //#define SHIFT_EN_PIN EXP1_08_PIN
  533. #endif
  534. #endif
  535. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  536. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  537. #endif
  538. //
  539. // LCD Display input pins
  540. //
  541. #if IS_NEWPANEL
  542. #if IS_RRD_SC
  543. #define BEEPER_PIN EXP1_10_PIN
  544. #if ENABLED(CR10_STOCKDISPLAY)
  545. #define BTN_EN1 EXP1_08_PIN
  546. #define BTN_EN2 EXP1_06_PIN
  547. #else
  548. #define BTN_EN1 EXP2_08_PIN
  549. #define BTN_EN2 EXP2_06_PIN
  550. #endif
  551. #define BTN_ENC EXP1_09_PIN
  552. #ifndef SD_DETECT_PIN
  553. #define SD_DETECT_PIN EXP2_04_PIN
  554. #endif
  555. #ifndef KILL_PIN
  556. #define KILL_PIN EXP2_03_PIN
  557. #endif
  558. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  559. #define LCD_BACKLIGHT_PIN AUX4_08_PIN
  560. #endif
  561. #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  562. #define BTN_EN1 64
  563. #define BTN_EN2 59
  564. #define BTN_ENC 63
  565. #define SD_DETECT_PIN 42
  566. #elif ENABLED(LCD_I2C_PANELOLU2)
  567. #define BTN_EN1 AUX4_04_PIN
  568. #define BTN_EN2 AUX4_06_PIN
  569. #define BTN_ENC AUX4_03_PIN
  570. #define LCD_SDSS SDSS
  571. #define KILL_PIN EXP2_03_PIN
  572. #elif ENABLED(LCD_I2C_VIKI)
  573. #define BTN_EN1 40 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42.
  574. #define BTN_EN2 42
  575. #define BTN_ENC -1
  576. #define LCD_SDSS SDSS
  577. #define SD_DETECT_PIN EXP2_04_PIN
  578. #elif ANY(VIKI2, miniVIKI)
  579. #define DOGLCD_CS 45
  580. #define DOGLCD_A0 44
  581. #define LCD_SCREEN_ROT_180
  582. #define BEEPER_PIN EXP2_06_PIN
  583. #define STAT_LED_RED_PIN 32
  584. #define STAT_LED_BLUE_PIN EXP1_09_PIN
  585. #define BTN_EN1 22
  586. #define BTN_EN2 7
  587. #define BTN_ENC 39
  588. #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board
  589. #define KILL_PIN EXP2_08_PIN
  590. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  591. #define DOGLCD_CS EXP1_03_PIN
  592. #define DOGLCD_A0 EXP1_04_PIN
  593. #define BEEPER_PIN EXP1_06_PIN
  594. #define LCD_BACKLIGHT_PIN EXP2_06_PIN
  595. #define BTN_EN1 EXP1_09_PIN
  596. #define BTN_EN2 EXP1_10_PIN
  597. #define BTN_ENC EXP2_08_PIN
  598. #define LCD_SDSS SDSS
  599. #define SD_DETECT_PIN EXP2_04_PIN
  600. #define KILL_PIN EXP2_03_PIN
  601. #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864)
  602. #define BEEPER_PIN EXP1_10_PIN
  603. #define BTN_ENC EXP1_09_PIN
  604. #ifndef SD_DETECT_PIN
  605. #define SD_DETECT_PIN EXP2_04_PIN
  606. #endif
  607. #ifndef KILL_PIN
  608. #define KILL_PIN EXP2_03_PIN
  609. #endif
  610. #if ENABLED(MKS_MINI_12864)
  611. #define DOGLCD_A0 EXP1_04_PIN
  612. #define DOGLCD_CS EXP1_05_PIN
  613. // not connected to a pin
  614. #define LCD_BACKLIGHT_PIN -1 // 65 (MKS mini12864 can't adjust backlight by software!)
  615. #define BTN_EN1 EXP2_08_PIN
  616. #define BTN_EN2 EXP2_06_PIN
  617. #elif ENABLED(FYSETC_MINI_12864)
  618. // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
  619. #define DOGLCD_A0 EXP1_07_PIN
  620. #define DOGLCD_CS EXP1_08_PIN
  621. #define BTN_EN1 EXP2_06_PIN
  622. #define BTN_EN2 EXP2_08_PIN
  623. //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
  624. // results in LCD soft SPI mode 3, SD soft SPI mode 0
  625. #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
  626. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  627. #ifndef RGB_LED_R_PIN
  628. #define RGB_LED_R_PIN EXP1_05_PIN
  629. #endif
  630. #ifndef RGB_LED_G_PIN
  631. #define RGB_LED_G_PIN EXP1_04_PIN
  632. #endif
  633. #ifndef RGB_LED_B_PIN
  634. #define RGB_LED_B_PIN EXP1_03_PIN
  635. #endif
  636. #elif ENABLED(FYSETC_MINI_12864_2_1)
  637. #define NEOPIXEL_PIN EXP1_05_PIN
  638. #endif
  639. #endif
  640. #elif ENABLED(MINIPANEL)
  641. #define BEEPER_PIN 42
  642. // not connected to a pin
  643. #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
  644. #define DOGLCD_A0 44
  645. #define DOGLCD_CS 66
  646. #define BTN_EN1 40
  647. #define BTN_EN2 63
  648. #define BTN_ENC 59
  649. #define SD_DETECT_PIN EXP2_04_PIN
  650. #define KILL_PIN 64
  651. #elif ENABLED(ZONESTAR_LCD)
  652. #define ADC_KEYPAD_PIN 12
  653. #elif ENABLED(AZSMZ_12864)
  654. // Pins only defined for RAMPS_SMART currently
  655. #elif ENABLED(G3D_PANEL)
  656. #define BEEPER_PIN EXP2_06_PIN
  657. #define SD_DETECT_PIN EXP2_04_PIN
  658. #define KILL_PIN EXP2_03_PIN
  659. #define BTN_EN1 EXP1_10_PIN
  660. #define BTN_EN2 EXP1_09_PIN
  661. #define BTN_ENC EXP2_08_PIN
  662. #elif IS_TFTGLCD_PANEL
  663. #define SD_DETECT_PIN EXP2_04_PIN
  664. #else
  665. #define BEEPER_PIN EXP2_06_PIN
  666. // Buttons are directly attached to AUX-2
  667. #if ENABLED(PANEL_ONE)
  668. #define BTN_EN1 59 // AUX2 PIN 3
  669. #define BTN_EN2 63 // AUX2 PIN 4
  670. #define BTN_ENC EXP2_04_PIN
  671. #else
  672. #define BTN_EN1 EXP1_10_PIN
  673. #define BTN_EN2 EXP1_09_PIN
  674. #define BTN_ENC EXP2_08_PIN
  675. #endif
  676. #endif
  677. #endif // IS_NEWPANEL
  678. #endif // HAS_WIRED_LCD
  679. #if IS_RRW_KEYPAD && !HAS_ADC_BUTTONS
  680. #define SHIFT_OUT_PIN 40
  681. #define SHIFT_CLK_PIN 44
  682. #define SHIFT_LD_PIN 42
  683. #ifndef BTN_EN1
  684. #define BTN_EN1 64
  685. #endif
  686. #ifndef BTN_EN2
  687. #define BTN_EN2 59
  688. #endif
  689. #ifndef BTN_ENC
  690. #define BTN_ENC 63
  691. #endif
  692. #endif
  693. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  694. #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. Comment out this line to continue."
  695. /**
  696. * FYSETC TFT-81050 display pinout
  697. *
  698. * Board Display
  699. * ----- -----
  700. * (SCK) D52 | 1 2 | D50 (MISO) MISO | 1 2 | SCK
  701. * (SD_CS) D53 | 3 4 | D33 (BNT_EN2) (BNT_EN2) MOD_RESET | 3 4 | SD_CS
  702. * (MOSI) D51 | 5 6 D31 (BNT_EN1) (BNT_EN1) LCD_CS | 5 6 MOSI
  703. * RESET | 7 8 | D49 (SD_DET) SD_DET | 7 8 | RESET
  704. * NC | 9 10| GND GND | 9 10| 5V
  705. * ----- -----
  706. * EXP2 EXP1
  707. *
  708. * Needs custom cable:
  709. *
  710. * Board Adapter Display
  711. * _________
  712. * EXP2-1 ----------- EXP1-10
  713. * EXP2-2 ----------- EXP1-9
  714. * EXP2-4 ----------- EXP1-8
  715. * EXP2-4 ----------- EXP1-7
  716. * EXP2-3 ----------- EXP1-6
  717. * EXP2-6 ----------- EXP1-5
  718. * EXP2-7 ----------- EXP1-4
  719. * EXP2-8 ----------- EXP1-3
  720. * EXP2-1 ----------- EXP1-2
  721. * EXP1-10 ---------- EXP1-1
  722. *
  723. * NOTE: The MISO pin should not get a 5V signal.
  724. * To fix, insert a 1N4148 diode in the MISO line.
  725. */
  726. #define BEEPER_PIN EXP1_10_PIN
  727. #define SD_DETECT_PIN EXP2_04_PIN
  728. #define CLCD_MOD_RESET EXP2_08_PIN
  729. #define CLCD_SPI_CS EXP2_06_PIN
  730. #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050