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_ZRIB_V53.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2022 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. * ZRIB V5.3 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping
  25. */
  26. #include "env_validate.h"
  27. #if HOTENDS > 2
  28. #error "ZRIB V5.3 supports up to 2 hotends."
  29. #elif E_STEPPERS > 3
  30. #error "ZRIB V5.3 supports up to 3 E steppers."
  31. #endif
  32. #define BOARD_INFO_NAME "ZRIB V5.3"
  33. //
  34. // PIN 12 Connector
  35. //
  36. #define PIN_12_PIN 12
  37. //
  38. // XS1 Connector
  39. //
  40. #define XS1_01_PIN 42
  41. #define XS1_03_PIN 43
  42. #define XS1_05_PIN 44
  43. #define XS1_07_PIN 45
  44. #define XS1_08_PIN 47
  45. //
  46. // XS6 Connector
  47. //
  48. #define XS6_01_PIN 20
  49. #define XS6_03_PIN 52
  50. #define XS6_05_PIN 51
  51. #define XS6_07_PIN 50
  52. #define XS6_08_PIN 21
  53. //
  54. // Servos / XS3 Connector
  55. //
  56. #ifndef SERVO0_PIN
  57. #define SERVO0_PIN 65 // PWM
  58. #endif
  59. #ifndef SERVO1_PIN
  60. #define SERVO1_PIN 66 // PWM
  61. #endif
  62. //
  63. // Limit Switches
  64. //
  65. #ifndef X_STOP_PIN
  66. #ifndef X_MIN_PIN
  67. #define X_MIN_PIN 3
  68. #endif
  69. #ifndef X_MAX_PIN
  70. #define X_MAX_PIN 2
  71. #endif
  72. #endif
  73. #ifndef Y_STOP_PIN
  74. #ifndef Y_MIN_PIN
  75. #define Y_MIN_PIN 14
  76. #endif
  77. #ifndef Y_MAX_PIN
  78. #define Y_MAX_PIN 15
  79. #endif
  80. #endif
  81. #ifndef Z_STOP_PIN
  82. #ifndef Z_MIN_PIN
  83. #define Z_MIN_PIN 18
  84. #endif
  85. #ifndef Z_MAX_PIN
  86. #define Z_MAX_PIN 19
  87. #endif
  88. #endif
  89. //
  90. // Z Probe (when not Z_MIN_PIN)
  91. //
  92. #ifndef Z_MIN_PROBE_PIN
  93. #define Z_MIN_PROBE_PIN 19
  94. #endif
  95. //
  96. // Steppers
  97. //
  98. #define X_STEP_PIN 54
  99. #define X_DIR_PIN 55
  100. #define X_ENABLE_PIN 38
  101. #define Y_STEP_PIN 60
  102. #define Y_DIR_PIN 61
  103. #define Y_ENABLE_PIN 56
  104. #define Z_STEP_PIN 46
  105. #define Z_DIR_PIN 48
  106. #define Z_ENABLE_PIN 62
  107. #if NUM_Z_STEPPERS == 2
  108. #define Z2_STEP_PIN 26 // E0 connector
  109. #define Z2_DIR_PIN 28
  110. #define Z2_ENABLE_PIN 24
  111. #define E0_STEP_PIN 36 // E1 connector
  112. #define E0_DIR_PIN 34
  113. #define E0_ENABLE_PIN 30
  114. #define E1_STEP_PIN 4 // E2 connector
  115. #define E1_DIR_PIN 5
  116. #define E1_ENABLE_PIN 22
  117. #else
  118. #define E0_STEP_PIN 26
  119. #define E0_DIR_PIN 28
  120. #define E0_ENABLE_PIN 24
  121. #define E1_STEP_PIN 36
  122. #define E1_DIR_PIN 34
  123. #define E1_ENABLE_PIN 30
  124. #define E2_STEP_PIN 4
  125. #define E2_DIR_PIN 5
  126. #define E2_ENABLE_PIN 22
  127. #endif
  128. //
  129. // Temperature Sensors
  130. //
  131. #ifndef TEMP_0_PIN
  132. #define TEMP_0_PIN 13 // Analog Input
  133. #endif
  134. #ifndef TEMP_1_PIN
  135. #define TEMP_1_PIN 15 // Analog Input
  136. #endif
  137. #ifndef TEMP_BED_PIN
  138. #define TEMP_BED_PIN 14 // Analog Input
  139. #endif
  140. //
  141. // Heaters / Fans Connectors
  142. //
  143. #define HEATER_0_PIN 10
  144. #define HEATER_1_PIN 7
  145. #define FAN_PIN 9
  146. #define HEATER_BED_PIN 8
  147. #define FAN1_PIN 6
  148. //
  149. // Misc. Functions
  150. //
  151. #ifndef SDSS
  152. #define SDSS 53
  153. #endif
  154. #define LED_PIN 13
  155. #ifndef FIL_RUNOUT_PIN
  156. #define FIL_RUNOUT_PIN XS1_01_PIN
  157. #endif
  158. #ifndef PS_ON_PIN
  159. #define PS_ON_PIN XS1_03_PIN
  160. #endif
  161. #if HAS_TMC_UART
  162. /**
  163. * TMC2209 stepper drivers
  164. *
  165. * Hardware serial communication ports.
  166. * If undefined software serial is used according to the pins below
  167. *
  168. * Serial2 -- AUX-4 Pin 18 (D16 TX2) and AUX-4 Pin 17 (D17 RX2)
  169. * Serial1 -- Pins D18 and D19 are used for Z-MIN and Z-MAX
  170. */
  171. //#define X_HARDWARE_SERIAL Serial1
  172. //#define X2_HARDWARE_SERIAL Serial1
  173. //#define Y_HARDWARE_SERIAL Serial1
  174. //#define Y2_HARDWARE_SERIAL Serial1
  175. //#define Z_HARDWARE_SERIAL Serial1
  176. //#define Z2_HARDWARE_SERIAL Serial1
  177. //#define E0_HARDWARE_SERIAL Serial1
  178. //#define E1_HARDWARE_SERIAL Serial1
  179. //#define E2_HARDWARE_SERIAL Serial1
  180. //#define E3_HARDWARE_SERIAL Serial1
  181. //#define E4_HARDWARE_SERIAL Serial1
  182. #ifndef X_SERIAL_TX_PIN
  183. #define X_SERIAL_TX_PIN XS1_08_PIN
  184. #endif
  185. #ifndef X_SERIAL_RX_PIN
  186. #define X_SERIAL_RX_PIN PIN_12_PIN
  187. #endif
  188. #ifndef X2_SERIAL_TX_PIN
  189. #define X2_SERIAL_TX_PIN -1
  190. #endif
  191. #ifndef X2_SERIAL_RX_PIN
  192. #define X2_SERIAL_RX_PIN -1
  193. #endif
  194. #ifndef Y_SERIAL_TX_PIN
  195. #define Y_SERIAL_TX_PIN XS1_08_PIN
  196. #endif
  197. #ifndef Y_SERIAL_RX_PIN
  198. #define Y_SERIAL_RX_PIN PIN_12_PIN
  199. #endif
  200. #ifndef Y2_SERIAL_TX_PIN
  201. #define Y2_SERIAL_TX_PIN -1
  202. #endif
  203. #ifndef Y2_SERIAL_RX_PIN
  204. #define Y2_SERIAL_RX_PIN -1
  205. #endif
  206. #ifndef Z_SERIAL_TX_PIN
  207. #define Z_SERIAL_TX_PIN XS1_08_PIN
  208. #endif
  209. #ifndef Z_SERIAL_RX_PIN
  210. #define Z_SERIAL_RX_PIN PIN_12_PIN
  211. #endif
  212. #ifndef Z2_SERIAL_TX_PIN
  213. #define Z2_SERIAL_TX_PIN XS1_08_PIN
  214. #endif
  215. #ifndef Z2_SERIAL_RX_PIN
  216. #define Z2_SERIAL_RX_PIN PIN_12_PIN
  217. #endif
  218. #ifndef E0_SERIAL_TX_PIN
  219. #define E0_SERIAL_TX_PIN -1
  220. #endif
  221. #ifndef E0_SERIAL_RX_PIN
  222. #define E0_SERIAL_RX_PIN -1
  223. #endif
  224. #ifndef E1_SERIAL_TX_PIN
  225. #define E1_SERIAL_TX_PIN -1
  226. #endif
  227. #ifndef E1_SERIAL_RX_PIN
  228. #define E1_SERIAL_RX_PIN -1
  229. #endif
  230. #ifndef E2_SERIAL_TX_PIN
  231. #define E2_SERIAL_TX_PIN -1
  232. #endif
  233. #ifndef E2_SERIAL_RX_PIN
  234. #define E2_SERIAL_RX_PIN -1
  235. #endif
  236. #ifndef E3_SERIAL_TX_PIN
  237. #define E3_SERIAL_TX_PIN -1
  238. #endif
  239. #ifndef E3_SERIAL_RX_PIN
  240. #define E3_SERIAL_RX_PIN -1
  241. #endif
  242. #ifndef E4_SERIAL_TX_PIN
  243. #define E4_SERIAL_TX_PIN -1
  244. #endif
  245. #ifndef E4_SERIAL_RX_PIN
  246. #define E4_SERIAL_RX_PIN -1
  247. #endif
  248. #ifndef E5_SERIAL_TX_PIN
  249. #define E5_SERIAL_TX_PIN -1
  250. #endif
  251. #ifndef E5_SERIAL_RX_PIN
  252. #define E5_SERIAL_RX_PIN -1
  253. #endif
  254. #ifndef E6_SERIAL_TX_PIN
  255. #define E6_SERIAL_TX_PIN -1
  256. #endif
  257. #ifndef E6_SERIAL_RX_PIN
  258. #define E6_SERIAL_RX_PIN -1
  259. #endif
  260. #ifndef E7_SERIAL_TX_PIN
  261. #define E7_SERIAL_TX_PIN -1
  262. #endif
  263. #ifndef E7_SERIAL_RX_PIN
  264. #define E7_SERIAL_RX_PIN -1
  265. #endif
  266. #endif
  267. /**
  268. * LCD adapter. NOTE: These come in two variants. The socket keys can be
  269. * on either side, and may be backwards on some displays.
  270. * ------ ------
  271. * D37 | 1 2 | D35 (MISO) D50 | 1 2 | D52 (SCK)
  272. * D17 | 3 4 | D16 D31 | 3 4 | D53
  273. * D23 6 5 D25 D33 6 5 D51 (MOSI)
  274. * D27 | 7 8 | D29 D49 | 7 8 | D41
  275. * GND | 9 10 | 5V GND | 9 10 | --
  276. * ------ ------
  277. * EXP1 EXP2
  278. */
  279. #ifndef EXP1_08_PIN
  280. #define EXP1_01_PIN 37
  281. #define EXP1_02_PIN 35
  282. #define EXP1_03_PIN 17
  283. #define EXP1_04_PIN 16
  284. #define EXP1_05_PIN 23
  285. #define EXP1_06_PIN 25
  286. #define EXP1_07_PIN 27
  287. #define EXP1_08_PIN 29
  288. #define EXP2_01_PIN XS6_07_PIN
  289. #define EXP2_02_PIN XS6_03_PIN
  290. #define EXP2_03_PIN 31
  291. #define EXP2_04_PIN 53
  292. #define EXP2_05_PIN 33
  293. #define EXP2_06_PIN XS6_05_PIN
  294. #define EXP2_07_PIN 49
  295. #define EXP2_08_PIN 41
  296. #endif
  297. //////////////////////////
  298. // LCDs and Controllers //
  299. //////////////////////////
  300. #if ENABLED(ZONESTAR_12864LCD)
  301. #define LCDSCREEN_NAME "ZONESTAR LCD12864"
  302. #define LCD_SDSS 16
  303. #define LCD_PINS_RS 16 // ST7920_CS_PIN LCD_PIN_RS (PIN4 of LCD module)
  304. #define LCD_PINS_ENABLE 23 // ST7920_DAT_PIN LCD_PIN_R/W (PIN5 of LCD module)
  305. #define LCD_PINS_D4 17 // ST7920_CLK_PIN LCD_PIN_ENABLE (PIN6 of LCD module)
  306. #define BTN_EN2 25
  307. #define BTN_EN1 27
  308. #define BTN_ENC 29
  309. #define BEEPER_PIN 37
  310. #define KILL_PIN 35
  311. #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  312. #define LCDSCREEN_NAME "Reprap LCD12864"
  313. // Use EXP1 & EXP2 connector
  314. #define LCD_PINS_RS 16 // ST7920_CS_PIN LCD_PIN_RS
  315. #define LCD_PINS_ENABLE 17 // ST7920_DAT_PIN LCD_PIN_ENABLE
  316. #define LCD_PINS_D4 23 // ST7920_CLK_PIN LCD_PIN_R/W
  317. #define BTN_EN1 31
  318. #define BTN_EN2 33
  319. #define BTN_ENC 35
  320. #define BEEPER_PIN 37
  321. #define KILL_PIN 41
  322. #endif
  323. //================================================================================
  324. // OLED 128x64
  325. //================================================================================
  326. #if EITHER(ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306)
  327. #define LCDSCREEN_NAME "ZONESTAR 12864OLED"
  328. #define LCD_SDSS 16
  329. #define LCD_PINS_RS 23 // RESET Pull low for 1s to init
  330. #define LCD_PINS_DC 17
  331. #define DOGLCD_CS 16 // CS
  332. #define BTN_EN2 25
  333. #define BTN_EN1 27
  334. #define BTN_ENC 29
  335. #define BEEPER_PIN -1
  336. #define KILL_PIN -1
  337. #if EITHER(OLED_HW_IIC, OLED_HW_SPI)
  338. #error "Oops! You must choose SW SPI for ZRIB V53 board and connect the OLED screen to EXP1 connector."
  339. #else // SW_SPI
  340. #define DOGLCD_A0 LCD_PINS_DC
  341. #define DOGLCD_MOSI 35 // SDA
  342. #define DOGLCD_SCK 37 // SCK
  343. #endif
  344. #endif // OLED 128x64
  345. //================================================================================
  346. // LCD 2004 KEYPAD
  347. //================================================================================
  348. #if ENABLED(ZONESTAR_LCD)
  349. #define LCDSCREEN_NAME "LCD2004 ADCKEY"
  350. #define LCD_PINS_RS EXP1_04_PIN
  351. #define LCD_PINS_ENABLE EXP1_03_PIN
  352. #define LCD_PINS_D4 EXP1_05_PIN
  353. #define LCD_PINS_D5 EXP1_06_PIN
  354. #define LCD_PINS_D6 EXP1_07_PIN
  355. #define LCD_PINS_D7 EXP1_08_PIN
  356. #define ADC_KEYPAD_PIN 10 // A10 for ADCKEY
  357. #define BEEPER_PIN EXP1_01_PIN
  358. #endif
  359. /**
  360. * ZRIB V5.3 Main Board
  361. *
  362. * Available connectors on ZRIB V5.3
  363. *
  364. * =======
  365. * | GND |
  366. * |-----| E0
  367. * | 10 | (10) PB4 ** Pin23 ** PWM10
  368. * |-----|
  369. * | GND |
  370. * |-----| E1
  371. * | 7 | ( 7) PH4 ** Pin16 ** PWM7
  372. * |-----|
  373. * | GND |
  374. * |-----| FAN
  375. * | 9 | ( 9) PH6 ** Pin18 ** PWM9
  376. * =======
  377. * =======
  378. * | GND |
  379. * |-----| Heated Bed
  380. * | 8 | ( 8) PH5 ** Pin17 ** PWM8
  381. * =======
  382. * ==========
  383. * | 12-24V |
  384. * |--------| Power
  385. * | GND |
  386. * ==========
  387. * Servos / XS3 Connector
  388. * =================
  389. * | 65 | GND | 5V | (65) PK3 ** Pin86 ** A11
  390. * |----|-----|----|
  391. * | 66 | GND | 5V | (66) PK4 ** Pin85 ** A12
  392. * =================
  393. * ICSP
  394. * =================
  395. * | 5V | 51 | GND | (51) PB2 ** Pin21 ** SPI_MOSI
  396. * |----|----|-----|
  397. * | 50 | 52 | RST | (50) PB3 ** Pin22 ** SPI_MISO
  398. * ================= (52) PB1 ** Pin20 ** SPI_SCK
  399. * XS6 Connector
  400. * ======================
  401. * | 5V | GND | NC | 20 | (20) PD1 ** Pin44 ** I2C_SDA
  402. * |----|-----|----|----|
  403. * | 50 | 51 | 52 | 21 | (50) PB3 ** Pin22 ** SPI_MISO
  404. * ====================== (51) PB2 ** Pin21 ** SPI_MOSI
  405. * (52) PB1 ** Pin20 ** SPI_SCK
  406. * (21) PD0 ** Pin43 ** I2C_SCL
  407. * XS1 Connector
  408. * ======================
  409. * | 5V | GND | NC | 47 | (47) PL2 ** Pin37 ** D47
  410. * |----|-----|----|----|
  411. * | 42 | 43 | 44 | 45 | (45) PL4 ** Pin39 ** D45
  412. * ====================== (44) PL5 ** Pin40 ** D44
  413. * (43) PL6 ** Pin41 ** D43
  414. * (42) PL7 ** Pin42 ** D42
  415. * Temperature
  416. * ==================================
  417. * | GND | 69 | GND | 68 | GND | 67 |
  418. * ==================================
  419. * (69) PK7 ** Pin82 ** A15
  420. * (68) PK6 ** Pin83 ** A14
  421. * (67) PK5 ** Pin84 ** A13
  422. * Limit Switches
  423. * ============
  424. * | 2 | GND | X+ ( 2) PE4 ** Pin6 ** PWM2
  425. * |----|-----|
  426. * | 3 | GND | X- ( 3) PE5 ** Pin7 ** PWM3
  427. * |----|-----|
  428. * | 15 | GND | Y+ (15) PJ0 ** Pin63 ** USART3_RX
  429. * |----|-----|
  430. * | 14 | GND | Y- (14) PJ1 ** Pin64 ** USART3_TX
  431. * |----|-----|
  432. * | 19 | GND | Z+ (19) PD2 ** Pin45 ** USART1_RX
  433. * |----|-----|
  434. * | 18 | GND | Z- (18) PD3 ** Pin46 ** USART1_TX
  435. * ============
  436. * EXP1
  437. * ============
  438. * | 37 | 35 | (37) PC0 ** Pin53 ** D37
  439. * |-----|----| (35) PC2 ** Pin55 ** D35
  440. * | 17 | 16 | (17) PH0 ** Pin12 ** USART2_RX
  441. * |-----|----| (16) PH1 ** Pin13 ** USART2_TX
  442. * | 23 | 25 | (23) PA1 ** Pin77 ** D23
  443. * |-----|----| (25) PA3 ** Pin75 ** D25
  444. * | 27 | 29 | (27) PA5 ** Pin73 ** D27
  445. * |-----|----| (29) PA7 ** Pin71 ** D29
  446. * | GND | 5V |
  447. * ============
  448. * EXP2
  449. * ============
  450. * | 50 | 52 | (50) PB3 ** Pin22 ** SPI_MISO
  451. * |-----|----| (52) PB1 ** Pin20 ** SPI_SCK
  452. * | 31 | 53 | (31) PC6 ** Pin59 ** D31
  453. * |-----|----| (53) PB0 ** Pin19 ** SPI_SS
  454. * | 33 | 51 | (33) PC4 ** Pin57 ** D33
  455. * |-----|----| (51) PB2 ** Pin21 ** SPI_MOSI
  456. * | 49 | 41 | (49) PL0 ** Pin35 ** D49
  457. * |-----|----| (41) PG0 ** Pin51 ** D41
  458. * | GND | NC |
  459. * ============
  460. *
  461. * PIN 12
  462. * ======
  463. * | 12 | (12) PB6 ** Pin25 ** D12
  464. * ======
  465. */