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_MKS_ROBIN_MINI.h 6.1KB

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