<h3>Question History</h3>
<p>An <a href="/a/8260/">answer</a> on your <a href="https://3dprinting.stackexchange.com/q/8256/8884">previous question</a> 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 <a href="/a/8260/">answer</a> does not work for recent versions of Marlin source code!</p>
<h3>Answer</h3>
<p>Yes, your observation of the <a href="https://github.com/Voxel8/Marlin/blob/master/Marlin/dogm_lcd_implementation.h" rel="nofollow noreferrer"><code>dogm_lcd_implementation.h</code></a> 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 <a href="https://github.com/MarlinFirmware/Marlin/blob/bugfix-1.1.x/Marlin/ultralcd_impl_DOGM.h" rel="nofollow noreferrer"><code>ultralcd_impl_DOGM.h</code></a>. There are some older versions of the file wondering over internet, e.g. <a href="https://download.lulzbot.com/KITTAZ/software/2014Q4/firmware/Marlin/dogm_lcd_implementation.h" rel="nofollow noreferrer">here</a> or <a href="https://github.com/Voxel8/Marlin/blob/master/Marlin/dogm_lcd_implementation.h" rel="nofollow noreferrer">from this older Marlin cloned repository</a>.</p>
<p>I believe that your 2<sup>nd</sup> patch:</p>
<pre>
/*---------------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-----------------------*/
</pre>
<p>should be placed in <a href="https://github.com/MarlinFirmware/Marlin/blob/bugfix-1.1.x/Marlin/ultralcd_impl_DOGM.h" rel="nofollow noreferrer"><code>ultralcd_impl_DOGM.h</code></a> just under:</p>
<pre>
#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
</pre>
<p>and before:</p>
<pre>
#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
</pre>
<p>to create:</p>
<pre>
#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
</pre>
<p>Do note that there <strong>already exists</strong> an entry for <code>U8GLIB_SSD1306</code>! This has to be deleted, or you need to put the code in that section (un-commenting existing code)!</p>
<p>E.g.</p>
<pre>
#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
</pre>
<p>could be altered to:</p>
<pre>
#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);
</pre>

CC BY-SA 4.0
2019-02-16T17:36:43.873Z
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?
2012User
CC BY-SA 4.0
2019-02-16T17:43:59.237Z
with your new instruction for patch 2, I get this error:   #error "Please select no more than one LCD controller option."
2012User
CC BY-SA 4.0
2019-02-16T17:52:40.807Z
@2012User That could imply that you have another LCD controller enabled in your configuration file.
0scar
CC BY-SA 4.0
2019-02-16T18:09:01.263Z
I've uncommented every line in "lcd/controller selection" part of configuration.h!
2012User
CC BY-SA 4.0
2019-02-14T08:28:45.887Z
2019-05-08T19:19:56.033Z
2020-06-18T08:29:41.667Z
0scar
<p>I'm trying to install a MKS 12864 0.96 OLED for my DIY 3D printer (see <a href="/q/8256">this other question</a>). </p>

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

<p>Where is it? How can I install my LCD module?</p>

<marlin><diy-3d-printer><firmware><full-graphic-smart-controller>
Connecting OLED 128x64 LCD; dogm_lcd_implementation.h is missing for patching
2012User
# Connecting OLED 128x64 LCD; dogm_lcd_implementation.h is missing for patching

(Asked by: username_0 on 2019-02-14)

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

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?

**Tags:** marlin, diy-3d-printer, firmware, full-graphic-smart-controller

---

## 1 answers

### Answer by username_1 on 2019-02-14. Score: 4

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);

> **Comments:**
> **username_0**: 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?  
> **username_0**: with your new instruction for patch 2, I get this error:   #error "Please select no more than one LCD controller option."  
> **username_1**: @2012User That could imply that you have another LCD controller enabled in your configuration file.  
> **username_0**: I've uncommented every line in "lcd/controller selection" part of configuration.h!  

---

