4
$\begingroup$

I'm trying to install a MKS 12864 0.96 OLED for my DIY 3D printer (see this other question).

It's not listed in Marlin's LCD section of configuration.h and according to some instructions, I need to do some modification to a file named dogm_lcd_implementation.h which is missing in Marlin 1.1.9!

Where is it? How can I install my LCD module?

$\endgroup$
0

1 Answer 1

4
$\begingroup$

Question History

An answer on your previous question discusses patches for installing the LCD module in your Marlin printer firmware. Note that these patches are very old (around 2015). Many things have changed since then (as is acknowledged there). That answer does not work for recent versions of Marlin source code!

Answer

Yes, your observation of the dogm_lcd_implementation.h file being missing in the 1.1.9 version of Marlin is correct. But, I believe it is not lost, all code and further development can be found in ultralcd_impl_DOGM.h. There are some older versions of the file wondering over internet, e.g. here or from this older Marlin cloned repository.

I believe that your 2nd patch:

/*---------------MKS OLED patch_2-----------------------*/
#elif defined(U8GLIB_SSD1306)
U8GLIB_SSD1306_128X64 u8g(23, 17, 16, 25); // SW SPI Com: SCK = 23, MOSI = 17, CS = 16, A0 = 25
/*---------------MKS OLED patch_2-----------------------*/

should be placed in ultralcd_impl_DOGM.h just under:

#elif ENABLED(MINIPANEL)
  // The MINIPanel display
  //U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0);  // 8 stripes
  U8GLIB_MINI12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes

and before:

#else
  // for regular DOGM128 display with HW-SPI
  //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);  // HW-SPI Com: CS, A0  // 8 stripes
  U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0);  // HW-SPI Com: CS, A0 // 4 stripes
#endif

to create:

#elif ENABLED(MINIPANEL)
  // The MINIPanel display
  //U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0);  // 8 stripes
  U8GLIB_MINI12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes
#elif ENABLED(U8GLIB_SSD1306)
  // SW SPI Com: SCK = 23, MOSI = 17, CS = 16, A0 = 25
  U8GLIB_SSD1306_128X64 u8g(23, 17, 16, 25); 
#else
  // for regular DOGM128 display with HW-SPI
  //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);  // HW-SPI Com: CS, A0  // 8 stripes
  U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0);  // HW-SPI Com: CS, A0 // 4 stripes
#endif

Do note that there already exists an entry for U8GLIB_SSD1306! This has to be deleted, or you need to put the code in that section (un-commenting existing code)!

E.g.

#elif ENABLED(U8GLIB_SSD1306)
  // Generic support for SSD1306 OLED I2C LCDs
  //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

could be altered to:

#elif ENABLED(U8GLIB_SSD1306)
  // Generic support for SSD1306 OLED I2C LCDs
  //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
  // SW SPI Com: SCK = 23, MOSI = 17, CS = 16, A0 = 25
  U8GLIB_SSD1306_128X64 u8g(23, 17, 16, 25);
$\endgroup$
4
  • $\begingroup$ There are several lines in "ultralcd_impl_DOGM.h" where 'U8GLIB_SSD1306' is mentioned... Should I uncomment all of them or only your E.g? $\endgroup$
    – 2012User
    Feb 16, 2019 at 17:36
  • $\begingroup$ with your new instruction for patch 2, I get this error: #error "Please select no more than one LCD controller option." $\endgroup$
    – 2012User
    Feb 16, 2019 at 17:43
  • $\begingroup$ @2012User That could imply that you have another LCD controller enabled in your configuration file. $\endgroup$
    – 0scar
    Feb 16, 2019 at 17:52
  • $\begingroup$ I've uncommented every line in "lcd/controller selection" part of configuration.h! $\endgroup$
    – 2012User
    Feb 16, 2019 at 18:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .