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_BTT002_V1_0.h 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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. #if HAS_MULTI_HOTEND || E_STEPPERS > 1
  25. #error "BIGTREE BTT002 V1.0 only supports 1 hotend / E stepper."
  26. #endif
  27. #define BOARD_INFO_NAME "BTT BTT002 V1.0"
  28. //#define MK3_FAN_PINS
  29. #define USES_DIAG_PINS
  30. // Ignore temp readings during development.
  31. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
  32. // Use one of these or SDCard-based Emulation will be used
  33. #if NO_EEPROM_SELECTED
  34. //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation
  35. #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation
  36. #endif
  37. #if ENABLED(FLASH_EEPROM_EMULATION)
  38. // Decrease delays and flash wear by spreading writes across the
  39. // 128 kB sector allocated for EEPROM emulation.
  40. #define FLASH_EEPROM_LEVELING
  41. #endif
  42. //
  43. // Limit Switches
  44. //
  45. #define X_STOP_PIN PD3
  46. #define Y_STOP_PIN PD2
  47. #define Z_STOP_PIN PD1 // Shares J4 connector with PC3
  48. //
  49. // Z Probe must be this pin
  50. //
  51. #ifndef Z_MIN_PROBE_PIN
  52. #define Z_MIN_PROBE_PIN PD1
  53. #endif
  54. //
  55. // Filament Runout Sensor
  56. //
  57. #ifndef FIL_RUNOUT_PIN
  58. #define FIL_RUNOUT_PIN PA15
  59. #endif
  60. //
  61. // Power Loss Detection
  62. //
  63. #ifndef POWER_LOSS_PIN
  64. #define POWER_LOSS_PIN PD4
  65. #endif
  66. //
  67. // Steppers
  68. //
  69. #define X_STEP_PIN PA9
  70. #define X_DIR_PIN PA10
  71. #define X_ENABLE_PIN PA8
  72. #ifndef X_CS_PIN
  73. #define X_CS_PIN PE2
  74. #endif
  75. #define Y_STEP_PIN PC8
  76. #define Y_DIR_PIN PC9
  77. #define Y_ENABLE_PIN PC7
  78. #ifndef Y_CS_PIN
  79. #define Y_CS_PIN PE3
  80. #endif
  81. #define Z_STEP_PIN PD15
  82. #define Z_DIR_PIN PC6
  83. #define Z_ENABLE_PIN PD14
  84. #ifndef Z_CS_PIN
  85. #define Z_CS_PIN PE4
  86. #endif
  87. #define E0_STEP_PIN PD12
  88. #define E0_DIR_PIN PD13
  89. #define E0_ENABLE_PIN PD11
  90. #ifndef E0_CS_PIN
  91. #define E0_CS_PIN PD7
  92. #endif
  93. //
  94. // Software SPI pins for TMC2130 stepper drivers
  95. //
  96. #if ENABLED(TMC_USE_SW_SPI)
  97. #ifndef TMC_SW_MOSI
  98. #define TMC_SW_MOSI PB15
  99. #endif
  100. #ifndef TMC_SW_MISO
  101. #define TMC_SW_MISO PB14
  102. #endif
  103. #ifndef TMC_SW_SCK
  104. #define TMC_SW_SCK PB13
  105. #endif
  106. #endif
  107. #if HAS_TMC_UART
  108. /**
  109. * TMC2208/TMC2209 stepper drivers
  110. *
  111. * Hardware serial communication ports.
  112. * If undefined software serial is used according to the pins below
  113. */
  114. //#define X_HARDWARE_SERIAL Serial1
  115. //#define X2_HARDWARE_SERIAL Serial1
  116. //#define Y_HARDWARE_SERIAL Serial1
  117. //#define Y2_HARDWARE_SERIAL Serial1
  118. //#define Z_HARDWARE_SERIAL Serial1
  119. //#define Z2_HARDWARE_SERIAL Serial1
  120. //#define E0_HARDWARE_SERIAL Serial1
  121. //#define E1_HARDWARE_SERIAL Serial1
  122. //#define E2_HARDWARE_SERIAL Serial1
  123. //#define E3_HARDWARE_SERIAL Serial1
  124. //#define E4_HARDWARE_SERIAL Serial1
  125. #define X_SERIAL_TX_PIN PE2
  126. #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
  127. #define Y_SERIAL_TX_PIN PE3
  128. #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
  129. #define Z_SERIAL_TX_PIN PE4
  130. #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
  131. #define E0_SERIAL_TX_PIN PD7
  132. #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
  133. // Reduce baud rate to improve software serial reliability
  134. #define TMC_BAUD_RATE 19200
  135. #endif
  136. //
  137. // Temperature Sensors
  138. //
  139. #define TEMP_0_PIN PA2 // T0 <-> E0
  140. #define TEMP_1_PIN PA0 // T1 <-> E1
  141. #define TEMP_BOARD_PIN PC2 // Onboard thermistor, NTC100K
  142. #define TEMP_BED_PIN PA1 // T2 <-> Bed
  143. #define TEMP_PROBE_PIN PC3 // Shares J4 connector with PD1
  144. //
  145. // Heaters / Fans
  146. //
  147. #define HEATER_0_PIN PE6 // Heater0
  148. #define HEATER_BED_PIN PE5 // Hotbed
  149. #ifndef FAN_PIN
  150. #ifdef MK3_FAN_PINS
  151. #define FAN_PIN PB8 // Fan1
  152. #else
  153. #define FAN_PIN PB9 // Fan0
  154. #endif
  155. #endif
  156. #ifndef FAN1_PIN
  157. #ifdef MK3_FAN_PINS
  158. #define FAN1_PIN PB9 // Fan0
  159. #else
  160. #define FAN1_PIN PB8 // Fan1
  161. #endif
  162. #endif
  163. #ifndef E0_FAN_TACHO_PIN
  164. #ifdef MK3_FAN_PINS
  165. #define E0_FAN_TACHO_PIN PE1 // Fan1
  166. #else
  167. #define E0_FAN_TACHO_PIN PE0 // Fan0
  168. #endif
  169. #endif
  170. /**
  171. * ---------------------------------BTT002 V1.0---------------------------------
  172. * ------ ------ |
  173. * (BEEPER) PE7 |10 9 | PB1 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) |
  174. * (LCD_EN) PE9 | 8 7 | PE8 (LCD_RS) (BTN_EN1) PC5 | 8 7 | PA4 (SD_SS) |
  175. * (LCD_D4) PE10 6 5 | PE11 (LCD_D5) (BTN_EN2) PB0 6 5 | PA7 (MOSI) |
  176. * (LCD_D6) PE12 | 4 3 | PE13 (LCD_D7) (SD_DET) PC4 | 4 3 | RESET |
  177. * GND | 2 1 | 5V GND | 2 1 | PA3 |
  178. * ------ ------ |
  179. * EXP1 EXP2 |
  180. * ------------------------------------------------------------------------------
  181. */
  182. #define EXP1_03_PIN PE13
  183. #define EXP1_04_PIN PE12
  184. #define EXP1_05_PIN PE11
  185. #define EXP1_06_PIN PE10
  186. #define EXP1_07_PIN PE8
  187. #define EXP1_08_PIN PE9
  188. #define EXP1_09_PIN PB1
  189. #define EXP1_10_PIN PE7
  190. #define EXP2_01_PIN PA3
  191. #define EXP2_03_PIN -1
  192. #define EXP2_04_PIN PC4
  193. #define EXP2_05_PIN PA7
  194. #define EXP2_06_PIN PB0
  195. #define EXP2_07_PIN PA4
  196. #define EXP2_08_PIN PC5
  197. #define EXP2_09_PIN PA5
  198. #define EXP2_10_PIN PA6
  199. // HAL SPI1 pins
  200. #define SD_SCK_PIN EXP2_09_PIN // SPI1 SCLK
  201. #define SD_SS_PIN EXP2_07_PIN // SPI1 SSEL
  202. #define SD_MISO_PIN EXP2_10_PIN // SPI1 MISO
  203. #define SD_MOSI_PIN EXP2_05_PIN // SPI1 MOSI
  204. #define SDSS EXP2_07_PIN
  205. //
  206. // LCDs and Controllers
  207. //
  208. #if HAS_WIRED_LCD
  209. #define BEEPER_PIN EXP1_10_PIN
  210. #define BTN_ENC EXP1_09_PIN
  211. #define SD_DETECT_PIN EXP2_04_PIN
  212. #if ENABLED(CR10_STOCKDISPLAY)
  213. #define LCD_PINS_RS EXP1_04_PIN
  214. #define BTN_EN1 EXP1_08_PIN
  215. #define BTN_EN2 EXP1_06_PIN
  216. #define LCD_PINS_ENABLE EXP1_03_PIN
  217. #define LCD_PINS_D4 EXP1_05_PIN
  218. #elif ENABLED(MKS_MINI_12864)
  219. #define DOGLCD_A0 EXP1_04_PIN
  220. #define DOGLCD_CS EXP1_05_PIN
  221. #define BTN_EN1 EXP2_08_PIN
  222. #define BTN_EN2 EXP2_06_PIN
  223. #else
  224. #define LCD_PINS_RS EXP1_07_PIN
  225. #define BTN_EN1 EXP2_08_PIN
  226. #define BTN_EN2 EXP2_06_PIN
  227. #define LCD_PINS_ENABLE EXP1_08_PIN
  228. #define LCD_PINS_D4 EXP1_06_PIN
  229. #if ENABLED(FYSETC_MINI_12864)
  230. #define DOGLCD_CS EXP1_08_PIN
  231. #define DOGLCD_A0 EXP1_07_PIN
  232. #define DOGLCD_MOSI EXP2_05_PIN
  233. #define DOGLCD_MISO EXP2_10_PIN
  234. #define DOGLCD_SCK EXP2_09_PIN
  235. #define LCD_BACKLIGHT_PIN -1
  236. #define FORCE_SOFT_SPI
  237. #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
  238. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
  239. #ifndef RGB_LED_R_PIN
  240. #define RGB_LED_R_PIN EXP1_05_PIN
  241. #endif
  242. #ifndef RGB_LED_G_PIN
  243. #define RGB_LED_G_PIN EXP1_04_PIN
  244. #endif
  245. #ifndef RGB_LED_B_PIN
  246. #define RGB_LED_B_PIN EXP1_03_PIN
  247. #endif
  248. #elif ENABLED(FYSETC_MINI_12864_2_1)
  249. #define NEOPIXEL_PIN EXP1_05_PIN
  250. #endif
  251. #endif // !FYSETC_MINI_12864
  252. #if IS_ULTIPANEL
  253. #define LCD_PINS_D5 EXP1_05_PIN
  254. #define LCD_PINS_D6 EXP1_04_PIN
  255. #define LCD_PINS_D7 EXP1_03_PIN
  256. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  257. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  258. #endif
  259. #endif
  260. #endif
  261. // Alter timing for graphical display
  262. #if IS_U8GLIB_ST7920
  263. #define BOARD_ST7920_DELAY_1 96
  264. #define BOARD_ST7920_DELAY_2 48
  265. #define BOARD_ST7920_DELAY_3 600
  266. #endif
  267. #endif // HAS_WIRED_LCD
  268. //
  269. // RGB LEDs
  270. //
  271. #ifndef RGB_LED_R_PIN
  272. #define RGB_LED_R_PIN PB5
  273. #endif
  274. #ifndef RGB_LED_G_PIN
  275. #define RGB_LED_G_PIN PB4
  276. #endif
  277. #ifndef RGB_LED_B_PIN
  278. #define RGB_LED_B_PIN PB3
  279. #endif
  280. #ifndef RGB_LED_W_PIN
  281. #define RGB_LED_W_PIN -1
  282. #endif