From 4cc103958ed14708f410f38d58e246df173e2734 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Wed, 14 Aug 2019 06:41:17 +0200 Subject: [PATCH] Alfawise Flash EEPROM, Z Servo Probe (#14877) --- Marlin/src/pins/stm32/pins_LONGER3D_LK.h | 45 ++++++++++++------- config/examples/Alfawise/U20/Configuration.h | 14 +++--- .../examples/Alfawise/U20/Configuration_adv.h | 3 +- 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/Marlin/src/pins/stm32/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32/pins_LONGER3D_LK.h index 9c9806cb2f..debac01c9d 100644 --- a/Marlin/src/pins/stm32/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32/pins_LONGER3D_LK.h @@ -94,12 +94,16 @@ #define LED_PIN PC2 // pin 17 // -// PWM +// PWM for a servo probe +// Other servo devices are not supported on this board! // -#define SERVO0_PIN PD13 // Open drain PWM pin on the V0G (GND or floating 5V) -#define SERVO0_PWM_OD // Comment this if using PE5 +#if HAS_Z_SERVO_PROBE + #define SERVO0_PIN PD13 // Open drain PWM pin on the V0G (GND or floating 5V) + #define SERVO0_PWM_OD // Comment this if using PE5 -//#define SERVO0_PIN PE5 // Pulled up PWM pin on the V08 (3.3V or 0) + //#define SERVO0_PIN PE5 // Pulled up PWM pin on the V08 (3.3V or 0) + //#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5) +#endif /** * Note: Alfawise screens use various TFT controllers. Supported screens @@ -139,16 +143,27 @@ #endif // -// SPI1 (EEPROM W25Q64 + DAC OUT) +// Persistent Storage +// If no option is selected below the SD Card will be used // -#undef E2END -#define E2END 0x7FF // EEPROM end address (reserve 2kB on sd/sram, real spi one is 8MB/64Mbits) -/* -#define SPI_EEPROM 1 // If commented this will create a file on the SD card as a replacement -#define SPI_CHAN_EEPROM1 1 -#define SPI_EEPROM1_CS PC5 // pin 34 +//#define SPI_EEPROM +#define FLASH_EEPROM_EMULATION -//#define EEPROM_SCK BOARD_SPI1_SCK_PIN // PA5 pin 30 -//#define EEPROM_MISO BOARD_SPI1_MISO_PIN // PA6 pin 31 -//#define EEPROM_MOSI BOARD_SPI1_MOSI_PIN // PA7 pin 32 -*/ +#undef E2END +#if ENABLED(SPI_EEPROM) + // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits) + #define SPI_CHAN_EEPROM1 1 + #define SPI_EEPROM1_CS PC5 // pin 34 + #define EEPROM_SCK BOARD_SPI1_SCK_PIN // PA5 pin 30 + #define EEPROM_MISO BOARD_SPI1_MISO_PIN // PA6 pin 31 + #define EEPROM_MOSI BOARD_SPI1_MOSI_PIN // PA7 pin 32 + #define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet) + #define E2END ((16 * EEPROM_PAGE_SIZE)-1) // Limit to 64KB for now... +#elif ENABLED(FLASH_EEPROM_EMULATION) + // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) + #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) + #define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB) + #define E2END (EEPROM_PAGE_SIZE - 1) +#else + #define E2END (0x7FFU) // On SD, Limit to 2KB, require this amount of RAM +#endif diff --git a/config/examples/Alfawise/U20/Configuration.h b/config/examples/Alfawise/U20/Configuration.h index d3b878a800..819ad38371 100644 --- a/config/examples/Alfawise/U20/Configuration.h +++ b/config/examples/Alfawise/U20/Configuration.h @@ -1379,8 +1379,8 @@ #if ENABLED(LEVEL_BED_CORNERS) #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners - #define LEVEL_CORNERS_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points - #define LEVEL_CENTER_TOO // Move to the center after the last corner + #define LEVEL_CORNERS_HEIGHT 0.2 // (mm) Z height of nozzle at leveling points + #define LEVEL_CENTER_TOO // Move to the center after the last corner #endif /** @@ -1418,7 +1418,7 @@ #endif // Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (20*60) +#define HOMING_FEEDRATE_XY (40*60) #define HOMING_FEEDRATE_Z (7*60) // Validate that endstops are triggered on homing moves @@ -2151,10 +2151,10 @@ #if ENABLED(TS_V11) // Alfawise U20 ILI9341 2.8 TP Ver 1.1 / Green PCB on the back of touchscreen - #define XPT2046_X_CALIBRATION 11605 - #define XPT2046_Y_CALIBRATION 9091 - #define XPT2046_X_OFFSET -24 - #define XPT2046_Y_OFFSET -17 + #define XPT2046_X_CALIBRATION 11605 + #define XPT2046_Y_CALIBRATION 9091 + #define XPT2046_X_OFFSET -24 + #define XPT2046_Y_OFFSET -17 #endif #if ENABLED(TS_V12) diff --git a/config/examples/Alfawise/U20/Configuration_adv.h b/config/examples/Alfawise/U20/Configuration_adv.h index b004c2bbd2..6c805e1a19 100644 --- a/config/examples/Alfawise/U20/Configuration_adv.h +++ b/config/examples/Alfawise/U20/Configuration_adv.h @@ -517,7 +517,7 @@ #define X_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5 #define Z_HOME_BUMP_MM 2 -#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +#define HOMING_BUMP_DIVISOR { 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially //#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing @@ -650,6 +650,7 @@ #if EITHER(ULTIPANEL, EXTENSIBLE_UI) #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) #if ENABLED(ULTIPANEL) #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen