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 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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 (STM32F103RE / STM32F103RC) board pin assignments
  25. */
  26. #include "env_validate.h"
  27. #if HAS_MULTI_HOTEND || E_STEPPERS > 1
  28. #error "Creality v4 only supports 1 hotend / E stepper."
  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. // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
  39. //
  40. #ifndef DISABLE_DEBUG
  41. #define DISABLE_DEBUG
  42. #endif
  43. //
  44. // EEPROM
  45. //
  46. #if NO_EEPROM_SELECTED
  47. #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
  48. //#define SDCARD_EEPROM_EMULATION
  49. #endif
  50. #if ENABLED(IIC_BL24CXX_EEPROM)
  51. #define IIC_EEPROM_SDA PA11
  52. #define IIC_EEPROM_SCL PA12
  53. #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
  54. #elif ENABLED(SDCARD_EEPROM_EMULATION)
  55. #define MARLIN_EEPROM_SIZE 0x800 // 2K
  56. #endif
  57. //
  58. // Servos
  59. //
  60. #ifndef SERVO0_PIN
  61. #ifndef HAS_PIN_27_BOARD
  62. #define SERVO0_PIN PB0 // BLTouch OUT
  63. #else
  64. #define SERVO0_PIN PC6
  65. #endif
  66. #endif
  67. //
  68. // Limit Switches
  69. //
  70. #ifndef X_STOP_PIN
  71. #define X_STOP_PIN PA5
  72. #endif
  73. #ifndef Y_STOP_PIN
  74. #define Y_STOP_PIN PA6
  75. #endif
  76. #ifndef Z_STOP_PIN
  77. #define Z_STOP_PIN PA7
  78. #endif
  79. #ifndef Z_MIN_PROBE_PIN
  80. #define Z_MIN_PROBE_PIN PB1 // BLTouch IN
  81. #endif
  82. //
  83. // Filament Runout Sensor
  84. //
  85. #ifndef FIL_RUNOUT_PIN
  86. #define FIL_RUNOUT_PIN PA4 // "Pulled-high"
  87. #endif
  88. //
  89. // Steppers
  90. //
  91. #ifndef X_STEP_PIN
  92. #define X_STEP_PIN PC2
  93. #endif
  94. #ifndef X_DIR_PIN
  95. #define X_DIR_PIN PB9
  96. #endif
  97. #define X_ENABLE_PIN PC3 // Shared
  98. #ifndef Y_STEP_PIN
  99. #define Y_STEP_PIN PB8
  100. #endif
  101. #ifndef Y_DIR_PIN
  102. #define Y_DIR_PIN PB7
  103. #endif
  104. #define Y_ENABLE_PIN X_ENABLE_PIN
  105. #ifndef Z_STEP_PIN
  106. #define Z_STEP_PIN PB6
  107. #endif
  108. #ifndef Z_DIR_PIN
  109. #define Z_DIR_PIN PB5
  110. #endif
  111. #define Z_ENABLE_PIN X_ENABLE_PIN
  112. #ifndef E0_STEP_PIN
  113. #define E0_STEP_PIN PB4
  114. #endif
  115. #ifndef E0_DIR_PIN
  116. #define E0_DIR_PIN PB3
  117. #endif
  118. #define E0_ENABLE_PIN X_ENABLE_PIN
  119. //
  120. // Temperature Sensors
  121. //
  122. #define TEMP_0_PIN PC5 // TH1
  123. #define TEMP_BED_PIN PC4 // TB1
  124. //
  125. // Heaters / Fans
  126. //
  127. #ifndef HEATER_0_PIN
  128. #define HEATER_0_PIN PA1 // HEATER1
  129. #endif
  130. #ifndef HEATER_BED_PIN
  131. #define HEATER_BED_PIN PA2 // HOT BED
  132. #endif
  133. #ifndef FAN_PIN
  134. #define FAN_PIN PA0 // FAN
  135. #endif
  136. #define FAN_SOFT_PWM_REQUIRED
  137. //
  138. // SD Card
  139. //
  140. #define SD_DETECT_PIN PC7
  141. #define SDCARD_CONNECTION ONBOARD
  142. #define SDIO_SUPPORT
  143. #define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
  144. #if EITHER(CR10_STOCKDISPLAY, FYSETC_MINI_12864_2_1)
  145. #if ENABLED(RET6_12864_LCD)
  146. /**
  147. * RET6 12864 LCD
  148. * ------
  149. * PC6 | 1 2 | PB2
  150. * PB10 | 3 4 | PB11
  151. * PB14 5 6 | PB13
  152. * PB12 | 7 8 | PB15
  153. * GND | 9 10 | 5V
  154. * ------
  155. * EXP1
  156. */
  157. #define EXP1_01_PIN PC6
  158. #define EXP1_02_PIN PB2
  159. #define EXP1_03_PIN PB10
  160. #define EXP1_04_PIN PB11
  161. #define EXP1_05_PIN PB14
  162. #define EXP1_06_PIN PB13
  163. #define EXP1_07_PIN PB12
  164. #define EXP1_08_PIN PB15
  165. #elif ENABLED(VET6_12864_LCD)
  166. /**
  167. * VET6 12864 LCD
  168. * ------
  169. * ? | 1 2 | PC5
  170. * PB10 | 3 4 | ?
  171. * PA6 5 6 | PA5
  172. * PA4 | 7 8 | PA7
  173. * GND | 9 10 | 5V
  174. * ------
  175. * EXP1
  176. */
  177. #define EXP1_01_PIN -1
  178. #define EXP1_02_PIN PC5
  179. #define EXP1_03_PIN PB10
  180. #define EXP1_04_PIN -1
  181. #define EXP1_05_PIN PA6
  182. #define EXP1_06_PIN PA5
  183. #define EXP1_07_PIN PA4
  184. #define EXP1_08_PIN PA7
  185. #else
  186. #error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for the LCD with the Creality V4 controller."
  187. #endif
  188. #endif
  189. #if ENABLED(CR10_STOCKDISPLAY)
  190. #define LCD_PINS_RS EXP1_07_PIN
  191. #define LCD_PINS_ENABLE EXP1_08_PIN
  192. #define LCD_PINS_D4 EXP1_06_PIN
  193. #define BTN_ENC EXP1_02_PIN
  194. #define BTN_EN1 EXP1_03_PIN
  195. #define BTN_EN2 EXP1_05_PIN
  196. #ifndef HAS_PIN_27_BOARD
  197. #define BEEPER_PIN EXP1_01_PIN
  198. #endif
  199. #elif ANY(HAS_DWIN_E3V2, IS_DWIN_MARLINUI, DWIN_VET6_CREALITY_LCD)
  200. #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
  201. // RET6 DWIN ENCODER LCD
  202. #define EXP1_05_PIN PB14
  203. #define EXP1_06_PIN PB13
  204. #define EXP1_07_PIN PB12
  205. #define EXP1_08_PIN PB15
  206. //#define LCD_LED_PIN PB2
  207. #else
  208. // VET6 DWIN ENCODER LCD
  209. #define EXP1_05_PIN PA6
  210. #define EXP1_06_PIN PA5
  211. #define EXP1_07_PIN PA4
  212. #define EXP1_08_PIN PA7
  213. #endif
  214. #define BTN_ENC EXP1_05_PIN
  215. #define BTN_EN1 EXP1_08_PIN
  216. #define BTN_EN2 EXP1_07_PIN
  217. #ifndef BEEPER_PIN
  218. #define BEEPER_PIN EXP1_06_PIN
  219. #endif
  220. #elif ENABLED(FYSETC_MINI_12864_2_1)
  221. #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
  222. #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_CREALITY_V4.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning"
  223. #endif
  224. #if SD_CONNECTION_IS(LCD)
  225. #error "The LCD sdcard is not connected with this configuration"
  226. #endif
  227. /**
  228. *
  229. * Board (RET6 12864 LCD) Display
  230. * ------ ------
  231. * (EN1) PC6 | 1 2 | PB2 (BTN_ENC) 5V |10 9 | GND
  232. * (LCD_CS) PB10 | 3 4 | PB11 (LCD RESET) -- | 8 7 | --
  233. * (LCD_A0) PB14 5 6 | PB13 (EN2) (DIN) | 6 5 (LCD RESET)
  234. * (LCD_SCK)PB12 | 7 8 | PB15 (MOSI) (LCD_A0) | 4 3 | (LCD_CS)
  235. * GND | 9 10 | 5V (BTN_ENC) | 2 1 | --
  236. * ------ ------
  237. * EXP1 EXP1
  238. *
  239. * ------
  240. * ----- -- |10 9 | --
  241. * | 1 | VCC (RESET) | 8 7 | --
  242. * | 2 | PA13 (DIN) (MOSI) | 6 5 (EN2)
  243. * | 3 | PA14 -- | 4 3 | (EN1)
  244. * | 4 | GND (LCD_SCK)| 2 1 | --
  245. * ----- ------
  246. * Debug port EXP2
  247. *
  248. * Needs custom cable. Connect EN2-EN2, LCD_CS-LCD_CS and so on.
  249. * Debug port is just above EXP1, You need to add pins
  250. *
  251. */
  252. #define BTN_ENC EXP1_02_PIN
  253. #define BTN_EN1 EXP1_01_PIN
  254. #define BTN_EN2 EXP1_06_PIN
  255. #define BEEPER_PIN -1
  256. #define DOGLCD_CS EXP1_03_PIN
  257. #define DOGLCD_A0 EXP1_05_PIN
  258. #define DOGLCD_SCK EXP1_07_PIN
  259. #define DOGLCD_MOSI EXP1_08_PIN
  260. #define LCD_RESET_PIN EXP1_04_PIN
  261. #define FORCE_SOFT_SPI
  262. #define LCD_BACKLIGHT_PIN -1
  263. #define NEOPIXEL_PIN PA13
  264. #endif