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_BTT_SKR_MINI_E3_common.h 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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. #include "env_validate.h"
  24. // Release PB3/PB4 (E0 STP/DIR) from JTAG pins
  25. #define DISABLE_JTAG
  26. // Ignore temp readings during development.
  27. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
  28. #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
  29. #define FLASH_EEPROM_EMULATION
  30. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  31. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  32. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
  33. #endif
  34. //
  35. // Servos
  36. //
  37. #define SERVO0_PIN PA1 // SERVOS
  38. //
  39. // Limit Switches
  40. //
  41. #define X_STOP_PIN PC0 // X-STOP
  42. #define Y_STOP_PIN PC1 // Y-STOP
  43. #define Z_STOP_PIN PC2 // Z-STOP
  44. //
  45. // Z Probe must be this pin
  46. //
  47. #define Z_MIN_PROBE_PIN PC14 // PROBE
  48. //
  49. // Filament Runout Sensor
  50. //
  51. #ifndef FIL_RUNOUT_PIN
  52. #define FIL_RUNOUT_PIN PC15 // E0-STOP
  53. #endif
  54. //
  55. // Power-loss Detection
  56. //
  57. #ifndef POWER_LOSS_PIN
  58. #define POWER_LOSS_PIN PC12 // Power Loss Detection: PWR-DET
  59. #endif
  60. //
  61. // Steppers
  62. //
  63. #define X_ENABLE_PIN PB14
  64. #define X_STEP_PIN PB13
  65. #define X_DIR_PIN PB12
  66. #define Y_ENABLE_PIN PB11
  67. #define Y_STEP_PIN PB10
  68. #define Y_DIR_PIN PB2
  69. #define Z_ENABLE_PIN PB1
  70. #define Z_STEP_PIN PB0
  71. #define Z_DIR_PIN PC5
  72. #define E0_ENABLE_PIN PD2
  73. #define E0_STEP_PIN PB3
  74. #define E0_DIR_PIN PB4
  75. //
  76. // Temperature Sensors
  77. //
  78. #define TEMP_0_PIN PA0 // Analog Input "TH0"
  79. #define TEMP_BED_PIN PC3 // Analog Input "TB0"
  80. //
  81. // Heaters / Fans
  82. //
  83. #define HEATER_0_PIN PC8 // "HE"
  84. #define HEATER_BED_PIN PC9 // "HB"
  85. #ifdef SKR_MINI_E3_V2
  86. #define FAN_PIN PC6
  87. #else
  88. #define FAN_PIN PA8 // "FAN0"
  89. #endif
  90. //
  91. // USB connect control
  92. //
  93. #ifdef SKR_MINI_E3_V2
  94. #define USB_CONNECT_PIN PA14
  95. #else
  96. #define USB_CONNECT_PIN PC13
  97. #endif
  98. #define USB_CONNECT_INVERTING false
  99. /**
  100. * SKR Mini E3 V1.0, V1.2 SKR Mini E3 V2.0
  101. * ------ ------
  102. * 5V | 1 2 | GND 5V | 1 2 | GND
  103. * (LCD_EN) PB7 | 3 4 | PB8 (LCD_RS) (LCD_EN) PB15 | 3 4 | PB8 (LCD_RS)
  104. * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2)
  105. * RESET | 7 8 | PA9 (BTN_EN1) RESET | 7 8 | PA9 (BTN_EN1)
  106. * (BTN_ENC) PB6 | 9 10 | PB5 (BEEPER) (BTN_ENC) PA15 | 9 10 | PB5 (BEEPER)
  107. * ------ ------
  108. * EXP1 EXP1
  109. */
  110. #ifdef SKR_MINI_E3_V2
  111. #define EXP1_9 PA15
  112. #define EXP1_3 PB15
  113. #else
  114. #define EXP1_9 PB6
  115. #define EXP1_3 PB7
  116. #endif
  117. #if EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
  118. /**
  119. * ------ ------ ------
  120. * VCC | 1 2 | GND VCC | 1 2 | GND GND | 2 1 | VCC
  121. * A | 3 4 | B A | 3 4 | B B | 4 3 | A
  122. * | 5 6 TX BEEP | 5 6 ENT ENT | 6 5 | BEEP
  123. * | 7 8 | RX TX | 7 8 | RX RX | 8 7 | TX
  124. * BEEP | 9 10 | ENT | 9 10 | | 10 9 |
  125. * ------ ------ ------
  126. * EXP1 DWIN DWIN (plug)
  127. *
  128. * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on.
  129. */
  130. #error "DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. Comment out this line to continue."
  131. #define BEEPER_PIN EXP1_9
  132. #define BTN_EN1 EXP1_3
  133. #define BTN_EN2 PB8
  134. #define BTN_ENC PB5
  135. #elif HAS_WIRED_LCD
  136. #if ENABLED(CR10_STOCKDISPLAY)
  137. #define BEEPER_PIN PB5
  138. #define BTN_ENC EXP1_9
  139. #define BTN_EN1 PA9
  140. #define BTN_EN2 PA10
  141. #define LCD_PINS_RS PB8
  142. #define LCD_PINS_ENABLE EXP1_3
  143. #define LCD_PINS_D4 PB9
  144. #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  145. #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
  146. #define LCD_PINS_RS PB9
  147. #define LCD_PINS_ENABLE EXP1_9
  148. #define LCD_PINS_D4 PB8
  149. #define LCD_PINS_D5 PA10
  150. #define LCD_PINS_D6 PA9
  151. #define LCD_PINS_D7 PB5
  152. #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
  153. #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
  154. #define BTN_ENC EXP1_9
  155. #define BTN_EN1 PA9
  156. #define BTN_EN2 PA10
  157. #define DOGLCD_CS PB8
  158. #define DOGLCD_A0 PB9
  159. #define DOGLCD_SCK PB5
  160. #define DOGLCD_MOSI EXP1_3
  161. #define FORCE_SOFT_SPI
  162. #define LCD_BACKLIGHT_PIN -1
  163. #elif IS_TFTGLCD_PANEL
  164. #if ENABLED(TFTGLCD_PANEL_SPI)
  165. #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
  166. /**
  167. * TFTGLCD_PANEL_SPI display pinout
  168. *
  169. * Board Display
  170. * ------ ------
  171. * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK)
  172. * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) LCD_CS | 3 4 | SD_CS (PA10)
  173. * (FREE) PB9 | 5 6 | PA10 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI)
  174. * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE)
  175. * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V
  176. * ------ ------
  177. * EXP1 EXP1
  178. *
  179. * Needs custom cable:
  180. *
  181. * Board Display
  182. *
  183. * EXP1-1 ----------- EXP1-10
  184. * EXP1-2 ----------- EXP1-9
  185. * SPI1-4 ----------- EXP1-6
  186. * EXP1-4 ----------- FREE
  187. * SPI1-3 ----------- EXP1-2
  188. * EXP1-6 ----------- EXP1-4
  189. * EXP1-7 ----------- FREE
  190. * EXP1-8 ----------- EXP1-3
  191. * SPI1-1 ----------- EXP1-1
  192. * EXP1-10 ----------- EXP1-7
  193. */
  194. #define TFTGLCD_CS PA9
  195. #endif
  196. #else
  197. #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3."
  198. #endif
  199. #endif // HAS_WIRED_LCD
  200. #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
  201. #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
  202. /**
  203. * FYSETC TFT TFT81050 display pinout
  204. *
  205. * Board Display
  206. * ------ ------
  207. * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK)
  208. * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10)
  209. * (FREE) PB9 | 5 6 | PA10 (SD_CS) (PB8) LCD_CS | 5 6 | MOSI (SPI1-MOSI)
  210. * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | RESET
  211. * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V
  212. * ------ ------
  213. * EXP1 EXP1
  214. *
  215. * Needs custom cable:
  216. *
  217. * Board Adapter Display
  218. * _________
  219. * EXP1-1 ----------- EXP1-10
  220. * EXP1-2 ----------- EXP1-9
  221. * SPI1-4 ----------- EXP1-6
  222. * EXP1-4 ----------- EXP1-5
  223. * SPI1-3 ----------- EXP1-2
  224. * EXP1-6 ----------- EXP1-4
  225. * EXP1-7 ----------- EXP1-8
  226. * EXP1-8 ----------- EXP1-3
  227. * SPI1-1 ----------- EXP1-1
  228. * EXP1-10 ----------- EXP1-7
  229. */
  230. #define CLCD_SPI_BUS 1 // SPI1 connector
  231. #define BEEPER_PIN EXP1_9
  232. #define CLCD_MOD_RESET PA9
  233. #define CLCD_SPI_CS PB8
  234. #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
  235. //
  236. // SD Support
  237. //
  238. #ifndef SDCARD_CONNECTION
  239. #define SDCARD_CONNECTION ONBOARD
  240. #endif
  241. #if SD_CONNECTION_IS(ONBOARD)
  242. #define SD_DETECT_PIN PC4
  243. #elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
  244. #define SD_DETECT_PIN PB5
  245. #define SD_SS_PIN PA10
  246. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  247. #error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
  248. #endif
  249. #define ONBOARD_SPI_DEVICE 1 // SPI1 -> used only by HAL/STM32F1...
  250. #define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
  251. #define ENABLE_SPI1
  252. #define SDSS ONBOARD_SD_CS_PIN
  253. #define SD_SCK_PIN PA5
  254. #define SD_MISO_PIN PA6
  255. #define SD_MOSI_PIN PA7