My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

pins_LONGER3D_LK.h 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. *
  18. */
  19. #pragma once
  20. /**
  21. * Longer3D LK1/LK2 & Alfawise U20/U30 (STM32F103VET6) board pin assignments
  22. */
  23. #if NOT_TARGET(__STM32F1__, STM32F1xx)
  24. #error "Oops! Select a STM32F1 board in 'Tools > Board.'"
  25. #elif HOTENDS > 1 || E_STEPPERS > 1
  26. #error "Longer3D only supports one hotend / E-stepper. Comment out this line to continue."
  27. #endif
  28. #define BOARD_INFO_NAME "Longer3D"
  29. #define BOARD_NO_NATIVE_USB
  30. //#define DISABLE_DEBUG // We still want to debug with STLINK...
  31. #define DISABLE_JTAG // We free the jtag pins (PA15) but keep STLINK
  32. // Release PB4 (STEP_X_PIN) from JTAG NRST role.
  33. //
  34. // Limit Switches
  35. //
  36. #define X_MIN_PIN PC1 // pin 16
  37. #define X_MAX_PIN PC0 // pin 15 (Filament sensor on Alfawise setup)
  38. #define Y_MIN_PIN PC15 // pin 9
  39. #define Y_MAX_PIN PC14 // pin 8 (Unused in stock Alfawise setup)
  40. #define Z_MIN_PIN PE6 // pin 5 Standard Endstop or Z_Probe endstop function
  41. #define Z_MAX_PIN PE5 // pin 4 (Unused in stock Alfawise setup)
  42. // May be used for BLTouch Servo function on older variants (<= V08)
  43. #define ONBOARD_ENDSTOPPULLUPS
  44. //
  45. // Filament Sensor
  46. //
  47. #ifndef FIL_RUNOUT_PIN
  48. #define FIL_RUNOUT_PIN PC0 // XMAX plug on PCB used as filament runout sensor on Alfawise boards (inverting true)
  49. #endif
  50. //
  51. // Steppers
  52. //
  53. #define X_ENABLE_PIN PB5 // pin 91
  54. #define X_STEP_PIN PB4 // pin 90
  55. #define X_DIR_PIN PB3 // pin 89
  56. #define Y_ENABLE_PIN PB8 // pin 95
  57. #define Y_STEP_PIN PB7 // pin 93
  58. #define Y_DIR_PIN PB6 // pin 92
  59. #define Z_ENABLE_PIN PE1 // pin 98
  60. #define Z_STEP_PIN PE0 // pin 97
  61. #define Z_DIR_PIN PB9 // pin 96
  62. #define E0_ENABLE_PIN PE4 // pin 3
  63. #define E0_STEP_PIN PE3 // pin 2
  64. #define E0_DIR_PIN PE2 // pin 1
  65. //
  66. // Temperature Sensors
  67. //
  68. #define TEMP_0_PIN PA0 // pin 23 (Nozzle 100K/3950 thermistor)
  69. #define TEMP_BED_PIN PA1 // pin 24 (Hot Bed 100K/3950 thermistor)
  70. //
  71. // Heaters / Fans
  72. //
  73. #define HEATER_0_PIN PD3 // pin 84 (Nozzle Heat Mosfet)
  74. #define HEATER_BED_PIN PA8 // pin 67 (Hot Bed Mosfet)
  75. #define FAN_PIN PA15 // pin 77 (4cm Fan)
  76. #define FAN_SOFT_PWM // Required to avoid issues with heating or STLink
  77. #define FAN_MIN_PWM 35 // Fan will not start in 1-30 range
  78. #define FAN_MAX_PWM 255
  79. //#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor
  80. // Can drive a PC Buzzer, if connected between PWM and 5V pins
  81. #define LED_PIN PC2 // pin 17
  82. // Longer3D board mosfets are passing by default
  83. // Avoid nozzle heat and fan start before serial init
  84. #define BOARD_OPENDRAIN_MOSFETS
  85. #define BOARD_INIT_OD_PINS() { \
  86. OUT_WRITE_OD(HEATER_0_PIN, 0); \
  87. OUT_WRITE_OD(HEATER_BED_PIN, 0); \
  88. OUT_WRITE_OD(FAN_PIN, 0); \
  89. }
  90. #ifdef MAPLE_STM32F1
  91. // Only Maple Framework allow that early
  92. #define BOARD_PREINIT BOARD_INIT_OD_PINS
  93. #else
  94. #define BOARD_INIT BOARD_INIT_OD_PINS
  95. #endif
  96. //
  97. // PWM for a servo probe
  98. // Other servo devices are not supported on this board!
  99. //
  100. #if HAS_Z_SERVO_PROBE
  101. #define SERVO0_PIN PD13 // Open drain PWM pin on the V0G (GND or floating 5V)
  102. #define SERVO0_PWM_OD // Comment this if using PE5
  103. //#define SERVO0_PIN PE5 // Pulled up PWM pin on the V08 (3.3V or 0)
  104. //#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5)
  105. #endif
  106. //
  107. // TFT with FSMC interface
  108. //
  109. #if HAS_FSMC_TFT
  110. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  111. #define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1
  112. #define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed
  113. #define FSMC_DMA_DEV DMA2
  114. #define FSMC_DMA_CHANNEL DMA_CH5
  115. #define TFT_CS_PIN FSMC_CS_PIN
  116. #define TFT_RS_PIN FSMC_RS_PIN
  117. #define TFT_RESET_PIN PC4 // pin 33
  118. #define TFT_BACKLIGHT_PIN PD12 // pin 59
  119. #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
  120. #define DOGLCD_SCK -1
  121. // Buffer for Color UI
  122. #define TFT_BUFFER_SIZE 3200
  123. #endif
  124. #if ENABLED(SDIO_SUPPORT)
  125. #define SD_SS_PIN -1 // else SDSS set to PA4 in M43 (spi_pins.h)
  126. #endif
  127. /**
  128. * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer
  129. * mixed up MOSI and MISO pins. SPI is managed in SW, and needs pins
  130. * declared below.
  131. */
  132. #if NEED_TOUCH_PINS
  133. #define TOUCH_CS_PIN PB12 // pin 51 SPI2_NSS
  134. #define TOUCH_SCK_PIN PB13 // pin 52
  135. #define TOUCH_MOSI_PIN PB14 // pin 53 (Inverted MOSI/MISO = No HW SPI2)
  136. #define TOUCH_MISO_PIN PB15 // pin 54
  137. #define TOUCH_INT_PIN PC6 // pin 63 (PenIRQ coming from ADS7843)
  138. #endif
  139. //
  140. // Persistent Storage
  141. // If no option is selected below the SD Card will be used
  142. //
  143. #if NO_EEPROM_SELECTED
  144. //#define SPI_EEPROM
  145. //#define HAS_SPI_FLASH 1 // need MARLIN_DEV_MODE for M993/M994 eeprom backup tests
  146. #define FLASH_EEPROM_EMULATION
  147. #endif
  148. #if ENABLED(SPI_EEPROM)
  149. // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits)
  150. #define SPI_CHAN_EEPROM1 1
  151. #define SPI_EEPROM1_CS PC5 // pin 34
  152. #define EEPROM_SCK BOARD_SPI1_SCK_PIN // PA5 pin 30
  153. #define EEPROM_MISO BOARD_SPI1_MISO_PIN // PA6 pin 31
  154. #define EEPROM_MOSI BOARD_SPI1_MOSI_PIN // PA7 pin 32
  155. #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet)
  156. #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now...
  157. #elif HAS_SPI_FLASH
  158. #define SPI_FLASH_SIZE 0x40000U // limit to 256KB (M993 will reboot with 512)
  159. #define W25QXX_CS_PIN PC5
  160. #define W25QXX_MOSI_PIN PA7
  161. #define W25QXX_MISO_PIN PA6
  162. #define W25QXX_SCK_PIN PA5
  163. #elif ENABLED(FLASH_EEPROM_EMULATION)
  164. // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h)
  165. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  166. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  167. #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE)
  168. #else
  169. #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM
  170. #endif