-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
[BUG] MINIPANEL wrong contrast defines leading to blank screen #14174
Comments
I'm also seeing this on the Creality CR-20 (not supported by Marlin yet, but I've got some local patches based on Creality's GPL code dump; it's similar to a RAMPS board, but with different pinouts). Running bugfix-2.0.x on my CR20, setting "M250 C63" makes the screen very slightly visible if I look really hard. Under 1.1.x, the M250 command isn't even recognized. It seems that HAS_LCD_CONTRAST evaluated false for MINIPANEL under Marlin 1.1.x, but it's been enabled under 2.0.x If I modify the 1.1.x code so that HAS_LCD_CONTRAST is forced true, the screen seems to start out fine, and So, it seems like setting LCD contrast on MINIPANEL has never worked properly, but Marlin wasn't even trying to set it under 1.1.x. Right now, the code in Conditionals_LCD.h looks pretty bogus. That #define HAS_LCD_CONTRAST (HAS_GRAPHICAL_LCD && defined(DEFAULT_LCD_CONTRAST))
#if HAS_LCD_CONTRAST
#ifndef LCD_CONTRAST_MIN
#define LCD_CONTRAST_MIN 0
#endif
#ifndef LCD_CONTRAST_MAX
#define LCD_CONTRAST_MAX 63
#endif
#ifndef DEFAULT_LCD_CONTRAST
#define DEFAULT_LCD_CONTRAST 32
#endif
#endif Under 1.1.x 1.1.x, HAS_LCD_CONTRAST was defined differently, so that ifndef actually made some sense: #define HAS_LCD_CONTRAST ( \
ENABLED(MAKRPANEL) \
|| ENABLED(CARTESIO_UI) \
|| ENABLED(VIKI2) \
|| ENABLED(miniVIKI) \
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
) @Str8t I wonder what happens if you apply this patch as a workaround. It makes the LCD visible again on my CR-20. It doesn't fix LCD contrast handling, it just disables it: diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h
index 54cbcacf6..c536ea977 100644
--- a/Marlin/src/inc/Conditionals_LCD.h
+++ b/Marlin/src/inc/Conditionals_LCD.h
@@ -169,12 +169,16 @@
#endif
-#if EITHER(MAKRPANEL, MINIPANEL)
+#if ENABLED(MAKRPANEL)
#define DOGLCD
#define ULTIPANEL
#ifndef DEFAULT_LCD_CONTRAST
#define DEFAULT_LCD_CONTRAST 17
#endif
+#elif ENABLED(MINIPANEL)
+ #define DOGLCD
+ #define ULTIPANEL
+ #undef DEFAULT_LCD_CONTRAST // fixme: contrast handling currently broken; see https://github.com/MarlinFirmware/Marlin/issues/14174
#endif
#if ENABLED(ULTI_CONTROLLER)
@@ -353,6 +357,9 @@
*/
#define HAS_LCD_CONTRAST (HAS_GRAPHICAL_LCD && defined(DEFAULT_LCD_CONTRAST))
#if HAS_LCD_CONTRAST
+ #if ENABLED(MINIPANEL)
+ #error "This error should not be triggered" // See https://github.com/MarlinFirmware/Marlin/issues/14174
+ #endif
#ifndef LCD_CONTRAST_MIN
#define LCD_CONTRAST_MIN 0
#endif |
Same issue here. CR-20 Pro. My display doesn't work. Stock firmware. The above patch doesn't work. Printer is functional via Serial, but display in blank. |
I made it work, here is my diff. I had to disable lcd contrast for my MKS_MINI_12864. I'll check why and eventually submit a PR. diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h
index b9d112321..c028edefb 100644
--- a/Marlin/src/inc/Conditionals_LCD.h
+++ b/Marlin/src/inc/Conditionals_LCD.h
@@ -128,8 +128,8 @@
#elif ENABLED(MKS_MINI_12864)
#define MINIPANEL
- #define DEFAULT_LCD_CONTRAST 150
- #define LCD_CONTRAST_MAX 255
+ // #define DEFAULT_LCD_CONTRAST 150
+ // #define LCD_CONTRAST_MAX 255
#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)
@@ -190,9 +190,9 @@
#if ENABLED(MAKRPANEL)
#define U8GLIB_ST7565_64128N
#endif
- #ifndef DEFAULT_LCD_CONTRAST
- #define DEFAULT_LCD_CONTRAST 17
- #endif
+ // #ifndef DEFAULT_LCD_CONTRAST
+ // #define DEFAULT_LCD_CONTRAST 17
+ // #endif
#endif
#if ENABLED(IS_U8GLIB_SSD1306) |
First off I have to apologize that I did not upload my changes yet. I will try to do this the following days. @dlitz Like I already wrote, I made the contrast handling work by adjusting the LCD_CONTRAST defines (you can read in my first post why the defaults are wrong it this case). |
@Str8t I've tried changing the defines. But didn't worked out to me. As I don't need the contrast at this time, removing it fixed for now. |
Is there any downside to implementing this change so all configs with |
The #define HAS_LCD_CONTRAST( \
ENABLED(MAKRPANEL) \
|| ENABLED(CARTESIO_UI) \
|| ENABLED(VIKI2) \
|| ENABLED(miniVIKI) \
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
) As other panels come along with adjustable contrast, they can be added to the list. |
Continuation of #13732... For the Tevo Michelangelo config ( Adding another || option for
The contrast should be set to ~200 for the LCD to look "normal". Just for good measure, here's the block of code I was working with in /**
* Default LCD contrast for Graphical LCD displays
*/
//#define HAS_LCD_CONTRAST (HAS_GRAPHICAL_LCD && defined(DEFAULT_LCD_CONTRAST))
//#define HAS_LCD_CONTRAST (ENABLED(MAKRPANEL) || ENABLED(CARTESIO_UI) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MKS_MINI_12864))
//#define HAS_LCD_CONTRAST (ENABLED(MAKRPANEL) || ENABLED(CARTESIO_UI) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL))
#define HAS_LCD_CONTRAST (ENABLED(MAKRPANEL) || ENABLED(CARTESIO_UI) || ENABLED(VIKI2) || ENABLED(miniVIKI)) |
For the Wanhao Duplicator i3 Mini config ( Adding another || option for @thinkyhead: You answered my questions with some options in my PR/#14908, so troubleshooting this config further might be irrelevant.
The contrast should be set to max/255 for the LCD to look "normal" since it's a black LCD with white text. Just for good measure, here's the block of code I was working with in /**
* Default LCD contrast for Graphical LCD displays
*/
//#define HAS_LCD_CONTRAST (HAS_GRAPHICAL_LCD && defined(DEFAULT_LCD_CONTRAST))
//#define HAS_LCD_CONTRAST (ENABLED(MAKRPANEL) || ENABLED(CARTESIO_UI) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MKS_MINI_12864))
//#define HAS_LCD_CONTRAST (ENABLED(MAKRPANEL) || ENABLED(CARTESIO_UI) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL))
#define HAS_LCD_CONTRAST (ENABLED(MAKRPANEL) || ENABLED(CARTESIO_UI) || ENABLED(VIKI2) || ENABLED(miniVIKI)) |
From all this it sounds like all |
I would think so, but I don’t have more hardware to do further testing. Hopefully others will report their findings as well. |
Hopefully the now-merged PR will do the trick. If not we can re-open this. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
After starting to use the MINIPANEL of the Creality Ender-2 on the SKR V1.3 I ran into several problems.
One being, that the display turned on (some pixels burning, like an the original Melzi board) - but then the screen turned blank.
There are several issues which sound related (like #13732) but didn´t have any real solutions.
After analyzing the actual SPI trace I found out after the initialization sequence was done, the contrast is set two times again.
The first time it is set to zero, so probably a reset. But the second time it is set to the very low value of 4, which explains why the display is blank.
The DEFAULT_LCD_CONTRAST value of the MINIPANEL is 17, if not defined otherwise. The LCD_CONTRAST_MIN is 0 and the LCD_CONTRAST_MAX is 63.
This is conform to the possible value range in the UC1701 datasheet.
But the problem is, the u8g lib right shifts the contrast value two times when sending out an U8G_DEV_MSG_CONTRAST message. That explains why I could see a value of 4 on the SPI trace (17 >> 2).
After setting the LCD_CONTRAST_MAX to 255 and the DEFAULT_LCD_CONTRAST to 156 (value of 0x27 used for the contrast in the initialization sequence, left shifted two times) the display works as expected.
For fun I also had a look at the SPI trace of the Melzi board. There were no re-init commands of the contrast sent. Turns out that on Marlin 1.1.x the MINIPANEL didn´t have the define HAS_LCD_CONTRAST, so the contrast was not set at all (except on init).
I will try to create a pull request in the next few days.
Steps to Reproduce
Expected behavior:
Screen should show the main menu after startup
Actual behavior:
Screen turned blank.
The text was updated successfully, but these errors were encountered: