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

[1.1.x] Support some more LCD types #7824

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2076b54
add 2 displays
jmdearras Sep 13, 2017
37eb88e
"Standard" Display
jmdearras Sep 14, 2017
2756068
Edit CR10_stockdisplay NOPs
jmdearras Sep 14, 2017
dd72bfd
Added Displays cleanup
jmdearras Sep 21, 2017
4dd63f4
Added 2 line display
jmdearras Sep 21, 2017
075e393
More cleanup
jmdearras Sep 21, 2017
f44758c
The default board needs to be RAMPS_EFB
Roxy-3D Oct 2, 2017
2346eae
Working on merge issues
jmdearras Oct 5, 2017
b0e32c4
Merge branch 'Marlin-WIP' of https://github.com/jmdearras/Marlin-1 in…
jmdearras Oct 5, 2017
42e3c7a
more edits
jmdearras Oct 5, 2017
db378e3
more cleanup, per requests
jmdearras Oct 5, 2017
a26cad4
cleanup
jmdearras Oct 5, 2017
9f90e8a
Display name changes to match reprap
jmdearras Oct 5, 2017
a68d68a
sorry for the many commits
jmdearras Oct 5, 2017
96800ae
SanityCheck conflict fix
jmdearras Oct 5, 2017
2980dc5
sanitycheck.h
jmdearras Oct 5, 2017
f6cffaf
comment correction
jmdearras Oct 6, 2017
f77ff27
Remove WIP comments
jmdearras Oct 6, 2017
46c72c0
working on sanitycheck.h conflict
jmdearras Oct 6, 2017
068d805
another try to fix conflict
jmdearras Oct 6, 2017
4836971
fix pins-ramps indents and if then.
jmdearras Oct 6, 2017
5013e7d
removed ifndef statements
jmdearras Oct 6, 2017
122f5aa
removed comment
jmdearras Oct 6, 2017
c84c537
display selections cleanup
jmdearras Oct 6, 2017
ba55ef2
more display cleanup
jmdearras Oct 6, 2017
6a96b3a
reverting a revertion.
jmdearras Oct 6, 2017
9bc8c05
display description addition
jmdearras Oct 6, 2017
b8caa5e
Merge branch 'bugfix-1.1.x' into Marlin-WIP
thinkyhead Oct 6, 2017
faa1db8
MKS_12864OLED cleanup
jmdearras Oct 6, 2017
2b37c11
Merge branch 'Marlin-WIP' of https://github.com/jmdearras/Marlin-1 in…
jmdearras Oct 6, 2017
29e35d8
encoder stuff??
jmdearras Oct 7, 2017
77b78e1
update all
jmdearras Oct 9, 2017
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
32 changes: 30 additions & 2 deletions Marlin/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,29 @@
#define ULTIPANEL
#define NEWPANEL

#endif
#elif ENABLED(CR10_STOCKDISPLAY)

#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
#ifndef ST7920_DELAY_1
#define ST7920_DELAY_1 DELAY_2_NOP
#endif
#ifndef ST7920_DELAY_2
#define ST7920_DELAY_2 DELAY_2_NOP
#endif
#ifndef ST7920_DELAY_3
#define ST7920_DELAY_3 DELAY_2_NOP
#endif

#elif ENABLED (MKS_12864OLED)

#define U8GLIB_SH1106
#define REPRAP_DISCOUNT_SMART_CONTROLLER
#define NEWPANEL

#elif ENABLED(MKS_MINI_12864)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically, users reverse the connectors. This is not a problem isolated to MKS_MINI12864. See my comments in the discussion regarding this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a EE, it is incorrect to install them backwards, defeats the reason for the key. I believe it is a trick by the vendor to keep everything single sourced.

#define MINIPANEL
#endif


// Generic support for SSD1306 / SH1106 OLED based LCDs.
#if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
Expand All @@ -120,7 +142,13 @@
#define ULTIMAKERCONTROLLER
#endif

#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI)
#if ENABLED (MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
#define REPRAP_DISCOUNT_SMART_CONTROLLER
#define LCD_WIDTH 16
#define LCD_HEIGHT 2
#endif

#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI)
#define DOGLCD
#define U8GLIB_ST7920
#define REPRAP_DISCOUNT_SMART_CONTROLLER
Expand Down
31 changes: 31 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,37 @@
//
//#define OLED_PANEL_TINYBOY2

//
// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller
// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html
//
// 2 line display.
//
//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602

//
// MKS MINI12864 with graphic controller and SD support
// http://reprap.org/wiki/MKS_MINI_12864
//
Copy link
Contributor

@fiveangle fiveangle Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the one extra blank line here

//
//#define MKS_MINI_12864

//
// Factory display for Creality CR-10
// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html
//
// this is a a RAMPS-compaitible version, but with a single 10-pin connector instead of 2, for CR-10 owners who want to replace the Melzi Creality board, but retain the display
//
//#define CR10_STOCKDISPLAY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if I understand correctly. This is the option someone would select using the CR-10 display on a RAMPS-compatible board, and since the CR-10 sees it as a standard Melzi plus RRD Full Graphical Smart Display, this option may also be selected for this display in a CR-10 — since it just forces REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER to be enabled.

I think I have enough to work with from this PR to clean it up and merge it. I will follow up with a new PR soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


//
// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
// http://reprap.org/wiki/MKS_12864OLED
//
Copy link
Contributor

@fiveangle fiveangle Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

product link goes under description. no extra blank lines w/o reason

// Tiny, but very sharp OLED display
//
//#define MKS_12864OLED

//=============================================================================
//=============================== Extra Features ==============================
//=============================================================================
Expand Down
10 changes: 8 additions & 2 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13583,8 +13583,14 @@ void setup() {
pe_deactivate_magnet(1);
#endif
#endif
}

#if defined (MKS_12864OLED)
SET_OUTPUT(LCD_PINS_DC);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this is the only place this pin is used. Does this SET_OUTPUT do something special that the display needs, even though the pin is never used after this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was in the patch file for the display. I can remove it and see if it still works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pin coincides with DOGLCD_A0 — they are both assigned to pin 25. During init I guess this pin takes on a different role…?

SET_OUTPUT(LCD_PINS_RST);
WRITE(LCD_PINS_RST, LOW);
delay(1000);
WRITE(LCD_PINS_RST, HIGH);
Copy link
Member

@thinkyhead thinkyhead Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be a different pin from LCD_PINS_RS? Your PR is the only place this pin appears.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch file from MKS had it,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to the author of that patch? I can redirect some of these questions to them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented out that whole reset section and renamed the pin to LCD_PINS_RS in pins_ramps.h, and it does not seem to have affected the display, it still works. The code was copied from the OEM recommendation, probably for an earlier marlin release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an interesting piece. If it does no harm, I guess it can be left in. Anyway, off to figure out what's wrong with MKS_12864OLED.

#endif
}
/**
* The main Marlin program loop
*
Expand Down
10 changes: 7 additions & 3 deletions Marlin/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ static_assert(1 >= 0
* Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
* REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
* SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
* MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
* miniVIKI => ULTIMAKERCONTROLLER
* VIKI2 => ULTIMAKERCONTROLLER
* ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
Expand All @@ -1146,13 +1147,16 @@ static_assert(1 >= 0
static_assert(1 >= 0
#if ENABLED(ULTIMAKERCONTROLLER) \
&& DISABLED(SAV_3DGLCD) && DISABLED(miniVIKI) && DISABLED(VIKI2) \
&& DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) && DISABLED(PANEL_ONE)
&& DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) && DISABLED(PANEL_ONE) && DISABLED(MKS_12864OLED)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this cause a conflict?

Copy link
Contributor

@fiveangle fiveangle Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* Note: BQ_LCD_SMART_CONTROLLER => REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
 *       REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
 *       SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
 *       MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
 *       miniVIKI => ULTIMAKERCONTROLLER
 *       VIKI2 => ULTIMAKERCONTROLLER
 *       ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
 *       PANEL_ONE => ULTIMAKERCONTROLLER

Address the rest of the tidying up, if you're still struggling with this, I'll load this up and see if I can help,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I beleive I have addressed all but the example configs, waiting to see if my configuration.h passes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you looking at the site (and not just via email ?) I have comments submitted that don't appear to be addressed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, now.

+ 1
#endif
#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(LCD_FOR_MELZI)
#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(LCD_FOR_MELZI) && DISABLED(MKS_12864OLED)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the conflict. I do not see the problem.

+ 1
#endif
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)
#if ENABLED(MKS_12864OLED)
+ 1
#endif
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)
+ 1
#endif
#if ENABLED(LCD_FOR_MELZI)
Expand Down
64 changes: 56 additions & 8 deletions Marlin/pins_RAMPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
#define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
#endif

#if ENABLED(MKS_12864OLED)
#define LCD_PINS_D5 -1
#define LCD_PINS_D6 -1
#define LCD_PINS_RST 27
#define LCD_PINS_DC 25
#endif
//
// Augmentation for auto-assigning RAMPS plugs
//
Expand Down Expand Up @@ -258,6 +264,23 @@
#define LCD_PINS_D6 44
#define LCD_PINS_D7 64
#else
#if ENABLED(CR10_STOCKDISPLAY)
#define LCD_PINS_RS 27
#define LCD_PINS_ENABLE 29
#define LCD_PINS_D4 25
#define LCD_PINS_D5 -1
#define LCD_PINS_D6 -1
#define LCD_PINS_D7 -1
#if DISABLED(NEWPANEL)
#define BEEPER_PIN 37
// Buttons are attached to a shift register
// Not wired yet
//#define SHIFT_CLK 38
//#define SHIFT_LD 42
//#define SHIFT_OUT 40
//#define SHIFT_EN 17
#endif
#else
Copy link
Member

@thinkyhead thinkyhead Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No TABS — Indentation is two spaces. Please change your editor settings.

#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
Expand All @@ -273,6 +296,7 @@
//#define SHIFT_OUT 40
//#define SHIFT_EN 17
#endif
#endif
#endif

#if ENABLED(NEWPANEL)
Expand All @@ -281,10 +305,15 @@

#define BEEPER_PIN 37

#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35

#if ENABLED(CR10_STOCKDISPLAY)
#define BTN_EN1 17
#define BTN_EN2 23
#define BTN_ENC 35
#else
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35
#endif
#define SD_DETECT_PIN 49
#define KILL_PIN 41

Expand Down Expand Up @@ -354,10 +383,6 @@
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 44
#define DOGLCD_CS 66
#define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
#define SDSS 53

#define KILL_PIN 64
// GLCD features
//#define LCD_CONTRAST 190
// Uncomment screen orientation
Expand All @@ -369,6 +394,29 @@
#define BTN_EN2 63
#define BTN_ENC 59
// not connected to a pin
#define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
#define SDSS 53
#define KILL_PIN 64
#define SD_DETECT_PIN 49
#elif ENABLED(MKS_MINI_12864)
#define BEEPER_PIN 37
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 27
#define DOGLCD_CS 25
// GLCD features
//#define LCD_CONTRAST 190
// Uncomment screen orientation
//#define LCD_SCREEN_ROT_90
//#define LCD_SCREEN_ROT_180
//#define LCD_SCREEN_ROT_270
// The encoder and click button
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35
// not connected to a pin
#define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65
#define SDSS 53
#define KILL_PIN 64
#define SD_DETECT_PIN 49

#else
Expand Down
6 changes: 5 additions & 1 deletion Marlin/ultralcd_impl_DOGM.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,13 @@
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes
U8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes
#elif ENABLED(U8GLIB_SH1106)
#if ENABLED(MKS_12864OLED)
U8GLIB_SH1106_128X64 u8g(23, 17, 16, 25); // SW SPI Com: SCK = 23, MOSI = 17, CS = 16, A0 = 25
Copy link
Member

@thinkyhead thinkyhead Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's with the hard-coded pin numbers? According to these additions to the pins_RAMPS.h file, we end up with these pins:

    #if ENABLED(MKS_12864OLED)
      #define LCD_PINS_DC  25
      #define LCD_PINS_RST 27
    #else
      #define LCD_PINS_D5  25
      #define LCD_PINS_D6  27
    #endif

    #define LCD_PINS_RS    16
    #define LCD_PINS_ENABLE 17
    #define LCD_PINS_D4    23
    #define LCD_PINS_D7    29

So this line might be written instead as:

U8GLIB_SH1106_128X64 u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS, LCD_PINS_DC);

Was that your intention?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with your functions and macros. That was the OEM recommendation. If you show me the final code, I'll try it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i understand, now. I'll try it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that worked

#else
// Generic support for SH1106 OLED I2C LCDs
//U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes
U8GLIB_SH1106_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes
U8GLIB_SH1106_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes
#endif
#elif ENABLED(MINIPANEL)
// The MINIPanel display
//U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes
Expand Down