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_CREALITY_V4.h 5.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. /**
  24. * Creality 4.2.x (STM32F103RET6) board pin assignments
  25. */
  26. #include "env_validate.h"
  27. #if HOTENDS > 1 || E_STEPPERS > 1
  28. #error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue."
  29. #endif
  30. #ifndef BOARD_INFO_NAME
  31. #define BOARD_INFO_NAME "Creality V4"
  32. #endif
  33. #ifndef DEFAULT_MACHINE_NAME
  34. #define DEFAULT_MACHINE_NAME "Ender 3 V2"
  35. #endif
  36. #define BOARD_NO_NATIVE_USB
  37. //
  38. // EEPROM
  39. //
  40. #if NO_EEPROM_SELECTED
  41. #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
  42. //#define SDCARD_EEPROM_EMULATION
  43. #endif
  44. #if ENABLED(IIC_BL24CXX_EEPROM)
  45. #define IIC_EEPROM_SDA PA11
  46. #define IIC_EEPROM_SCL PA12
  47. #define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16)
  48. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  49. #define MARLIN_EEPROM_SIZE 0x800 // 2Kb
  50. #endif
  51. //
  52. // Servos
  53. //
  54. #ifndef SERVO0_PIN
  55. #ifndef HAS_PIN_27_BOARD
  56. #define SERVO0_PIN PB0 // BLTouch OUT
  57. #else
  58. #define SERVO0_PIN PC6
  59. #endif
  60. #endif
  61. //
  62. // Limit Switches
  63. //
  64. #define X_STOP_PIN PA5
  65. #define Y_STOP_PIN PA6
  66. #define Z_STOP_PIN PA7
  67. #ifndef Z_MIN_PROBE_PIN
  68. #define Z_MIN_PROBE_PIN PB1 // BLTouch IN
  69. #endif
  70. //
  71. // Filament Runout Sensor
  72. //
  73. #ifndef FIL_RUNOUT_PIN
  74. #define FIL_RUNOUT_PIN PA4 // "Pulled-high"
  75. #endif
  76. //
  77. // Steppers
  78. //
  79. #define X_ENABLE_PIN PC3
  80. #ifndef X_STEP_PIN
  81. #define X_STEP_PIN PC2
  82. #endif
  83. #ifndef X_DIR_PIN
  84. #define X_DIR_PIN PB9
  85. #endif
  86. #define Y_ENABLE_PIN PC3
  87. #ifndef Y_STEP_PIN
  88. #define Y_STEP_PIN PB8
  89. #endif
  90. #ifndef Y_DIR_PIN
  91. #define Y_DIR_PIN PB7
  92. #endif
  93. #define Z_ENABLE_PIN PC3
  94. #ifndef Z_STEP_PIN
  95. #define Z_STEP_PIN PB6
  96. #endif
  97. #ifndef Z_DIR_PIN
  98. #define Z_DIR_PIN PB5
  99. #endif
  100. #define E0_ENABLE_PIN PC3
  101. #ifndef E0_STEP_PIN
  102. #define E0_STEP_PIN PB4
  103. #endif
  104. #ifndef E0_DIR_PIN
  105. #define E0_DIR_PIN PB3
  106. #endif
  107. //
  108. // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
  109. //
  110. #define DISABLE_DEBUG
  111. //
  112. // Temperature Sensors
  113. //
  114. #define TEMP_0_PIN PC5 // TH1
  115. #define TEMP_BED_PIN PC4 // TB1
  116. //
  117. // Heaters / Fans
  118. //
  119. #define HEATER_0_PIN PA1 // HEATER1
  120. #define HEATER_BED_PIN PA2 // HOT BED
  121. #ifndef FAN_PIN
  122. #define FAN_PIN PA0 // FAN
  123. #endif
  124. #if PIN_EXISTS(FAN)
  125. #define FAN_SOFT_PWM
  126. #endif
  127. //
  128. // SD Card
  129. //
  130. #define SD_DETECT_PIN PC7
  131. #define SDCARD_CONNECTION ONBOARD
  132. #define ONBOARD_SPI_DEVICE 1
  133. #define ONBOARD_SD_CS_PIN PA4 // SDSS
  134. #define SDIO_SUPPORT
  135. #define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
  136. #if ENABLED(CR10_STOCKDISPLAY) && NONE(RET6_12864_LCD, VET6_12864_LCD)
  137. #error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller."
  138. #endif
  139. #if ENABLED(RET6_12864_LCD)
  140. // RET6 12864 LCD
  141. #define LCD_PINS_RS PB12
  142. #define LCD_PINS_ENABLE PB15
  143. #define LCD_PINS_D4 PB13
  144. #define BTN_ENC PB2
  145. #define BTN_EN1 PB10
  146. #define BTN_EN2 PB14
  147. #ifndef HAS_PIN_27_BOARD
  148. #define BEEPER_PIN PC6
  149. #endif
  150. #elif ENABLED(VET6_12864_LCD)
  151. // VET6 12864 LCD
  152. #define LCD_PINS_RS PA4
  153. #define LCD_PINS_ENABLE PA7
  154. #define LCD_PINS_D4 PA5
  155. #define BTN_ENC PC5
  156. #define BTN_EN1 PB10
  157. #define BTN_EN2 PA6
  158. #elif ENABLED(DWIN_CREALITY_LCD)
  159. // RET6 DWIN ENCODER LCD
  160. #define BTN_ENC PB14
  161. #define BTN_EN1 PB15
  162. #define BTN_EN2 PB12
  163. //#define LCD_LED_PIN PB2
  164. #ifndef BEEPER_PIN
  165. #define BEEPER_PIN PB13
  166. #undef SPEAKER
  167. #endif
  168. #elif ENABLED(DWIN_VET6_CREALITY_LCD)
  169. // VET6 DWIN ENCODER LCD
  170. #define BTN_ENC PA6
  171. #define BTN_EN1 PA7
  172. #define BTN_EN2 PA4
  173. #define BEEPER_PIN PA5
  174. #endif