My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

pins_MKS_ROBIN_MINI.h 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. /**
  24. * MKS Robin mini (STM32F103VET6) board pin assignments
  25. */
  26. #include "env_validate.h"
  27. #if HOTENDS > 1 || E_STEPPERS > 1
  28. #error "MKS Robin mini only supports one hotend / E-stepper. Comment out this line to continue."
  29. #endif
  30. #define BOARD_INFO_NAME "MKS Robin Mini"
  31. #define BOARD_NO_NATIVE_USB
  32. //
  33. // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
  34. //
  35. #define DISABLE_DEBUG
  36. //
  37. // EEPROM
  38. //
  39. #if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
  40. #define FLASH_EEPROM_EMULATION
  41. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  42. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  43. #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
  44. #endif
  45. #define SPI_DEVICE 2
  46. //
  47. // Servos
  48. //
  49. #ifndef SERVO0_PIN
  50. #define SERVO0_PIN PA8 // Enable BLTOUCH support on IO0 (WIFI connector)
  51. #endif
  52. //
  53. // Limit Switches
  54. //
  55. #define X_STOP_PIN PA15
  56. #define Y_STOP_PIN PA12
  57. #define Z_MIN_PIN PA11
  58. #define Z_MAX_PIN PC4
  59. #ifndef FIL_RUNOUT_PIN
  60. #define FIL_RUNOUT_PIN PA4 // MT_DET
  61. #endif
  62. //
  63. // Steppers
  64. //
  65. #define X_ENABLE_PIN PE4
  66. #define X_STEP_PIN PE3
  67. #define X_DIR_PIN PE2
  68. #define Y_ENABLE_PIN PE1
  69. #define Y_STEP_PIN PE0
  70. #define Y_DIR_PIN PB9
  71. #define Z_ENABLE_PIN PB8
  72. #define Z_STEP_PIN PB5
  73. #define Z_DIR_PIN PB4
  74. #define E0_ENABLE_PIN PB3
  75. #define E0_STEP_PIN PD6
  76. #define E0_DIR_PIN PD3
  77. // Motor current PWM pins
  78. #define MOTOR_CURRENT_PWM_XY_PIN PA6
  79. #define MOTOR_CURRENT_PWM_Z_PIN PA7
  80. #define MOTOR_CURRENT_PWM_E_PIN PB0
  81. #define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp
  82. #ifndef DEFAULT_PWM_MOTOR_CURRENT
  83. #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 }
  84. #endif
  85. //
  86. // Temperature Sensors
  87. //
  88. #define TEMP_0_PIN PC1 // TH1
  89. #define TEMP_BED_PIN PC0 // TB1
  90. //
  91. // Heaters / Fans
  92. //
  93. #define HEATER_0_PIN PC3
  94. #define HEATER_BED_PIN PA0
  95. #define FAN_PIN PB1 // FAN
  96. //
  97. // Misc. Functions
  98. //
  99. #define POWER_LOSS_PIN PA2 // PW_DET
  100. #define PS_ON_PIN PA3 // PW_OFF
  101. #define MT_DET_1_PIN PA4
  102. #define MT_DET_PIN_INVERTING false
  103. #define WIFI_IO0_PIN PC13
  104. //
  105. // SD Card
  106. //
  107. #ifndef SDCARD_CONNECTION
  108. #define SDCARD_CONNECTION ONBOARD
  109. #endif
  110. #define SDIO_SUPPORT
  111. #define SDIO_CLOCK 4500000 // 4.5 MHz
  112. #define SD_DETECT_PIN PD12
  113. #define ONBOARD_SPI_DEVICE 1 // SPI1
  114. #define ONBOARD_SD_CS_PIN PC11
  115. //
  116. // LCD / Controller
  117. //
  118. #define BEEPER_PIN PC5
  119. /**
  120. * Note: MKS Robin TFT screens use various TFT controllers.
  121. * If the screen stays white, disable 'LCD_RESET_PIN'
  122. * to let the bootloader init the screen.
  123. */
  124. #if EITHER(HAS_FSMC_GRAPHICAL_TFT, TFT_320x240)
  125. #define FSMC_CS_PIN PD7 // NE4
  126. #define FSMC_RS_PIN PD11 // A0
  127. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  128. #define FSMC_DMA_DEV DMA2
  129. #define FSMC_DMA_CHANNEL DMA_CH5
  130. #define LCD_RESET_PIN PC6 // FSMC_RST
  131. #define LCD_BACKLIGHT_PIN PD13
  132. #endif
  133. #if BOTH(NEED_TOUCH_PINS, HAS_FSMC_GRAPHICAL_TFT) || ENABLED(TFT_320x240)
  134. #define TOUCH_CS_PIN PC2 // SPI2_NSS
  135. #define TOUCH_SCK_PIN PB13 // SPI2_SCK
  136. #define TOUCH_MISO_PIN PB14 // SPI2_MISO
  137. #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
  138. #endif
  139. #if ENABLED(TFT_320x240) // TFT32/28
  140. #define TFT_DRIVER ILI9341
  141. #define TFT_BUFFER_SIZE 14400
  142. #define ILI9341_COLOR_RGB
  143. // YV for normal screen mounting
  144. #define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV
  145. // XV for 180° rotated screen mounting
  146. //#define ILI9341_ORIENTATION ILI9341_MADCTL_MX | ILI9341_MADCTL_MV
  147. #endif
  148. #if ENABLED(TOUCH_SCREEN)
  149. #ifndef TOUCH_CALIBRATION_X
  150. #define TOUCH_CALIBRATION_X 12033
  151. #endif
  152. #ifndef TOUCH_CALIBRATION_Y
  153. #define TOUCH_CALIBRATION_Y -9047
  154. #endif
  155. #ifndef TOUCH_OFFSET_X
  156. #define TOUCH_OFFSET_X -30
  157. #endif
  158. #ifndef TOUCH_OFFSET_Y
  159. #define TOUCH_OFFSET_Y 254
  160. #endif
  161. #endif
  162. #define HAS_SPI_FLASH 1
  163. #if HAS_SPI_FLASH
  164. #define SPI_FLASH_SIZE 0x1000000 // 16MB
  165. #define W25QXX_CS_PIN PB12 // Flash chip-select
  166. #define W25QXX_MOSI_PIN PB15
  167. #define W25QXX_MISO_PIN PB14
  168. #define W25QXX_SCK_PIN PB13
  169. #endif