Adafruit SSD1351 library and ESP8266 [SOLVED]

I want to use the Adafruit SSD1351 library with an ESP8266.

I have tried the example 'test' that comes with the library on a Nano Every and it works fine.

I have tried it on a D1 Mini but, although it compiles and uploads without error, I get nothing on the display. I have checked all the pins on the D1 mini with an oscilloscope and there is no activity on any pin that looks remotely like the activity I get with SPI on the Nano Every. Mostly there is no activity at all.

I also tried Alexey Dynda's SSD1351 demo on the D1 Mini, that works fine.

My questions are:
Should the Adafruit library work on an ESP8266 or am I wasting my time trying?
If it should work then advice from anyone who has made it work would be appreciated, in particular is there anything special I need to do? Additional libraries? Changes to the standard code?
If it is not supposed to work then recommendations for a library that does; while Alexey Dynda's library works it seems a bit limited in it's capability.

Thanks.

It should work fine. I don't have a D1 mini but I do have a D1 R1 (the Uno format board)

Just like any other ESP8266 sketch, you should use the Dn symbols when specifying arguments in constructors, functions, ...

Of course you must specify the correct board in the IDE too.

I just ran test.ino on my D1 R1 board:

// You can use any (4 or) 5 pins 
#define SCLK_PIN D13 //2
#define MOSI_PIN D11 //3
#define DC_PIN   D9 //4
#define CS_PIN   D10 //5
#define RST_PIN  D8 //6

I could have used the GPIOn numbers:

// You can use any (4 or) 5 pins 
#define SCLK_PIN 14 //D13 //2
#define MOSI_PIN 13 //D11 //3
#define DC_PIN   2 //D9 //4
#define CS_PIN   15 //D10 //5
#define RST_PIN  0 //D8 //6

Obviously, I have quoted my wiring. You should use the correct defines for your wiring.

David.

Edit. Oops, since this is using the SW SPI constructor, you can use any GPIO pins that take your fancy.

It would be wise to use the HW SPI constructor since I am actually using HW SPI pins

    // 5-6 args using hardware SPI (must specify peripheral) (reset optional)
    Adafruit_SSD1351(uint16_t width, uint16_t height,
      SPIClass *spi, int8_t cs_pin, int8_t dc_pin, int8_t rst_pin = -1);

so I would use the altnative constructor in test.ino:

Adafruit_SSD1351 tft = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, CS_PIN, DC_PIN, RST_PIN);

Thank you David, I was hoping you would reply.

++Karma; // That works.

For the benefit of anyone else reading this both the hardware and software constructors worked, but obviously the hardware constructor should be preferred. I used the GPIO pin numbers as per David's example:

#define SCLK_PIN 14 //D13 //2
#define MOSI_PIN 13 //D11 //3
#define DC_PIN   2 //D9 //4
#define CS_PIN   15 //D10 //5
#define RST_PIN  0 //D8 //6

The particular OLED I am using is this one:

Also, you might need to know that the Adafruit library needs the Arduino IDE to be at version 1.8.10 or higher to work properly and you might need to install the Adafruit BusIO library.

I also found that the regulator on the D1 Mini is not really up to powering the display at 3V3, I had to use an eternal 3V3 supply to get it working properly.

No, I have not used the Waveshare module.

But as a general rule: never omit the RST argument.

Adafruit modules have an external pullup on RST pin.
Most Chinese modules do not have pullups on the RST pin.

Some Adafruit examples omit the RST argument. This is fine for Adafruit displays.
And it guarantees Chinese modules fail.

David.

This topic was automatically closed after 120 days. New replies are no longer allowed.