From ce22259f580dcb0ef5c79d0faec799f262edaf5f Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 14 Jan 2020 11:31:45 +0800 Subject: [PATCH 1/4] Update FYSETC S6 pins --- Marlin/src/pins/stm32/pins_FYSETC_S6.h | 131 ++++++++++++++----------- 1 file changed, 74 insertions(+), 57 deletions(-) diff --git a/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin/src/pins/stm32/pins_FYSETC_S6.h index 227fe4cd559e..24732ef6cfbe 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_S6.h @@ -39,9 +39,14 @@ // // EEPROM Emulation -// +// #define FLASH_EEPROM_EMULATION //#define SRAM_EEPROM_EMULATION +//#define I2C_EEPROM +#ifdef I2C_EEPROM + #undef E2END // Defined in Arduino Core STM32 to be used with EEPROM emulation. This board uses a real EEPROM. + #define E2END 0xFFF // 4KB +#endif // // Limit Switches @@ -95,6 +100,7 @@ #if HAS_TMC220x /** * TMC2208/TMC2209 stepper drivers + * */ // @@ -159,70 +165,81 @@ // // LCD / Controller // +#if HAS_SPI_LCD + #define BEEPER_PIN PC9 + #define BTN_ENC PA8 -#define BEEPER_PIN PC9 -#define SD_DETECT_PIN PB10 - -#if ENABLED(FYSETC_MINI_12864) - // - // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 - // - #define DOGLCD_A0 PD2 - #define DOGLCD_CS PC11 - - //#define LCD_BACKLIGHT_PIN -1 - //#define KILL_PIN -1 + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PD0 + + #define BTN_EN1 PC11 + #define BTN_EN2 PC10 + + #define LCD_PINS_ENABLE PD1 + #define LCD_PINS_D4 PC12 + + // CR10_Stock Display needs a different delay setting on SKR PRO v1.1, so undef it here. + // It will be defined again at the #HAS_GRAPHICAL_LCD section below. + #undef ST7920_DELAY_1 + #undef ST7920_DELAY_2 + #undef ST7920_DELAY_3 + + #else + + #define LCD_PINS_RS PD2 + + #define BTN_EN1 PC6 + #define BTN_EN2 PC7 + #define SD_DETECT_PIN PB10 + + #define LCD_SDSS PA4 + + #define LCD_PINS_ENABLE PC11 + #define LCD_PINS_D4 PC10 + + #if ENABLED(FYSETC_MINI_12864) + // See https://wiki.fysetc.com/Mini12864_Panel + #define DOGLCD_CS PC11 + #define DOGLCD_A0 PD2 + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PC12 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PD0 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PD1 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PC12 + #endif + #endif // !FYSETC_MINI_12864 + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PC12 + #define LCD_PINS_D6 PD0 + #define LCD_PINS_D7 PD1 + #endif - #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. - // Seems to work best if left open. + #endif - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PC12 + // Alter timing for graphical display + #if HAS_GRAPHICAL_LCD + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(96) #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PD0 + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(48) #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PD1 + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(600) #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN PC12 - #endif - -#elif HAS_GRAPHICAL_LCD - #define LCD_PINS_RS PD2 - #define LCD_PINS_ENABLE PC11 - #define LCD_PINS_D4 PC10 - #define LCD_PINS_D5 PC12 - #define LCD_PINS_D6 PD0 - #define LCD_PINS_D7 PD1 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS PC12 - #define DOGLCD_A0 PD0 #endif -#endif - -#if ENABLED(NEWPANEL) - #define BTN_EN1 PC6 - #define BTN_EN2 PC7 - #define BTN_ENC PA8 -#endif - -// Alter timing for graphical display -#if HAS_GRAPHICAL_LCD - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(103) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(51) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(642) - #endif -#endif +#endif // HAS_SPI_LCD #ifndef RGB_LED_R_PIN #define RGB_LED_R_PIN PB6 From 311ac2c1e39da17c23ef4299dd88635625805d81 Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 14 Jan 2020 12:09:06 +0800 Subject: [PATCH 2/4] Support FYSETC Generic 12864 --- Marlin/Configuration.h | 14 ++++++++------ Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 1 + Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 6 +++++- Marlin/src/pins/stm32/pins_FYSETC_S6.h | 4 +++- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ee82fbf9f391..47c5ce82fa2c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -123,14 +123,14 @@ * * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] */ -#define BAUDRATE 250000 +#define BAUDRATE 115200 // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_14_EFB + #define MOTHERBOARD BOARD_FYSETC_F6_14 #endif // Name displayed in the LCD "Ready" message and Info menu @@ -1944,10 +1944,12 @@ // FYSETC variant of the MINI12864 graphic controller with SD support // https://wiki.fysetc.com/Mini12864_Panel/ // -//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default -//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) -//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight -//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight +#define FYSETC_GENERIC_12864_1_1 // Like FYSETC_MINI_12864 but bigger and need to control backlight + // // Factory display for Creality CR-10 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 296662082f86..0e87b79c2d1a 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -114,7 +114,7 @@ #define MINIPANEL -#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) +#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) #define FYSETC_MINI_12864 #define DOGLCD diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index ec0b06f66055..1159f2f3a864 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -262,7 +262,7 @@ #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) #define _LCD_CONTRAST_MIN 120 #define _LCD_CONTRAST_INIT 195 -#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) +#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) #define _LCD_CONTRAST_INIT 127 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index da27aef8e89c..48f92d985865 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1904,6 +1904,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(FYSETC_MINI_12864_1_2) \ + ENABLED(FYSETC_MINI_12864_2_0) \ + ENABLED(FYSETC_MINI_12864_2_1) \ + + ENABLED(FYSETC_GENERIC_12864_1_1) \ + ENABLED(CR10_STOCKDISPLAY) \ + ENABLED(ANET_FULL_GRAPHICS_LCD) \ + ENABLED(AZSMZ_12864) \ diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 4c6f59aaae8a..b30cf376bb35 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -225,7 +225,11 @@ #define DOGLCD_A0 16 #define DOGLCD_CS 17 - #define LCD_BACKLIGHT_PIN -1 + #if ENABLED(FYSETC_GENERIC_12864_1_1) + #define LCD_BACKLIGHT_PIN 27 + #else + #define LCD_BACKLIGHT_PIN -1 + #endif #define KILL_PIN 41 #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. diff --git a/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin/src/pins/stm32/pins_FYSETC_S6.h index 24732ef6cfbe..4d9bcc09b98e 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_S6.h @@ -201,7 +201,9 @@ // See https://wiki.fysetc.com/Mini12864_Panel #define DOGLCD_CS PC11 #define DOGLCD_A0 PD2 - //#define LCD_BACKLIGHT_PIN -1 + #if ENABLED(FYSETC_GENERIC_12864_1_1) + #define LCD_BACKLIGHT_PIN PD0 + #endif #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN From 665fab94a3b67b43e8bc7249d7c5300a305c7e8c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jan 2020 03:00:11 -0600 Subject: [PATCH 3/4] Undo extra changes --- Marlin/Configuration.h | 4 ++-- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 47c5ce82fa2c..0682a5bb98aa 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -123,14 +123,14 @@ * * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] */ -#define BAUDRATE 115200 +#define BAUDRATE 250000 // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_FYSETC_F6_14 + #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif // Name displayed in the LCD "Ready" message and Info menu diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index b30cf376bb35..4a3d046f2954 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -227,8 +227,6 @@ #if ENABLED(FYSETC_GENERIC_12864_1_1) #define LCD_BACKLIGHT_PIN 27 - #else - #define LCD_BACKLIGHT_PIN -1 #endif #define KILL_PIN 41 From ccbb7e501e58b9b5f304f892994adf0649a9dc8f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 17 Jan 2020 03:06:23 -0600 Subject: [PATCH 4/4] Tweaks --- Marlin/Configuration.h | 3 +-- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 2 +- Marlin/src/pins/stm32/pins_FYSETC_S6.h | 11 +++++------ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0682a5bb98aa..25c6ffdb22b0 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1948,8 +1948,7 @@ //#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) //#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight //#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight -#define FYSETC_GENERIC_12864_1_1 // Like FYSETC_MINI_12864 but bigger and need to control backlight - +//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight. // // Factory display for Creality CR-10 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 1159f2f3a864..4ad08ffa8270 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -262,7 +262,7 @@ #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) #define _LCD_CONTRAST_MIN 120 #define _LCD_CONTRAST_INIT 195 -#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) +#elif ENABLED(FYSETC_MINI_12864) #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) #define _LCD_CONTRAST_INIT 127 diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 4a3d046f2954..d009630392bc 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -228,8 +228,8 @@ #if ENABLED(FYSETC_GENERIC_12864_1_1) #define LCD_BACKLIGHT_PIN 27 #endif - #define KILL_PIN 41 + #define KILL_PIN 41 #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. // Seems to work best if left open. diff --git a/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin/src/pins/stm32/pins_FYSETC_S6.h index 4d9bcc09b98e..33756e437a86 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_S6.h @@ -39,7 +39,7 @@ // // EEPROM Emulation -// +// #define FLASH_EEPROM_EMULATION //#define SRAM_EEPROM_EMULATION //#define I2C_EEPROM @@ -98,10 +98,9 @@ #define E2_CS_PIN PC15 #if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - * - */ + // + // TMC2208/TMC2209 stepper drivers + // // // Software serial @@ -197,7 +196,7 @@ #define LCD_PINS_ENABLE PC11 #define LCD_PINS_D4 PC10 - #if ENABLED(FYSETC_MINI_12864) + #if ENABLED(FYSETC_MINI_12864) // See https://wiki.fysetc.com/Mini12864_Panel #define DOGLCD_CS PC11 #define DOGLCD_A0 PD2