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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. #ifdef MAPLE_STM32F1
  80. #define FAN_SOFT_PWM_REQUIRED
  81. #if ENABLED(FAN_SOFT_PWM) && FAN_MIN_PWM < 35 // Required to avoid issues with heating or STLink
  82. #error "FAN_MIN_PWM must be 35 or higher." // Fan will not start in 1-30 range
  83. #endif
  84. #elif ENABLED(FAST_PWM_FAN)
  85. #if FAST_PWM_FAN_FREQUENCY != 31400 // Default 1000 is noisy, max 65K (uint16)
  86. #error "FAST_PWM_FAN_FREQUENCY must be set to 31400."
  87. #endif
  88. #if FAN_MIN_PWM < 5
  89. #error "FAN_MIN_PWM must be 5 or higher."
  90. #endif
  91. #else
  92. #error "FAST_PWM_FAN required to allow TIMER2 Hardware PWM."
  93. #endif
  94. //#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor
  95. // Can drive a PC Buzzer, if connected between PWM and 5V pins
  96. #define LED_PIN PC2 // pin 17
  97. // Longer3D board mosfets are passing by default
  98. // Avoid nozzle heat and fan start before serial init
  99. #define BOARD_OPENDRAIN_MOSFETS
  100. #define BOARD_PREINIT() { \
  101. OUT_WRITE_OD(HEATER_0_PIN, 0); \
  102. OUT_WRITE_OD(HEATER_BED_PIN, 0); \
  103. OUT_WRITE_OD(FAN_PIN, 0); \
  104. }
  105. //
  106. // PWM for a servo probe
  107. // Other servo devices are not supported on this board!
  108. //
  109. #if HAS_Z_SERVO_PROBE
  110. #define SERVO0_PIN PD13 // Open drain PWM pin on the V0G (GND or floating 5V)
  111. #define SERVO0_PWM_OD // Comment this if using PE5
  112. //#define SERVO0_PIN PE5 // Pulled up PWM pin on the V08 (3.3V or 0)
  113. //#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5)
  114. #endif
  115. //
  116. // TFT with FSMC interface
  117. //
  118. #if HAS_FSMC_TFT
  119. #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
  120. #define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1
  121. #define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed
  122. #define FSMC_DMA_DEV DMA2
  123. #define FSMC_DMA_CHANNEL DMA_CH5
  124. #define TFT_CS_PIN FSMC_CS_PIN
  125. #define TFT_RS_PIN FSMC_RS_PIN
  126. #define TFT_RESET_PIN PC4 // pin 33
  127. #define TFT_BACKLIGHT_PIN PD12 // pin 59
  128. #define TFT_BACKLIGHT_PWM 150 // Brightness with alt. TIM4 chan 1 (1-255)
  129. #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
  130. #define DOGLCD_SCK -1
  131. // Buffer for Color UI
  132. #define TFT_BUFFER_SIZE 3200
  133. #endif
  134. #if defined(TFT_BACKLIGHT_PWM) && !defined(MAPLE_STM32F1)
  135. #define HAS_LCD_BRIGHTNESS 1
  136. #define DEFAULT_LCD_BRIGHTNESS TFT_BACKLIGHT_PWM
  137. #endif
  138. #if ENABLED(SDIO_SUPPORT)
  139. #define SD_SS_PIN -1 // else SDSS set to PA4 in M43 (spi_pins.h)
  140. #endif
  141. /**
  142. * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer
  143. * mixed up MOSI and MISO pins. SPI is managed in SW, and needs pins
  144. * declared below.
  145. */
  146. #if NEED_TOUCH_PINS
  147. #define TOUCH_CS_PIN PB12 // pin 51 SPI2_NSS
  148. #define TOUCH_SCK_PIN PB13 // pin 52
  149. #define TOUCH_MOSI_PIN PB14 // pin 53 (Inverted MOSI/MISO = No HW SPI2)
  150. #define TOUCH_MISO_PIN PB15 // pin 54
  151. #define TOUCH_INT_PIN PC6 // pin 63 (PenIRQ coming from ADS7843)
  152. #endif
  153. //
  154. // Persistent Storage
  155. // If no option is selected below the SD Card will be used
  156. //
  157. #if NO_EEPROM_SELECTED
  158. //#define SPI_EEPROM
  159. //#define HAS_SPI_FLASH 1 // need MARLIN_DEV_MODE for M993/M994 eeprom backup tests
  160. #define FLASH_EEPROM_EMULATION
  161. #endif
  162. #if ENABLED(SPI_EEPROM)
  163. // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits)
  164. #define SPI_CHAN_EEPROM1 1
  165. #define SPI_EEPROM1_CS_PIN PC5 // pin 34
  166. #define EEPROM_SCK_PIN BOARD_SPI1_SCK_PIN // PA5 pin 30
  167. #define EEPROM_MISO_PIN BOARD_SPI1_MISO_PIN // PA6 pin 31
  168. #define EEPROM_MOSI_PIN BOARD_SPI1_MOSI_PIN // PA7 pin 32
  169. #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet)
  170. #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now...
  171. #elif HAS_SPI_FLASH
  172. #define SPI_FLASH_SIZE 0x40000U // limit to 256KB (M993 will reboot with 512)
  173. #define SPI_FLASH_CS_PIN PC5
  174. #define SPI_FLASH_MOSI_PIN PA7
  175. #define SPI_FLASH_MISO_PIN PA6
  176. #define SPI_FLASH_SCK_PIN PA5
  177. #elif ENABLED(FLASH_EEPROM_EMULATION)
  178. // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h)
  179. #define EEPROM_PAGE_SIZE (0x800U) // 2KB
  180. #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
  181. #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE)
  182. #else
  183. #define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM
  184. #endif