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_common.h 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION
  25. // https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
  26. //#define BTT_MOTOR_EXPANSION
  27. #if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION)
  28. #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
  29. #define EXP_MOT_USE_EXP2_ONLY 1
  30. #else
  31. #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time."
  32. #endif
  33. #endif
  34. // Ignore temp readings during development.
  35. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
  36. //
  37. // Steppers
  38. //
  39. #ifndef E1_STEP_PIN
  40. #define E1_STEP_PIN P0_01
  41. #endif
  42. #ifndef E1_DIR_PIN
  43. #define E1_DIR_PIN P0_00
  44. #endif
  45. #ifndef E1_ENABLE_PIN
  46. #define E1_ENABLE_PIN P0_10
  47. #endif
  48. //
  49. // Temperature Sensors
  50. // 3.3V max when defined as an analog input
  51. //
  52. #ifndef TEMP_0_PIN
  53. #define TEMP_0_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_0_PIN
  54. #endif
  55. #ifndef TEMP_1_PIN
  56. #define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN
  57. #endif
  58. #ifndef TEMP_BED_PIN
  59. #define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN
  60. #endif
  61. #if HOTENDS == 1 && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
  62. #if TEMP_SENSOR_PROBE
  63. #define TEMP_PROBE_PIN TEMP_1_PIN
  64. #elif TEMP_SENSOR_CHAMBER
  65. #define TEMP_CHAMBER_PIN TEMP_1_PIN
  66. #endif
  67. #endif
  68. // CS, MISO, MOSI, and SCK for MAX Thermocouple SPI
  69. #if HAS_MAX_TC
  70. //#define TEMP_0_CS_PIN P...
  71. //#define TEMP_0_MISO_PIN P...
  72. //#define TEMP_0_MOSI_PIN P...
  73. //#define TEMP_0_SCK_PIN P...
  74. //#define TEMP_1_CS_PIN P...
  75. //#define TEMP_1_MISO_PIN P...
  76. //#define TEMP_1_MOSI_PIN P...
  77. //#define TEMP_1_SCK_PIN P...
  78. #endif
  79. //
  80. // Heaters / Fans
  81. //
  82. #ifndef HEATER_0_PIN
  83. #define HEATER_0_PIN P2_07
  84. #endif
  85. #if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
  86. #ifndef FAN1_PIN
  87. #define FAN1_PIN P2_04
  88. #endif
  89. #else
  90. #ifndef HEATER_1_PIN
  91. #define HEATER_1_PIN P2_04
  92. #endif
  93. #endif
  94. #ifndef FAN_PIN
  95. #define FAN_PIN P2_03
  96. #endif
  97. #ifndef HEATER_BED_PIN
  98. #define HEATER_BED_PIN P2_05
  99. #endif
  100. //
  101. // LCD / Controller
  102. //
  103. #if !defined(BEEPER_PIN) && HAS_WIRED_LCD && DISABLED(LCD_USE_I2C_BUZZER)
  104. #define BEEPER_PIN P1_30 // (37) not 5V tolerant
  105. #endif
  106. //
  107. // SD Support
  108. //
  109. #ifndef SDCARD_CONNECTION
  110. #if HAS_WIRED_LCD
  111. #define SDCARD_CONNECTION LCD
  112. #else
  113. #define SDCARD_CONNECTION ONBOARD
  114. #endif
  115. #endif
  116. #if SD_CONNECTION_IS(LCD) && ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
  117. #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_SD_CARD_PINS_FOR_CS."
  118. #endif
  119. #if SD_CONNECTION_IS(LCD)
  120. #define SD_SCK_PIN P0_15
  121. #define SD_MISO_PIN P0_17
  122. #define SD_MOSI_PIN P0_18
  123. #define SD_SS_PIN EXP2_04_PIN
  124. #define SD_DETECT_PIN EXP2_07_PIN
  125. #elif SD_CONNECTION_IS(ONBOARD)
  126. #undef SD_DETECT_PIN
  127. #define SD_DETECT_PIN P0_27
  128. #define SD_SCK_PIN P0_07
  129. #define SD_MISO_PIN P0_08
  130. #define SD_MOSI_PIN P0_09
  131. #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
  132. #define SD_SS_PIN ONBOARD_SD_CS_PIN
  133. #elif SD_CONNECTION_IS(CUSTOM_CABLE)
  134. #error "No custom SD drive cable defined for this board."
  135. #endif
  136. #if ENABLED(BTT_MOTOR_EXPANSION)
  137. /**
  138. * ------ ------
  139. * (M3STP) | 1 2 | (M3DIR) (M3DIAG) | 1 2 | (M3RX)
  140. * (M2STP) | 3 4 | (M2DIR) (M2DIAG) | 3 4 | (M2RX)
  141. * (M1DIR) 5 6 | (M1STP) (M1DIAG) 5 6 | (M1RX)
  142. * (M1EN) | 7 8 | -- (M3EN) | 7 8 | (M2EN)
  143. * GND | 9 10 | -- GND | 9 10 | --
  144. * ------ ------
  145. * EXP2 EXP1
  146. *
  147. * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
  148. */
  149. // M1 on Driver Expansion Module
  150. #define E2_STEP_PIN EXP2_06_PIN
  151. #define E2_DIR_PIN EXP2_05_PIN
  152. #define E2_ENABLE_PIN EXP2_07_PIN
  153. #if !EXP_MOT_USE_EXP2_ONLY
  154. #define E2_DIAG_PIN EXP1_05_PIN
  155. #define E2_CS_PIN EXP1_06_PIN
  156. #if HAS_TMC_UART
  157. #define E2_SERIAL_TX_PIN EXP1_06_PIN
  158. #define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
  159. #endif
  160. #endif
  161. // M2 on Driver Expansion Module
  162. #define E3_STEP_PIN EXP2_03_PIN
  163. #define E3_DIR_PIN EXP2_04_PIN
  164. #if !EXP_MOT_USE_EXP2_ONLY
  165. #define E3_ENABLE_PIN EXP1_08_PIN
  166. #define E3_DIAG_PIN EXP1_03_PIN
  167. #define E3_CS_PIN EXP1_04_PIN
  168. #if HAS_TMC_UART
  169. #define E3_SERIAL_TX_PIN EXP1_04_PIN
  170. #define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
  171. #endif
  172. #else
  173. #define E3_ENABLE_PIN EXP2_07_PIN
  174. #endif
  175. // M3 on Driver Expansion Module
  176. #define E4_STEP_PIN EXP2_01_PIN
  177. #define E4_DIR_PIN EXP2_02_PIN
  178. #if !EXP_MOT_USE_EXP2_ONLY
  179. #define E4_ENABLE_PIN EXP1_07_PIN
  180. #define E4_DIAG_PIN EXP1_01_PIN
  181. #define E4_CS_PIN EXP1_02_PIN
  182. #if HAS_TMC_UART
  183. #define E4_SERIAL_TX_PIN EXP1_02_PIN
  184. #define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN
  185. #endif
  186. #else
  187. #define E4_ENABLE_PIN EXP2_07_PIN
  188. #endif
  189. #endif // BTT_MOTOR_EXPANSION