Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LCD_FOR_MELZI to BTT E3 RRF mainboard #23453

Merged
merged 7 commits into from
Jan 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,52 @@

#if HAS_WIRED_LCD

#if ENABLED(CR10_STOCKDISPLAY)
#if EITHER(CR10_STOCKDISPLAY, LCD_FOR_MELZI)

#define BEEPER_PIN PE8
#define BTN_ENC PE9

#define BTN_ENC PE9
#define BTN_EN1 PE7
#define BTN_EN2 PB2

#define LCD_PINS_RS PB1
#define LCD_PINS_ENABLE PE11
#define LCD_PINS_D4 PE10

#if ENABLED(LCD_FOR_MELZI)

#error "CAUTION! LCD_FOR_MELZI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. Comment out this line to continue."

/** LCD_FOR_MELZI display pinout
*
* BTT E3 RRF Display Ribbon
* ------ ------
* (BEEPER) PE8 |10 9 | PE9 (BTN_ENC) GND |10 9 | 5V
* (BTN_EN1) PE7 | 8 7 | RESET BEEPER | 8 7 | ESTOP (RESET)
* (BTN_EN2) PB2 6 5 | PE10 (LCD_D4) (BTN_ENC) ENC_BTN | 6 5 | LCD_SCLK (LCD_D4)
* (LCD_RS) PB1 | 4 3 | PE11 (LCD_EN) (BTN_EN2) ENC_A | 4 3 | LCD_DATA (LCD_EN)
* GND | 2 1 | 5V (BTN_EN1) ENC_B | 2 1 | LCD_CS (LCD_RS)
* ------ ------
* EXP1 Ribbon
*
* Needs custom cable:
*
* Board Adapter Display Ribbon (coming from display)
*
* EXP1-1 ----------- EXP1-9
* EXP1-2 ----------- EXP1-10
* EXP1-3 ----------- EXP1-3
* EXP1-4 ----------- EXP1-1
* EXP1-5 ----------- EXP1-5
* EXP1-6 ----------- EXP1-4
* EXP1-7 ----------- EXP1-7
* EXP1-8 ----------- EXP1-8
* EXP1-9 ----------- EXP1-6
* EXP1-10 ----------- EXP1-8
*/

#endif

#elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!

#error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. Comment out this line to continue."
Expand Down Expand Up @@ -275,11 +309,15 @@
#endif

#else
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BTT_E3_RRF."
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, LCD_FOR_MELZI, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BTT_E3_RRF."
#endif

// Alter timing for graphical display
#if IS_U8GLIB_ST7920
#if ENABLED(LCD_FOR_MELZI) // LCD_FOR_MELZI default timing is too fast. This works but may be reduced.
#define BOARD_ST7920_DELAY_1 200
#define BOARD_ST7920_DELAY_2 400
#define BOARD_ST7920_DELAY_3 1200
#elif IS_U8GLIB_ST7920
#define BOARD_ST7920_DELAY_1 96
#define BOARD_ST7920_DELAY_2 48
#define BOARD_ST7920_DELAY_3 600
Expand All @@ -306,7 +344,7 @@
* Needs custom cable:
*
* Board Adapter Display
* _________
*
* EXP1-1 ----------- EXP1-10
* EXP1-2 ----------- EXP1-9
* SPI1-4 ----------- EXP1-6
Expand Down