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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. #if NOT_TARGET(STM32F4)
  24. #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
  25. #elif HOTENDS > 1 || E_STEPPERS > 1
  26. #error "BIGTREE BTT002 V1.0 supports up to 1 hotends / E-steppers."
  27. #endif
  28. #define BOARD_INFO_NAME "BTT BTT002 V1.0"
  29. // Use one of these or SDCard-based Emulation will be used
  30. #if NO_EEPROM_SELECTED
  31. //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation
  32. #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation
  33. #endif
  34. #if ENABLED(FLASH_EEPROM_EMULATION)
  35. // Decrease delays and flash wear by spreading writes across the
  36. // 128 kB sector allocated for EEPROM emulation.
  37. #define FLASH_EEPROM_LEVELING
  38. #endif
  39. // Ignore temp readings during development.
  40. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
  41. //
  42. // Limit Switches
  43. //
  44. #define X_STOP_PIN PD3
  45. #define Y_STOP_PIN PD2
  46. #define Z_STOP_PIN PD1 // Shares J4 connector with PC3
  47. //
  48. // Z Probe must be this pin
  49. //
  50. #ifndef Z_MIN_PROBE_PIN
  51. #define Z_MIN_PROBE_PIN PD1
  52. #endif
  53. //
  54. // Filament Runout Sensor
  55. //
  56. #ifndef FIL_RUNOUT_PIN
  57. #define FIL_RUNOUT_PIN PA15
  58. #endif
  59. //
  60. // Power Loss Detection
  61. //
  62. #ifndef POWER_LOSS_PIN
  63. #define POWER_LOSS_PIN PD4
  64. #endif
  65. //
  66. // Steppers
  67. //
  68. #define X_STEP_PIN PA9
  69. #define X_DIR_PIN PA10
  70. #define X_ENABLE_PIN PA8
  71. #ifndef X_CS_PIN
  72. #define X_CS_PIN PE2
  73. #endif
  74. #define Y_STEP_PIN PC8
  75. #define Y_DIR_PIN PC9
  76. #define Y_ENABLE_PIN PC7
  77. #ifndef Y_CS_PIN
  78. #define Y_CS_PIN PE3
  79. #endif
  80. #define Z_STEP_PIN PD15
  81. #define Z_DIR_PIN PC6
  82. #define Z_ENABLE_PIN PD14
  83. #ifndef Z_CS_PIN
  84. #define Z_CS_PIN PE4
  85. #endif
  86. #define E0_STEP_PIN PD12
  87. #define E0_DIR_PIN PD13
  88. #define E0_ENABLE_PIN PD11
  89. #ifndef E0_CS_PIN
  90. #define E0_CS_PIN PD7
  91. #endif
  92. //
  93. // Software SPI pins for TMC2130 stepper drivers
  94. //
  95. #if ENABLED(TMC_USE_SW_SPI)
  96. #ifndef TMC_SW_MOSI
  97. #define TMC_SW_MOSI PB15
  98. #endif
  99. #ifndef TMC_SW_MISO
  100. #define TMC_SW_MISO PB14
  101. #endif
  102. #ifndef TMC_SW_SCK
  103. #define TMC_SW_SCK PB13
  104. #endif
  105. #endif
  106. #if HAS_TMC_UART
  107. /**
  108. * TMC2208/TMC2209 stepper drivers
  109. *
  110. * Hardware serial communication ports.
  111. * If undefined software serial is used according to the pins below
  112. */
  113. //#define X_HARDWARE_SERIAL Serial1
  114. //#define X2_HARDWARE_SERIAL Serial1
  115. //#define Y_HARDWARE_SERIAL Serial1
  116. //#define Y2_HARDWARE_SERIAL Serial1
  117. //#define Z_HARDWARE_SERIAL Serial1
  118. //#define Z2_HARDWARE_SERIAL Serial1
  119. //#define E0_HARDWARE_SERIAL Serial1
  120. //#define E1_HARDWARE_SERIAL Serial1
  121. //#define E2_HARDWARE_SERIAL Serial1
  122. //#define E3_HARDWARE_SERIAL Serial1
  123. //#define E4_HARDWARE_SERIAL Serial1
  124. //
  125. // Software serial ##
  126. //
  127. #define X_SERIAL_TX_PIN PE2
  128. #define X_SERIAL_RX_PIN PE2
  129. #define Y_SERIAL_TX_PIN PE3
  130. #define Y_SERIAL_RX_PIN PE3
  131. #define Z_SERIAL_TX_PIN PE4
  132. #define Z_SERIAL_RX_PIN PE4
  133. #define E0_SERIAL_TX_PIN PD7
  134. #define E0_SERIAL_RX_PIN PD7
  135. // Reduce baud rate to improve software serial reliability
  136. #define TMC_BAUD_RATE 19200
  137. #endif
  138. //
  139. // Temperature Sensors
  140. //
  141. #define TEMP_0_PIN PA2 // T0 <-> E0
  142. #define TEMP_1_PIN PA0 // T1 <-> E1
  143. #define TEMP_BED_PIN PA1 // T2 <-> Bed
  144. #define TEMP_PROBE_PIN PC3 // Shares J4 connector with PD1
  145. //
  146. // Heaters / Fans
  147. //
  148. #define HEATER_0_PIN PE6 // Heater0
  149. #define HEATER_BED_PIN PE5 // Hotbed
  150. #define FAN_PIN PB8 // Fan1
  151. #define FAN1_PIN PB9 // Fan0
  152. // HAL SPI1 pins
  153. #define CUSTOM_SPI_PINS
  154. #if ENABLED(CUSTOM_SPI_PINS)
  155. #define SCK_PIN PA5 // SPI1 SCLK
  156. #define SS_PIN PA4 // SPI1 SSEL
  157. #define MISO_PIN PA6 // SPI1 MISO
  158. #define MOSI_PIN PA7 // SPI1 MOSI
  159. #endif
  160. //
  161. // Misc. Functions
  162. //
  163. #define SDSS PA4
  164. /**
  165. * -------------------------------------BTT002 V1.0--------------------------------------------
  166. * ----- ----- |
  167. * PA3 | · · | GND 5V | · · | GND |
  168. * NRESET | · · | PC4(SD_DET) (LCD_D7) PE13 | · · | PE12 (LCD_D6) |
  169. * (MOSI)PA7 | · · | PB0(BTN_EN2) (LCD_D5) PE11 | · · | PE10 (LCD_D4) |
  170. * (SD_SS)PA4 | · · | PC5(BTN_EN1) (LCD_RS) PE8 | · · | PE9 (LCD_EN) |
  171. * (SCK)PA5 | · · | PA6(MISO) (BTN_ENC) PB1 | · · | PE7 (BEEPER) |
  172. * ----- ----- |
  173. * EXP2 EXP1 |
  174. * --------------------------------------------------------------------------------------------
  175. */
  176. //
  177. // LCDs and Controllers
  178. //
  179. #if HAS_WIRED_LCD
  180. #define BEEPER_PIN PE7
  181. #define BTN_ENC PB1
  182. #if ENABLED(CR10_STOCKDISPLAY)
  183. #define LCD_PINS_RS PE12
  184. #define BTN_EN1 PE9
  185. #define BTN_EN2 PE10
  186. #define LCD_PINS_ENABLE PE13
  187. #define LCD_PINS_D4 PE11
  188. #else
  189. #define LCD_PINS_RS PE8
  190. #define BTN_EN1 PC5
  191. #define BTN_EN2 PB0
  192. #define SD_DETECT_PIN PC4
  193. #define LCD_SDSS PA4
  194. #define LCD_PINS_ENABLE PE9
  195. #define LCD_PINS_D4 PE10
  196. #if IS_ULTIPANEL
  197. #define LCD_PINS_D5 PE11
  198. #define LCD_PINS_D6 PE12
  199. #define LCD_PINS_D7 PE13
  200. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  201. #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
  202. #endif
  203. #endif
  204. #endif
  205. // Alter timing for graphical display
  206. #if HAS_MARLINUI_U8GLIB
  207. #ifndef BOARD_ST7920_DELAY_1
  208. #define BOARD_ST7920_DELAY_1 DELAY_NS(96)
  209. #endif
  210. #ifndef BOARD_ST7920_DELAY_2
  211. #define BOARD_ST7920_DELAY_2 DELAY_NS(48)
  212. #endif
  213. #ifndef BOARD_ST7920_DELAY_3
  214. #define BOARD_ST7920_DELAY_3 DELAY_NS(600)
  215. #endif
  216. #endif
  217. #endif // HAS_WIRED_LCD
  218. //
  219. // RGB LEDs
  220. //
  221. #ifndef RGB_LED_R_PIN
  222. #define RGB_LED_R_PIN PB5
  223. #endif
  224. #ifndef RGB_LED_G_PIN
  225. #define RGB_LED_G_PIN PB4
  226. #endif
  227. #ifndef RGB_LED_B_PIN
  228. #define RGB_LED_B_PIN PB3
  229. #endif
  230. #ifndef RGB_LED_W_PIN
  231. #define RGB_LED_W_PIN -1
  232. #endif