SSD1351 module problems

Hi there,
I am a student of the University of Salerno. :raised_hands:t2: :sweat_smile:
I’m new to Zerynth (started a few days ago) and I tried out the SSD1351 module from the latest release (r2.5.0) on an ESP32 DevKitC connected to a 128x128 OLED display over SPI.

I tried to test it with one of the available examples, but there is something wrong.
Let me explain better: the display turns on and responds to some commands (off(), on(), set_contrast()), but:

  • the color representation is incorrect (e.g. instead of red gives me blue);
  • the text appears in reverse (mirror effect: right to left);
  • these problems I encountered with 96x96 resolution, while the maximum resolution supported by the display (128x128) creates others.

I attach a video of the functioning and the connections I made between MCU and display.
SSD1351_problems.zip (2.9 MB)

Thank you for your answer. :v:t2:

Hi @francescolonardo
Are you sure of the hardware connections? could you test with the continuity of the jumpers with an AVO meter?
Do you have these problems with both of the examples, the blinking image, and print on OLED display?

Thanks for the reply @karimhamdy1,
no, unfortunately I do not have an AVO meter available, but I check with another IDE to run some test code with the same connections and the display responds well (I attach a video about it).
arduinoIDE_test.zip (1.9 MB)

And yes, I tested both examples and the blinking image doesn’t even let me see the image (I tried with other images besides the zLogo).

I have a doubt anyway:
I tried to connect the VCC pin (of the display) to both: the 3v3 pin and a digital pin (and with the latter I passed in the constructor of the SSD1351 class the pin name (the ‘pwr’ pin));
why did I make different (better in the test with the 3v3)? The power supply is USB.

I’ll test the display drivers, hopefully soon, and I will tell you the updates.

Operating voltages have ranges, propably 3.3v is the nominal and 5v could be in the upper values of the range, I think the display could be burnt if it is kept above its norminal operating voltage.

I solved.

The problem was with the remapping, and especially this point:
     self._command(CMD_SETREMAP) # Segment remapping
     self._data(self._screen_width)
changing it to this:
     self._command(CMD_SETREMAP) # Segment remapping
     self._data(self._screen_width-1)
fixed things up.

I also add the methods:

  • invert()
    Sets the display in complementary mode.
  • normal()
    Sets the display in normal mode.

I attach the modified module.
ssd1351_MOD.zip (5.4 KB)

@francescolonardo
Great!, I will check it and let you know.
Thanks.

:thinking:
I stand corrected, the correct code is:
     self._data(0x74)
at the line 225.

I attach the updated module.
ssd1351_MOD1.zip (5.8 KB)

@karimhamdy1
Can I include some extended ASCII
characters in the available font (Tahoma Regular 7)?
And what if I wanted to use another font (like Roboto)?
Thanks for the feedback.

1 Like

Hi!!
I have the same problem regarding the font for SSD1306, the characters are printed very small.
Thanks for the feedback.

I think fonts are imported from the fonts.py file in the library directory ssd1351.
So I think you can add the fonts bitmap.
The font data could be taken from other libraries such as this:

Thanks, i have another question:
Once I import these fonts into the file, how do I tell the display to use that specific font?
Thanks.

add another font in fonts.py and in ssd1351.py in line 576 use the other font:
self._set_font(font=fonts.guiFont_Tahoma_7_Regular, font_color=0xFFFF, encode=False)

Let me know how it goes.

fonts.zip (1.8 KB)
From a tool, i convert “ABCab” in C language, and in this file i create a new variable (i delete the characters not used in Python)
In “ssd1306” I use self._set_font(font=fonts.guiFont_Tahoma_8_Regular…) but it’s the same.

Do you have any information on the format of font.py, especially the initial header? _set_font is looking for specific information at the beginning of the file and I’d like to know how that relates to the rest of the bit map.

I’ve used https://oleddisplay.squix.ch/#/home to generate bitmaps, and the headers are similar, but not identical. Any help would be appreciated.

Hello,
Thanks for making a library for the OLED displays, but giving us only one font and ZERO documentation detailing how to add more fonts is not okay. I understand Zerynth covers a lot of functionality, but we need more details so we can work with the libraries on our own. Some other users have asked how to add fonts and been given partial answers. Can you please thoroughly answer the questions, “How do I add a font to fonts.py? What is necessary to get the font to function on the display? What is the format the bitmap font needs to be in so that it will work?”
Thank you.

1 Like

Hi @TravisCarter

We are sorry that you are facing inconveniences with Zerynth OS.
We will take your feedback into consideration.

As for the fonts of SSD1351, Let us look into it and we will provide a detailed reply with how to add additional fonts as soon as possible.

Thanks.

Hello,
Do you have an example workflow for adding a font to fonts.py? I think that a walkthrough showing how to add just one font would allow the user community to quickly expand the library on our own. Please. I imagine this would be a quick and very helpful project for one of your experienced engineers.
Kindly,
Travis Carter

Hi All,
Updating this forum post for other members,
For the SSD1306/1351 fonts, We added 4 new fonts,now you have fonts with size 7,8,10,14,18

Kindly find attached the fonts.py file, replace this file in .zerynth2/dist/r2.6.0/libs/official/solomon/ssd1306
fonts.zip (9.9 KB)

and in ssd1306.py specify which font you want to use in draw_text() method. (untill we officially update the library with changeable fonts)

If you want to add more fonts, we are using the official HEXIWEAR GUI resources provided by MicroElectronika, add them as needed in your project.

1 Like

This is fantastic! Thank you for adding these fonts and providing the resource details! Zerynth support is responsive and I really appreciate you going above and beyond to assist us with the library. Now the displays are significantly more useful out of the box and we can expand the library on our own, too. =)

1 Like

Thanks Travis, Glad you’re satisfied with the support :slight_smile: