Welcome! Log In Create A New Profile

Advanced

SPI OLED on SKR 1.4/1.5 and Re-ARM LPC1768/9 based boards

SPI OLED on SKR 1.4/1.5 and Re-ARM LPC1768/9 based boards
December 09, 2020 12:36PM
How to get a working tiny SPI OLED 0.96", 1.3", 1.43" (and so on...) with a SKR 1.4 Turbo, and probably other unsupported boards.

I²C OLEDs cause a lot of issues with the SKR 1.4 and 1.5. It will be fixed, but until now there's no solution to the problems.

Meanwhile, why not go SPI ?

Warning : this is a quick and dirty support for SPI OLEDs. There will be no pull request : no conditionals is not acceptable from a dev point of view !



First, the wiring :

What well known controller does use a 128x64 SPI OLED ? The MKS 12864 ! [reprap.org]

We will follow this controller design and pinout (reprap discount like). It will be a starting point.

The embedded OLED is a 0.96" SSD1306.

Compatible OLEDs : SSD1306, SSD1309 (compatible with SSD1306) ; SH1106 should also work (not tested : I tested what I had by hand : the SSD1309).

The MKS 12864OLED is supported by Marlin for many boards but not for the ReARM LPC1768/9
In Marlin sources we find the pinout for the MKS Mini.

Now we can hook the SPI OLED to the board :

GND to GND
VDD : +3.3V (or +5V - 5V tolerant)
SCL to SCK (= DOGLCD_SCK in Marlin for MKS 12864 OLED)
SDA to MOSI (= DOGLCD_MOSI in Marlin for MKS 12864 OLED)
RES to LCD_PINS_RS (= DOGLCD_RS in Marlin for MKS 12864 OLED)
DC to LCD_PINS_D6 (= DOGLCD_D4 or A0 in Marlin for MKS 12864 OLED)
CS to LCD_PINS_D5 (= DOGLCD_CS in Marlin for MKS 12864 OLED)



In Configuration.h : search for "MKS_12864OLED"
Depending on the OLED, uncomment "MKS_12864OLED" for SH1106 or "MKS_12864OLED_SSD1306" for SSD1306/09

Some editing is needed : Marlin will not compile as is, as this controller is unsupported (for now).

Open /src/pins/lpc1768/pins_BTT_SKR_V1_4.h

Scroll down ; you will find a section that is not grayed out, with the definitions for (line #370 or so) :

- BTN_ENC
- LCD_PINS_RS
- BTN_EN1
- BTN_EN2
- LCD_PINS_ENABLE
- LCD_PINS_D4
- LCD_SDSS

Below this block, we will add the pins for our OLED :


// SPI OLED SSD1306 / SSD1309
    
    #define LCD_PINS_DC                    LCD_PINS_D4
    #define DOGGLCD_RS                     EXPA1_03_PIN
    #define DOGLCD_A0                      EXPA1_04_PIN
    #define DOGLCD_CS                      EXPA1_05_PIN
    #define DOGLCD_MOSI                    EXPA2_05_PIN
    #define DOGLCD_SCK                     EXPA2_09_PIN
    #define FORCE_SOFT_SPI                      // Use this if default of hardware SPI causes display problems

FORCE_SOFT_SPI seems to force software SPI. This #define appears in many files. Commenting them out evrywhere they are active will give a black display. So let them alone. I didn't invistigate further. The display and the GUI are responsive and don't need more muscle.

Compile.
Flash.

Time to enjoy your itsy bitsy teenie weenie SPIe yellow (or blue, or white) polka dotmatrix OLED !
Re: SPI OLED on SKR 1.4/1.5 and Re-ARM LPC1768/9 based boards
March 23, 2021 04:28PM
Is the lpc1768 p1_19 correct for the reset pin. Loooking at my pin map p1_19 is D5 servo2 it is a re-arm board i am taking the pins from.

Thanks Nikki
Re: SPI OLED on SKR 1.4/1.5 and Re-ARM LPC1768/9 based boards
March 29, 2021 05:55PM
On BTT SKR 1.4 and 1.5 boards, 1.19 is LCDRS (LCD reset).
Seems like your board does not have the same pin mapping... (I didn't verify all headers in Marlin/src/pins/lpc1768 : only Big Tree Tech SKR 1.4 and 1.5)
As you can see, I just used the pins for the Reprap Discount Full Graphics Display (SPI-like protocol, driven with SPI bus), on the
Re: SPI OLED on SKR 1.4/1.5 and Re-ARM LPC1768/9 based boards
September 01, 2021 10:52AM
Update :

I posted a FQ on Marlin Git. Hope Marlin will support the SPI SSD1306 with the SKR 1.4.

in pins_BTT_SKR_V1_4.h :



Edited 2 time(s). Last edit at 09/01/2021 10:54AM by yet-another-average-joe.
Attachments:
open | download - MOD_OLED.JPG (118.4 KB)
Re: SPI OLED on SKR 1.4/1.5 and Re-ARM LPC1768/9 based boards
August 30, 2023 02:57PM
Tnx for your tutorial yet-another-average-joe. Oled im using is 2.4", work perfectly with this tips. Only problem is that SD is not working. If i select sd(no media) in marlin, board reset itself. I tried to detach sd module, its same, board (skr 1.4t) reset if i choose sd card. I have enabled sdsupport and SDCARD_CONNECTION LCD. Any suggestion?

Edited 1 time(s). Last edit at 08/30/2023 02:59PM by mnikola2.
Sorry, only registered users may post in this forum.

Click here to login