Skip to content

Commit

Permalink
Alfawise Flash EEPROM, Z Servo Probe (MarlinFirmware#14877)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot authored and thinkyhead committed Aug 14, 2019
1 parent 0fbb26c commit 4cc1039
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 23 deletions.
45 changes: 30 additions & 15 deletions Marlin/src/pins/stm32/pins_LONGER3D_LK.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -139,16 +143,27 @@
#endif

//
// SPI1 (EEPROM W25Q64 + DAC OUT)
// Persistent Storage
// If no option is selected below the SD Card will be used
//
//#define SPI_EEPROM
#define FLASH_EEPROM_EMULATION

#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 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
*/
#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
14 changes: 7 additions & 7 deletions config/examples/Alfawise/U20/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion config/examples/Alfawise/U20/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4cc1039

Please sign in to comment.