4 wire SPI OLED display not working with BLE33

I have connected a SSD1351 Waveshare 1.5” OLED display (
https://www.waveshare.com/wiki/1.5inch_RGB_OLED_Module
) to a BLE 33 with the following connections:

DIN to D11(pin14)
CLK to D13 (pin 16)
CS to D10 (pin 13)
DC to D7 (pin 10)
RST to D8 (pin 11)

I've connected the OLED to a regulated 5V source.

This is my sketch based on the “test” example from the Arduino Examples for the Adafruit SSD1351 library:

// Screen dimensions for 1.5" x 1.5" display
#define SCREEN_WIDTH  128
#define SCREEN_HEIGHT 128 

// Pin definitions
#define CS_PIN   13
#define DC_PIN   10
#define RST_PIN  11

// Colour definitions
#define  BLACK          0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0  
#define WHITE           0xFFFF

// Libraries
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
#include <SPI.h>

// Create SSD1351 object
Adafruit_SSD1351 tft = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, CS_PIN, DC_PIN, RST_PIN);

void setup(void) {
  tft.begin();
}

void loop() {
  tft.fillScreen(BLACK);
  delay(1000);

  lcdTestPattern();
  delay(1000); 
}

void lcdTestPattern(void)
{
  static const uint16_t PROGMEM colors[] =
    { RED, YELLOW, GREEN, CYAN, BLUE, MAGENTA, BLACK, WHITE };

  for(uint8_t c=0; c<8; c++) {
    tft.fillRect(0, tft.height() * c / 8, tft.width(), tft.height() / 8,
      pgm_read_word(&colors[c]));
  }
}

I expected to see coloured rectangles on the screen. I have tried drawing circles, rectangles etc. and just making the screen a solid colour. However, the result is always the same with random coloured pixels and a greenish (I have a degree of colour blindness


) band across a portion of the screen. An image is attached.

I’ve checked all my wiring and pin definitions in the sketch many times and can’t find the answer on the Internet including this forum. Any suggestions would be appreciated.

Is GND of the OLED also connected to the GND of the Arduino?

Also the BLE33 is a 3.3v logic level device.

Did you see this note in the link you posted...

Arduino constructors expect the Digital# pin number. Not the physical pin number on your particular pcb. e.g.

// Pin definitions
#define CS_PIN   10  //digital#10 D10
#define DC_PIN   7   //digital#7  D7
#define RST_PIN  8   //digital#8  D8

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

Incidentally your BLE33 has a VUSB solder-bridge on the bottom of the pcb.
You need to solder the bridge to make the 5V pin work on the pcb.

Then you can connect the display VCC pin to your BLE33 5V pin. i.e. power everything from USB cable.
The BLE33 has 3V logic. That is absolutely fine for your display.

I would avoid using a separate regulated 5V source. It is much safer to use the same power for BLE33 and display.

David.

Thank you all for the suggestions. Despite being a beginner, I should have picked-up on the note about keeping the power and voltage levels the same. In any case, I've tried the suggestions with no effect.

I've attached a picture of the wiring diagrams for the two voltage configurations that were suggested.

Also, I have two BLE 33s and have tried the oled display with both with the same result.

As a beginner, and only having a multi-meter, how might I go about debugging this problem?

Also, I was thinking if there was a setting inside of the library .cpp files that might need to be set. I've had a look but it's all too complicated for me to understand.

I installed Adafruit_SSD1351 via the IDE Library Manager.

And edited the library example "test.ino" to suit my particular wiring

// You can use any (4 or) 5 pins 
#define SCLK_PIN 13 //2
#define MOSI_PIN 11 //3
#define DC_PIN   9  //4
#define CS_PIN   10 //5
#define RST_PIN  8  //6

Built and ran on my BLE33 board with a Chinese clone SSD1351 board.
The example worked fine (as bit-banged SW SPI)

So I then changed to the HW SPI constructor (Option 2).

// Option 1: use any pins but a little slower
//Adafruit_SSD1351 tft = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, CS_PIN, DC_PIN, MOSI_PIN, SCLK_PIN, RST_PIN);  

// Option 2: must use the hardware SPI pins 
// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be 
// an output. This is much faster - also required if you want
// to use the microSD card (see the image drawing example)
Adafruit_SSD1351 tft = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, CS_PIN, DC_PIN, RST_PIN);

which also worked.

David.

Edit. The only difference between my wiring and your wiring is DC on D9 instead of D7.

I copy-pasted your sketch from #1.
Edited to suit my wiring.

// Pin definitions
#define CS_PIN   10
#define DC_PIN   9
#define RST_PIN  8

and that works fine too.

Just get Adafruit_SSD1351 working first. I will show you how to make it run at a sensible speed on the BLE33.

It is possible that the display and/or the Arduino have been permanently damaged by the voltage mismatch.

If you upload the Blink program, does that work?

Does the display show any signs of life when powered by 3.3V?

Yes, fortunately the Blink program works fine. When running with 3.3v attached to the display, the display shows the same pattern as in my original photo.

Yes, thank. The GND of the OLED and the GND of the Arduino are connected together. VCC on the display is attached to the 3.3V output on the BLE 33. I am assuming that this takes care any possible problems with logic levels between the display and BLE 33.

The Waveshare appears to have an AMS1117-3.3 voltage regulator chip. (top right of pcb in the Wiki)

So you can safely supply 5V to VCC pin. The regulator ensures that the SSD1351 runs at 3.3V.

Your BLE33 has 3.3V logic. So this is correct for the SSD1351.
I disagree with the Waveshare Wiki regarding 5V logic "Uno plus" board connections.
From the datasheet the logic signals must be <= 4.0V

image

Oh, I am guessing about the AMS1117 chip. Please can you read the part number.
And the display will actually "work" with VCC pin =3.3V because AMS1117 are "Low Drop Out" regulators.

David.

David,

Thank you for all your input.

I shorted out the Vusb and connected the oled to the 5v pin on the BLE 33. I get the same result as when connected to the 3.3v pin on the BLE 33. Note: the GNDs of the BLE 33 and oled are connected together.

I've attached a photo of the back of the oled. The only part number I can see is the one on the lower left of the photo on the ribbon cable going to the display. If this is the one that you mentioned please let me know because it will take a little for me to read the number since I'll have to dig up a magnifying glass somewhere.

I see that you mentioned bit-banging. I looked it up and get the idea. i found a sample for an Arduino so will try to get that to work so I can determine if the oled is damaged.

Also, I did try the first constructor in the "test.ino" sketch but it did not work at all. The oled was just blank.

James

David,

The sample bit banging program that I found is too difficult for me at this stage of my learning.

Do you know of a very simple example that I can download that would allow me to simply write values to the oled memory locations through the 4 wire SPI ? I think that is how the oleds basically work. Is that a useful route to try?

Please read the part number printed on the black chip with 5 legs. (at top right of your photo)

You will need a good light and magnifying glass. The printing on integrated circuit chips is difficult to read.

Please post a photo of the coloured wires connected to the BLE33 board.
We can examine the quality of the header pin soldering. And check the wire placement.

David.

My apologies. I discovered that there was a link to the schematic in your Waveshare Wiki. This clearly shows the 3.3V regulator. It is RT9193-33 (which is an AMS1117-33 equivalent)
image

Unless you have let the smoke out I would expect your OLED to work just fine.

Oh, my SSD1351 module is identical to this one https://www.aliexpress.com/item/4000380926640.html
i.e. very similar to your Waveshare model.

Thank you very much for digging that out. I did manage to read the printing on the chip, OE=AID.

I've attached three pictures. Two showing the wiring and one that I tried to get of the solder joints. The solder joint picture is not too good unfortunately but the best that I could do with my phone.



Your wiring looks correct. Your soldering looks ok.

I have never seen Duponts with angle male ends.
I suggest that you use "long" male header strip which will sit in the breadboard securely. These can receive your female wires.

Alternatively, mate your existing wires with the angle pins and secure with sticky tape, bluetack or hot glue. So you have reliable contacts.

Personally, I don't like flying wires. I solder male or female header strip to Protoshields. Solder the connections between strip, sockets, components, ...

For example. I just plug my SSD1351 module into a socket on a Protoshield. (which is why my wiring is different to yours)

That makes no sense to me. Perhaps it is a different part number for another AMS1117 equivalent.

David.

Pliers.

The wires from the display had female ends. I took the pins from a right angle header.

I've ordered a second identical display scheduled for delivery on Saturday (2 July 2022). I'll report back on Sunday.

In the meantime, I'll imrove the connections and post a photo and results.

I checked the Internet for any reference to the characters that I read off the chip. No luck.

I received my second Waveshare 1.5" colour oled display https://www.waveshare.com/wiki/1.5inch_OLED_Module.

I've tried it with both of my BLE 33s with the same result (see attached photo).

I was using soldered connections this time (see two attached photos).

I checked the continuity between the solder joints on the display and the BLE 33 and they are fine.

I did run a Blinky program and it works fine.

I've checked that I've used the correct pins on the BLE 33 and they are right and match the sketch.

The sketch is attached (again) along with the wiring diagram.

// Screen dimensions for 1.5" x 1.5" display
#define SCREEN_WIDTH  128
#define SCREEN_HEIGHT 128 

// Pin definitions
#define CS_PIN   13
#define DC_PIN   10
#define RST_PIN  11

// Colour definitions
#define BLACK           0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0  
#define WHITE           0xFFFF

// Libraries
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
#include <SPI.h>

// Create SSD1351 object
Adafruit_SSD1351 tft = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, CS_PIN, DC_PIN, RST_PIN);

void setup(void) {
  tft.begin();
}

void loop() {
  tft.fillScreen(BLACK);
  delay(1000);

  lcdTestPattern();
  delay(1000); 

}

void lcdTestPattern(void)
{
  static const uint16_t PROGMEM colors[] =
    { RED, YELLOW, GREEN, CYAN, BLUE, MAGENTA, BLACK, WHITE };

  for(uint8_t c=0; c<8; c++) {
    tft.fillRect(0, tft.height() * c / 8, tft.width(), tft.height() / 8,
      pgm_read_word(&colors[c]));
  }
}

The SD1351 library that I have installed is: Adafruit SSD1351 1351 Version 1.2.7.

I would be grateful for any suggestions on a way forward. I have a multimeter and might be able to borrow a logic analyzer.