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_TRONXY_V10.h 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. #include "env_validate.h"
  24. #if HOTENDS > 3 || E_STEPPERS > 3
  25. #error "Tronxy V10 supports up to 3 hotends / E steppers."
  26. #endif
  27. #define BOARD_INFO_NAME "Tronxy V10"
  28. #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
  29. #define STEP_TIMER 6
  30. #define TEMP_TIMER 14
  31. //
  32. // Servos
  33. //
  34. //#define SERVO0_PIN PB10
  35. //
  36. // EEPROM
  37. //
  38. #if NO_EEPROM_SELECTED
  39. #undef NO_EEPROM_SELECTED
  40. #if TRONXY_UI > 0
  41. #define EEPROM_AT24CXX
  42. #else
  43. #define FLASH_EEPROM_EMULATION
  44. #endif
  45. #endif
  46. #if ENABLED(FLASH_EEPROM_EMULATION)
  47. // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h)
  48. #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE)
  49. #define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB)
  50. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE
  51. #else
  52. #if ENABLED(EEPROM_AT24CXX)
  53. #define AT24CXX_SCL PB8
  54. #define AT24CXX_SDA PB9
  55. #define AT24CXX_WP PB7
  56. #else
  57. #define I2C_EEPROM // AT24C32
  58. #endif
  59. #define MARLIN_EEPROM_SIZE 0x1000 // 4K
  60. #endif
  61. //
  62. // SPI Flash
  63. //
  64. //#define SPI_FLASH
  65. #if ENABLED(SPI_FLASH)
  66. #define SPI_FLASH_SIZE 0x200000 // 2MB
  67. #define W25QXX_CS_PIN PG15 // SPI2
  68. #define W25QXX_MOSI_PIN PB5
  69. #define W25QXX_MISO_PIN PB4
  70. #define W25QXX_SCK_PIN PB3
  71. #endif
  72. //
  73. // Limit Switches
  74. //
  75. #define X_MIN_PIN PC15
  76. #define X_MAX_PIN PB0
  77. #define Y_STOP_PIN PC14
  78. #ifndef Z_MIN_PROBE_PIN
  79. #define Z_MIN_PROBE_PIN PE3
  80. #endif
  81. #if ENABLED(DUAL_Z_ENDSTOP_PROBE)
  82. #if NUM_Z_STEPPERS > 1 && Z_HOME_TO_MAX // Swap Z1/Z2 for dual Z with max homing
  83. #define Z_MIN_PIN PF11
  84. #define Z_MAX_PIN PC13
  85. #else
  86. #define Z_MIN_PIN PC13
  87. #define Z_MAX_PIN PF11
  88. #endif
  89. #else
  90. #ifndef Z_STOP_PIN
  91. #define Z_STOP_PIN PC13
  92. #endif
  93. #endif
  94. //
  95. // Filament Sensors
  96. //
  97. #ifndef FIL_RUNOUT_PIN
  98. #define FIL_RUNOUT_PIN PE6 // MT_DET
  99. #endif
  100. #ifndef FIL_RUNOUT2_PIN
  101. #define FIL_RUNOUT2_PIN PF12
  102. #endif
  103. //
  104. // Steppers
  105. //
  106. #define X_ENABLE_PIN PF0
  107. #define X_STEP_PIN PE5
  108. #define X_DIR_PIN PF1
  109. #define Y_ENABLE_PIN PF5
  110. #define Y_STEP_PIN PF9
  111. #define Y_DIR_PIN PF3
  112. #define Z_ENABLE_PIN PA5
  113. #define Z_STEP_PIN PA6
  114. #define Z_DIR_PIN PF15
  115. #define E0_ENABLE_PIN PF14
  116. #define E0_STEP_PIN PB1
  117. #define E0_DIR_PIN PF13
  118. #define E1_ENABLE_PIN PG5
  119. #define E1_STEP_PIN PD12
  120. #define E1_DIR_PIN PG4
  121. #define E2_ENABLE_PIN PF7
  122. #define E2_STEP_PIN PF6
  123. #define E2_DIR_PIN PF4
  124. //
  125. // Temperature Sensors
  126. //
  127. #define TEMP_0_PIN PC3 // TH1
  128. #define TEMP_BED_PIN PC2 // TB1
  129. //
  130. // Heaters / Fans
  131. //
  132. #define HEATER_0_PIN PG7 // HEATER1
  133. #define HEATER_BED_PIN PE2 // HOT BED
  134. //#define HEATER_BED_INVERTING true
  135. #define FAN_PIN PG0 // FAN0
  136. #define FAN1_PIN PB6 // FAN1
  137. #define FAN2_PIN PG9 // FAN2
  138. #define FAN3_PIN PF10 // FAN3
  139. #define CONTROLLER_FAN_PIN PD7 // BOARD FAN
  140. #define FAN_SOFT_PWM
  141. //
  142. // Laser / Spindle
  143. //
  144. #if HAS_CUTTER
  145. #define SPINDLE_LASER_ENA_PIN PB11 // wifi:TX
  146. #if ENABLED(SPINDLE_LASER_USE_PWM)
  147. #define SPINDLE_LASER_PWM_PIN PB10 // wifi:RX-TIM2_CH3
  148. // The PWM pin definition const PinMap PinMap_PWM[] in PeripheralPins.c must be compounded here
  149. // See PWM_PIN(x) definition for details
  150. #endif
  151. #endif
  152. //
  153. // Misc
  154. //
  155. #define BEEPER_PIN PA8
  156. //#define LED_PIN PG10
  157. #define PS_ON_PIN PG10 // Temporarily switch the machine with LED simulation
  158. #if ENABLED(TRONXY_BACKUP_POWER)
  159. #define POWER_LOSS_PIN PF11 // Configure as drop-down input
  160. #else
  161. #define POWER_LOSS_PIN PE1 // Output of LM393 comparator, configured as pullup
  162. #endif
  163. //#define POWER_LM393_PIN PE0 // +V for the LM393 comparator, configured as output high
  164. #if ENABLED(TFT_TRONXY_X5SA)
  165. #error "TFT_TRONXY_X5SA is not yet supported."
  166. #endif
  167. #if 0
  168. //
  169. // TFT with FSMC interface
  170. //
  171. #if HAS_FSMC_TFT
  172. #define TFT_RESET_PIN PB12
  173. #define TFT_BACKLIGHT_PIN PG8
  174. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  175. #define FSMC_DMA_DEV DMA2
  176. #define FSMC_DMA_CHANNEL DMA_CH5
  177. #define TFT_CS_PIN PG12
  178. #define TFT_RS_PIN PG2
  179. //#define TFT_WIDTH 480
  180. //#define TFT_HEIGHT 320
  181. //#define TFT_PIXEL_OFFSET_X 48
  182. //#define TFT_PIXEL_OFFSET_Y 32
  183. //#define TFT_DRIVER ILI9488
  184. //#define TFT_BUFFER_SIZE 14400
  185. #if NEED_TOUCH_PINS
  186. #define TOUCH_CS_PIN PD11 // SPI1_NSS
  187. #define TOUCH_SCK_PIN PB13 // SPI1_SCK
  188. #define TOUCH_MISO_PIN PB14 // SPI1_MISO
  189. #define TOUCH_MOSI_PIN PB15 // SPI1_MOSI
  190. #endif
  191. #if (LCD_CHIP_INDEX == 1 && (TRONXY_UI == 1 || TRONXY_UI == 2)) || LCD_CHIP_INDEX == 3
  192. #define TOUCH_CALIBRATION_X -17181
  193. #define TOUCH_CALIBRATION_Y 11434
  194. #define TOUCH_OFFSET_X 501
  195. #define TOUCH_OFFSET_Y -9
  196. #elif LCD_CHIP_INDEX == 1 && TRONXY_UI == 4
  197. #define TOUCH_CALIBRATION_X 11166
  198. #define TOUCH_CALIBRATION_Y 17162
  199. #define TOUCH_OFFSET_X -10
  200. #define TOUCH_OFFSET_Y -16
  201. #elif LCD_CHIP_INDEX == 4 && TRONXY_UI == 3
  202. //#define TOUCH_CALIBRATION_X 8781
  203. //#define TOUCH_CALIBRATION_Y 11773
  204. //#define TOUCH_OFFSET_X -17
  205. //#define TOUCH_OFFSET_Y -16
  206. // Upside-down
  207. #define TOUCH_CALIBRATION_X -8553
  208. #define TOUCH_CALIBRATION_Y -11667
  209. #define TOUCH_OFFSET_X 253
  210. #define TOUCH_OFFSET_Y 331
  211. #elif LCD_CHIP_INDEX == 2
  212. #define TOUCH_CALIBRATION_X 17184
  213. #define TOUCH_CALIBRATION_Y 10604
  214. #define TOUCH_OFFSET_X -31
  215. #define TOUCH_OFFSET_Y -29
  216. #endif
  217. #endif
  218. #endif
  219. //
  220. // SD Card
  221. //
  222. #define SDIO_SUPPORT
  223. #define SD_DETECT_PIN -1 // PF0, but not connected
  224. #define SDIO_CLOCK 4500000
  225. #define SDIO_READ_RETRIES 16
  226. #define SDIO_D0_PIN PC8
  227. #define SDIO_D1_PIN PC9
  228. #define SDIO_D2_PIN PC10
  229. #define SDIO_D3_PIN PC11
  230. #define SDIO_CK_PIN PC12
  231. #define SDIO_CMD_PIN PD2