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_LONGER3D_LK.h 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. * Longer3D LK1/LK2 & Alfawise U20/U30 (STM32F103VET6) board pin assignments
  25. */
  26. #if NOT_TARGET(__STM32F1__, STM32F1xx)
  27. #error "Oops! Select a STM32F1 board in 'Tools > Board.'"
  28. #elif HAS_MULTI_HOTEND || E_STEPPERS > 1
  29. #error "Longer3D only supports one hotend / E-stepper. Comment out this line to continue."
  30. #endif
  31. #define BOARD_INFO_NAME "Longer3D"
  32. #define BOARD_NO_NATIVE_USB
  33. //#define DISABLE_DEBUG // We still want to debug with STLINK...
  34. #define DISABLE_JTAG // We free the jtag pins (PA15) but keep STLINK
  35. // Release PB4 (STEP_X_PIN) from JTAG NRST role.
  36. //
  37. // Limit Switches
  38. //
  39. #define X_MIN_PIN PC1 // pin 16
  40. #define X_MAX_PIN PC0 // pin 15 (Filament sensor on Alfawise setup)
  41. #define Y_MIN_PIN PC15 // pin 9
  42. #define Y_MAX_PIN PC14 // pin 8 (Unused in stock Alfawise setup)
  43. #define Z_MIN_PIN PE6 // pin 5 Standard Endstop or Z_Probe endstop function
  44. #define Z_MAX_PIN PE5 // pin 4 (Unused in stock Alfawise setup)
  45. // May be used for BLTouch Servo function on older variants (<= V08)
  46. #define ONBOARD_ENDSTOPPULLUPS
  47. //
  48. // Filament Sensor
  49. //
  50. #ifndef FIL_RUNOUT_PIN
  51. #define FIL_RUNOUT_PIN PC0 // XMAX plug on PCB used as filament runout sensor on Alfawise boards (inverting true)
  52. #endif
  53. //
  54. // Steppers
  55. //
  56. #define X_ENABLE_PIN PB5 // pin 91
  57. #define X_STEP_PIN PB4 // pin 90
  58. #define X_DIR_PIN PB3 // pin 89
  59. #define Y_ENABLE_PIN PB8 // pin 95
  60. #define Y_STEP_PIN PB7 // pin 93
  61. #define Y_DIR_PIN PB6 // pin 92
  62. #define Z_ENABLE_PIN PE1 // pin 98
  63. #define Z_STEP_PIN PE0 // pin 97
  64. #define Z_DIR_PIN PB9 // pin 96
  65. #define E0_ENABLE_PIN PE4 // pin 3
  66. #define E0_STEP_PIN PE3 // pin 2
  67. #define E0_DIR_PIN PE2 // pin 1
  68. //
  69. // Temperature Sensors
  70. //
  71. #define TEMP_0_PIN PA0 // pin 23 (Nozzle 100K/3950 thermistor)
  72. #define TEMP_BED_PIN PA1 // pin 24 (Hot Bed 100K/3950 thermistor)
  73. //
  74. // Heaters / Fans
  75. //
  76. #define HEATER_0_PIN PD3 // pin 84 (Nozzle Heat Mosfet)
  77. #define HEATER_BED_PIN PA8 // pin 67 (Hot Bed Mosfet)
  78. #define FAN_PIN PA15 // pin 77 (4cm Fan)
  79. #if TERN(MAPLE_STM32F1, ENABLED(FAN_SOFT_PWM), ENABLED(FAST_PWM_FAN)) && FAN_MIN_PWM < 5 // Required to avoid issues with heating or STLink
  80. #error "FAN_MIN_PWM must be 5 or higher." // Fan will not start in 1-30 range
  81. #endif
  82. #if defined(MAPLE_STM32F1) || DISABLED(FAST_PWM_FAN) // STM32 HAL required to allow TIMER2 Hardware PWM
  83. #define FAN_SOFT_PWM_REQUIRED
  84. #else
  85. #if FAST_PWM_FAN_FREQUENCY <= 1000 // Default 1000 is noisy, max 65K (uint16)
  86. #error "FAST_PWM_FAN_FREQUENCY must be greater than 1000."
  87. #elif FAST_PWM_FAN_FREQUENCY > 65535
  88. #error "FAST_PWM_FAN_FREQUENCY must be less than 65536."
  89. #endif
  90. #endif
  91. //#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor
  92. // Can drive a PC Buzzer, if connected between PWM and 5V pins
  93. #define LED_PIN PC2 // pin 17
  94. // Longer3D board mosfets are passing by default
  95. // Avoid nozzle heat and fan start before serial init
  96. #define BOARD_OPENDRAIN_MOSFETS
  97. #define BOARD_PREINIT() { \
  98. OUT_WRITE_OD(HEATER_0_PIN, 0); \
  99. OUT_WRITE_OD(HEATER_BED_PIN, 0); \
  100. OUT_WRITE_OD(FAN_PIN, 0); \
  101. }
  102. //
  103. // PWM for a servo probe
  104. // Other servo devices are not supported on this board!
  105. //
  106. #if HAS_Z_SERVO_PROBE
  107. #define SERVO0_PIN PD13 // Open drain PWM pin on the V0G (GND or floating 5V)
  108. #define SERVO0_PWM_OD // Comment this if using PE5
  109. //#define SERVO0_PIN PE5 // Pulled up PWM pin on the V08 (3.3V or 0)
  110. //#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5)
  111. #endif
  112. //
  113. // TFT with FSMC interface
  114. //
  115. #if HAS_FSMC_TFT
  116. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  117. #define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1
  118. #define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed
  119. #define FSMC_DMA_DEV DMA2
  120. #define FSMC_DMA_CHANNEL DMA_CH5
  121. #define TFT_CS_PIN FSMC_CS_PIN
  122. #define TFT_RS_PIN FSMC_RS_PIN
  123. #define TFT_RESET_PIN PC4 // pin 33
  124. #define TFT_BACKLIGHT_PIN PD12 // pin 59
  125. #define TFT_BACKLIGHT_PWM 150 // Brightness with alt. TIM4 chan 1 (1-255)
  126. #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
  127. #define DOGLCD_SCK -1
  128. // Buffer for Color UI
  129. #define TFT_BUFFER_SIZE 3200
  130. #endif
  131. #if defined(TFT_BACKLIGHT_PWM) && !defined(MAPLE_STM32F1)
  132. #define HAS_LCD_BRIGHTNESS 1
  133. #define LCD_BRIGHTNESS_DEFAULT TFT_BACKLIGHT_PWM
  134. #endif
  135. #if ENABLED(SDIO_SUPPORT)
  136. #define SD_SS_PIN -1 // else SDSS set to PA4 in M43 (spi_pins.h)
  137. #endif
  138. /**
  139. * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer
  140. * mixed up MOSI and MISO pins. SPI is managed in SW, and needs pins
  141. * declared below.
  142. */
  143. #if NEED_TOUCH_PINS
  144. #define TOUCH_CS_PIN PB12 // pin 51 SPI2_NSS
  145. #define TOUCH_SCK_PIN PB13 // pin 52
  146. #define TOUCH_MOSI_PIN PB14 // pin 53 (Inverted MOSI/MISO = No HW SPI2)
  147. #define TOUCH_MISO_PIN PB15 // pin 54
  148. #define TOUCH_INT_PIN PC6 // pin 63 (PenIRQ coming from ADS7843)
  149. #endif
  150. //
  151. // Persistent Storage
  152. // If no option is selected below the SD Card will be used
  153. //
  154. #if NO_EEPROM_SELECTED
  155. //#define SPI_EEPROM
  156. //#define HAS_SPI_FLASH 1 // need MARLIN_DEV_MODE for M993/M994 eeprom backup tests
  157. #define FLASH_EEPROM_EMULATION
  158. #endif
  159. #if ENABLED(SPI_EEPROM)
  160. // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits)
  161. #define SPI_CHAN_EEPROM1 1
  162. #define SPI_EEPROM1_CS_PIN PC5 // pin 34
  163. #define EEPROM_SCK_PIN BOARD_SPI1_SCK_PIN // PA5 pin 30
  164. #define EEPROM_MISO_PIN BOARD_SPI1_MISO_PIN // PA6 pin 31
  165. #define EEPROM_MOSI_PIN BOARD_SPI1_MOSI_PIN // PA7 pin 32
  166. #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet)
  167. #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now...
  168. #elif HAS_SPI_FLASH
  169. #define SPI_FLASH_SIZE 0x40000U // limit to 256KB (M993 will reboot with 512)
  170. #define SPI_FLASH_CS_PIN PC5
  171. #define SPI_FLASH_MOSI_PIN PA7
  172. #define SPI_FLASH_MISO_PIN PA6
  173. #define SPI_FLASH_SCK_PIN PA5
  174. #elif ENABLED(FLASH_EEPROM_EMULATION)
  175. // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h)
  176. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  177. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  178. #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE)
  179. #else
  180. #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM
  181. #endif