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_STEVAL_3DP001V1.h 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. // Source: https://github.com/stm32duino/Arduino_Core_STM32/blob/master/variants/ST3DP001_EVAL/variant.cpp
  23. /**
  24. * HOW TO COMPILE
  25. *
  26. * PlatformIO - Use the STM32F401VE_STEVAL environment (or the "Auto Build Marlin" extension).
  27. *
  28. * Arduino - Tested with 1.8.10
  29. * Install library per https://github.com/stm32duino/Arduino_Core_STM32
  30. * Make the following selections under the TOOL menu in the Arduino IDE
  31. * Board: "3D printer boards"
  32. * Board part number: "STEVAL-3DP001V1"
  33. * U(S)ART support: "Enabled (generic "Serial")"
  34. * USB support (if available): "CDC (no generic "Serial")"
  35. * Optimize: "Smallest (-Os default)"
  36. * C Runtime Library: "newlib Nano (default)"
  37. */
  38. #pragma once
  39. #ifndef STM32F4
  40. #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
  41. #endif
  42. #ifndef MACHINE_NAME
  43. #define MACHINE_NAME "STEVAL-3DP001V1"
  44. #endif
  45. //
  46. // Limit Switches
  47. //
  48. #define X_MIN_PIN 39 // PD8 X_STOP
  49. #define Y_MIN_PIN 40 // PD9 Y_STOP
  50. #define Z_MIN_PIN 41 // PD10 Z_STOP
  51. #define X_MAX_PIN 44 // PD0 W_STOP
  52. #define Y_MAX_PIN 43 // PA8 V_STOP
  53. #define Z_MAX_PIN 42 // PD11 U_STOP
  54. //
  55. // Z Probe (when not Z_MIN_PIN)
  56. //
  57. //#ifndef Z_MIN_PROBE_PIN
  58. // #define Z_MIN_PROBE_PIN 16 // PA4
  59. //#endif
  60. //
  61. // Filament runout
  62. //
  63. //#define FIL_RUNOUT_PIN 53 // PA3 BED_THE
  64. //
  65. // Steppers
  66. //
  67. #define X_STEP_PIN 61 // PE14 X_PWM
  68. #define X_DIR_PIN 62 // PE15 X_DIR
  69. #define X_ENABLE_PIN 60 // PE13 X_RES
  70. #define X_CS_PIN 16 // PA4 SPI_CS
  71. #define Y_STEP_PIN 64 // PB10 Y_PWM
  72. #define Y_DIR_PIN 65 // PE9 Y_DIR
  73. #define Y_ENABLE_PIN 63 // PE10 Y_RES
  74. #define Y_CS_PIN 16 // PA4 SPI_CS
  75. #define Z_STEP_PIN 67 // PC6 Z_PWM
  76. #define Z_DIR_PIN 68 // PC0 Z_DIR
  77. #define Z_ENABLE_PIN 66 // PC15 Z_RES
  78. #define Z_CS_PIN 16 // PA4 SPI_CS
  79. #define E0_STEP_PIN 71 // PD12 E1_PW
  80. #define E0_DIR_PIN 70 // PC13 E1_DIR
  81. #define E0_ENABLE_PIN 69 // PC14 E1_RE
  82. #define E0_CS_PIN 16 // PA4 SPI_CS
  83. #define E1_STEP_PIN 73 // PE5 E2_PWM
  84. #define E1_DIR_PIN 74 // PE6 E2_DIR
  85. #define E1_ENABLE_PIN 72 // PE4 E2_RESE
  86. #define E1_CS_PIN 16 // PA4 SPI_CS
  87. #define E2_STEP_PIN 77 // PB8 E3_PWM
  88. #define E2_DIR_PIN 76 // PE2 E3_DIR
  89. #define E2_ENABLE_PIN 75 // PE3 E3_RESE
  90. #define E2_CS_PIN 16 // PA4 SPI_CS
  91. // needed to pass a sanity check
  92. #define X2_CS_PIN 16 // PA4 SPI_CS
  93. #define Y2_CS_PIN 16 // PA4 SPI_CS
  94. #define Z2_CS_PIN 16 // PA4 SPI_CS
  95. #define Z3_CS_PIN 16 // PA4 SPI_CS
  96. #define E3_CS_PIN 16 // PA4 SPI_CS
  97. #define E4_CS_PIN 16 // PA4 SPI_CS
  98. #define E5_CS_PIN 16 // PA4 SPI_CS
  99. #if HAS_L64XX
  100. #define L6470_CHAIN_SCK_PIN 17 // PA5
  101. #define L6470_CHAIN_MISO_PIN 18 // PA6
  102. #define L6470_CHAIN_MOSI_PIN 19 // PA7
  103. #define L6470_CHAIN_SS_PIN 16 // PA4
  104. //#define SCK_PIN L6470_CHAIN_SCK_PIN
  105. //#define MISO_PIN L6470_CHAIN_MISO_PIN
  106. //#define MOSI_PIN L6470_CHAIN_MOSI_PIN
  107. #else
  108. //#define SCK_PIN 13 // PB13 SPI_S
  109. //#define MISO_PIN 12 // PB14 SPI_M
  110. //#define MOSI_PIN 11 // PB15 SPI_M
  111. #endif
  112. /**
  113. * Macro to reset/enable L6474 stepper drivers
  114. *
  115. * IMPORTANT - To disable (bypass) L6474s, install the corresponding
  116. * resistors (R11 - R17) and change the "V" to "0" for the
  117. * corresponding pins here:
  118. */
  119. #define ENABLE_RESET_L64XX_CHIPS(V) do{ OUT_WRITE(X_ENABLE_PIN, V); \
  120. OUT_WRITE(Y_ENABLE_PIN, V); \
  121. OUT_WRITE(Z_ENABLE_PIN, V); \
  122. OUT_WRITE(E0_ENABLE_PIN,V); \
  123. OUT_WRITE(E1_ENABLE_PIN,V); \
  124. OUT_WRITE(E2_ENABLE_PIN,V); \
  125. }while(0)
  126. //
  127. // Temperature Sensors
  128. //
  129. #define TEMP_0_PIN 3 // Analog input 3, digital pin 54 PA0 E1_THERMISTOR
  130. #define TEMP_1_PIN 4 // Analog input 4, digital pin 55 PA1 E2_THERMISTOR
  131. #define TEMP_2_PIN 5 // Analog input 5, digital pin 56 PA2 E3_THERMISTOR
  132. #define TEMP_BED_PIN 0 // Analog input 0, digital pin 51 PC2 BED_THERMISTOR_1
  133. #define TEMP_BED_1_PIN 1 // Analog input 1, digital pin 52 PC3 BED_THERMISTOR_2
  134. #define TEMP_BED_2_PIN 2 // Analog input 2, digital pin 53 PA3 BED_THERMISTOR_3
  135. //
  136. // Heaters / Fans
  137. //
  138. #define HEATER_0_PIN 48 // PC7 E1_HEAT_PWM
  139. #define HEATER_1_PIN 49 // PB0 E2_HEAT_PWM
  140. #define HEATER_2_PIN 50 // PB1 E3_HEAT_PWM
  141. #define HEATER_BED_PIN 46 // PD14 (BED_HEAT_1 FET
  142. #define HEATER_BED_1_PIN 45 // PD13 (BED_HEAT_2 FET
  143. #define HEATER_BED_2_PIN 47 // PD15 (BED_HEAT_3 FET
  144. #define FAN_PIN 57 // PC4 E1_FAN PWM pin, Part cooling fan FET
  145. #define FAN1_PIN 58 // PC5 E2_FAN PWM pin, Extruder fan FET
  146. #define ORIG_E0_AUTO_FAN_PIN FAN1_PIN
  147. #define FAN2_PIN 59 // PE8 E3_FAN PWM pin, Controller fan FET
  148. //
  149. // Misc functions
  150. //
  151. #define SDSS 16 // PA4 SPI_CS
  152. #define LED_PIN -1 // 9 // PE1 green LED Heart beat
  153. #define PS_ON_PIN -1
  154. #define KILL_PIN -1
  155. #define POWER_LOSS_PIN -1 // PWR_LOSS / nAC_FAULT
  156. //
  157. // LCD / Controller
  158. //
  159. //#define SD_DETECT_PIN 66 // PA15 SD_CA
  160. //#define BEEPER_PIN 24 // PC9 SDIO_D1
  161. //#define LCD_PINS_RS 65 // PE9 Y_DIR
  162. //#define LCD_PINS_ENABLE 59 // PE8 E3_FAN
  163. //#define LCD_PINS_D4 10 // PB12 SPI_C
  164. //#define LCD_PINS_D5 13 // PB13 SPI_S
  165. //#define LCD_PINS_D6 12 // PB14 SPI_M
  166. //#define LCD_PINS_D7 11 // PB15 SPI_M
  167. //#define BTN_EN1 57 // PC4 E1_FAN
  168. //#define BTN_EN2 58 // PC5 E2_FAN
  169. //#define BTN_ENC 52 // PC3 BED_THE
  170. //
  171. // Extension pins
  172. //
  173. //#define EXT0_PIN 49 // PB0 E2_HEAT
  174. //#define EXT1_PIN 50 // PB1 E3_HEAT
  175. //#define EXT2_PIN // PB2 not used (tied to ground
  176. //#define EXT3_PIN 39 // PD8 X_STOP
  177. //#define EXT4_PIN 40 // PD9 Y_STOP
  178. //#define EXT5_PIN 41 // PD10 Z_STOP
  179. //#define EXT6_PIN 42 // PD11
  180. //#define EXT7_PIN 71 // PD12 E1_PW
  181. //#define EXT8_PIN 64 // PB10 Y_PWM
  182. // WIFI
  183. // 2 // PD3 CTS
  184. // 3 // PD4 RTS
  185. // 4 // PD5 TX
  186. // 5 // PD6 RX
  187. // 6 // PB5 WIFI_WAKEUP
  188. // 7 // PE11 WIFI_RESET
  189. // 8 // PE12 WIFI_BOOT
  190. // I2C USER
  191. // 14 // PB7 SDA
  192. // 15 // PB6 SCL
  193. // JTAG
  194. // 20 // PA13 JTAG_TMS/SWDIO
  195. // 21 // PA14 JTAG_TCK/SWCLK
  196. // 22 // PB3 JTAG_TDO/SWO
  197. //
  198. // Onboard SD support
  199. //
  200. #define SDIO_D0_PIN 23 // PC8 SDIO_D0
  201. #define SDIO_D1_PIN 24 // PC9 SDIO_D1
  202. //#define SD_CARD_DETECT_PIN 25 // PA15 SD_CARD_DETECT
  203. #define SDIO_D2_PIN 26 // PC10 SDIO_D2
  204. #define SDIO_D3_PIN 27 // PC11 SDIO_D3
  205. #define SDIO_CK_PIN 28 // PC12 SDIO_CK
  206. #define SDIO_CMD_PIN 29 // PD2 SDIO_CMD
  207. #if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD
  208. #define SDIO_SUPPORT // Use SDIO for onboard SD
  209. #ifndef SDIO_SUPPORT
  210. #define SOFTWARE_SPI // Use soft SPI for onboard SD
  211. #define SDSS SDIO_D3_PIN
  212. #define SCK_PIN SDIO_CK_PIN
  213. #define MISO_PIN SDIO_D0_PIN
  214. #define MOSI_PIN SDIO_CMD_PIN
  215. #endif
  216. #endif
  217. // OTG
  218. // 30 // PA11 OTG_DM
  219. // 31 // PA12 OTG_DP
  220. // USER_PINS
  221. // 34 // PD7 USER3
  222. // 35 // PB9 USER1
  223. // 36 // PE0 USER2
  224. // 37 // PB4 USER4
  225. // USERKET
  226. // 38 // PE7 USER_BUTTON
  227. // 0 // PA9 TX
  228. // 1 // PA10 RX
  229. // IR/PROBE
  230. // 32 // PD1 IR_OUT
  231. // 33 // PC1 IR_ON
  232. /**
  233. * Logical pin vs. port/pin cross reference
  234. *
  235. * PA0 54 // E1_THERMISTOR PA9 0 // TX
  236. * PA1 55 // E2_THERMISTOR PA10 1 // RX
  237. * PA2 56 // E3_THERMISTOR PD3 2 // CTS
  238. * PA3 53 // BED_THERMISTOR_3 PD4 3 // RTS
  239. * PA4 16 // SPI_CS PD5 4 // TX
  240. * PA5 17 // SPI_SCK PD6 5 // RX
  241. * PA6 18 // SPI_MISO PB5 6 // WIFI_WAKEUP
  242. * PA7 19 // SPI_MOSI PE11 7 // WIFI_RESET
  243. * PA8 43 // V_STOP PE12 8 // WIFI_BOOT
  244. * PA9 0 // TX PE1 9 // STATUS_LED
  245. * PA10 1 // RX PB12 10 // SPI_CS
  246. * PA11 30 // OTG_DM PB15 11 // SPI_MOSI
  247. * PA12 31 // OTG_DP PB14 12 // SPI_MISO
  248. * PA13 20 // JTAG_TMS/SWDIO PB13 13 // SPI_SCK
  249. * PA14 21 // JTAG_TCK/SWCLK PB7 14 // SDA
  250. * PA15 25 // SD_CARD_DETECT PB6 15 // SCL
  251. * PB0 49 // E2_HEAT_PWM PA4 16 // SPI_CS
  252. * PB1 50 // E3_HEAT_PWM PA5 17 // SPI_SCK
  253. * PB3 22 // JTAG_TDO/SWO PA6 18 // SPI_MISO
  254. * PB4 37 // USER4 PA7 19 // SPI_MOSI
  255. * PB5 6 // WIFI_WAKEUP PA13 20 // JTAG_TMS/SWDIO
  256. * PB6 15 // SCL PA14 21 // JTAG_TCK/SWCLK
  257. * PB7 14 // SDA PB3 22 // JTAG_TDO/SWO
  258. * PB8 77 // E3_PWM PC8 23 // SDIO_D0
  259. * PB9 35 // USER1 PC9 24 // SDIO_D1
  260. * PB10 64 // Y_PWM PA15 25 // SD_CARD_DETECT
  261. * PB12 10 // SPI_CS PC10 26 // SDIO_D2
  262. * PB13 13 // SPI_SCK PC11 27 // SDIO_D3
  263. * PB14 12 // SPI_MISO PC12 28 // SDIO_CK
  264. * PB15 11 // SPI_MOSI PD2 29 // SDIO_CMD
  265. * PC0 68 // Z_DIR PA11 30 // OTG_DM
  266. * PC1 33 // IR_ON PA12 31 // OTG_DP
  267. * PC2 51 // BED_THERMISTOR_1 PD1 32 // IR_OUT
  268. * PC3 52 // BED_THERMISTOR_2 PC1 33 // IR_ON
  269. * PC4 57 // E1_FAN PD7 34 // USER3
  270. * PC5 58 // E2_FAN PB9 35 // USER1
  271. * PC6 67 // Z_PWM PE0 36 // USER2
  272. * PC7 48 // E1_HEAT_PWM PB4 37 // USER4
  273. * PC8 23 // SDIO_D0 PE7 38 // USER_BUTTON
  274. * PC9 24 // SDIO_D1 PD8 39 // X_STOP
  275. * PC10 26 // SDIO_D2 PD9 40 // Y_STOP
  276. * PC11 27 // SDIO_D3 PD10 41 // Z_STOP
  277. * PC12 28 // SDIO_CK PD11 42 // U_STOP
  278. * PC13 70 // E1_DIR PA8 43 // V_STOP
  279. * PC14 69 // E1_RESET PD0 44 // W_STOP
  280. * PC15 66 // Z_RESET PD13 45 // BED_HEAT_2
  281. * PD0 44 // W_STOP PD14 46 // BED_HEAT_1
  282. * PD1 32 // IR_OUT PD15 47 // BED_HEAT_3
  283. * PD2 29 // SDIO_CMD PC7 48 // E1_HEAT_PWM
  284. * PD3 2 // CTS PB0 49 // E2_HEAT_PWM
  285. * PD4 3 // RTS PB1 50 // E3_HEAT_PWM
  286. * PD5 4 // TX PC2 51 // BED_THERMISTOR_1
  287. * PD6 5 // RX PC3 52 // BED_THERMISTOR_2
  288. * PD7 34 // USER3 PA3 53 // BED_THERMISTOR_3
  289. * PD8 39 // X_STOP PA0 54 // E1_THERMISTOR
  290. * PD9 40 // Y_STOP PA1 55 // E2_THERMISTOR
  291. * PD10 41 // Z_STOP PA2 56 // E3_THERMISTOR
  292. * PD11 42 // U_STOP PC4 57 // E1_FAN
  293. * PD12 71 // E1_PWM PC5 58 // E2_FAN
  294. * PD13 45 // BED_HEAT_2 PE8 59 // E3_FAN
  295. * PD14 46 // BED_HEAT_1 PE13 60 // X_RESET
  296. * PD15 47 // BED_HEAT_3 PE14 61 // X_PWM
  297. * PE0 36 // USER2 PE15 62 // X_DIR
  298. * PE1 9 // STATUS_LED PE10 63 // Y_RESET
  299. * PE2 76 // E3_DIR PB10 64 // Y_PWM
  300. * PE3 75 // E3_RESET PE9 65 // Y_DIR
  301. * PE4 72 // E2_RESET PC15 66 // Z_RESET
  302. * PE5 73 // E2_PWM PC6 67 // Z_PWM
  303. * PE6 74 // E2_DIR PC0 68 // Z_DIR
  304. * PE7 38 // USER_BUTTON PC14 69 // E1_RESET
  305. * PE8 59 // E3_FAN PC13 70 // E1_DIR
  306. * PE9 65 // Y_DIR PD12 71 // E1_PWM
  307. * PE10 63 // Y_RESET PE4 72 // E2_RESET
  308. * PE11 7 // WIFI_RESET PE5 73 // E2_PWM
  309. * PE12 8 // WIFI_BOOT PE6 74 // E2_DIR
  310. * PE13 60 // X_RESET PE3 75 // E3_RESET
  311. * PE14 61 // X_PWM PE2 76 // E3_DIR
  312. * PE15 62 // X_DIR PB8 77 // E3_PWM
  313. */