Tensy 2.0 & OLED SPI 0.91 can't get any screen output

Bilo2024

Member
Hello dear teensy community,

unfortunately I can't get an image on my OLED display 0.91 SPI with the test code attempt from adafruit ssd1306. It should be connected to a Teensy 2.0 short version. I currently have it connected like this: gnd to gnd, vcc to vcc, clk to pin1, Mosi to pin 2, dc to pin 4 and cs to pin 0. Can someone confirm that the wiring is correct. I reconfigured the pin configuration from the test code for my purposes but I don't get a picture. Does anyone have an idea?

Regards
 
Can you provide a photo of this display module. Are you missing Reset pin, Backlight voltage pin?
 
Can you provide a photo of this display module. Are you missing Reset pin, Backlight voltage pin?
Sure in Attachments i put picture of Display from front and back. And pictures from teensy2.0

reset pin does not necessarily have to be connected
 

Attachments

  • IMG_20250207_131911.jpg
    IMG_20250207_131911.jpg
    108.4 KB · Views: 18
  • IMG_20250207_132244.jpg
    IMG_20250207_132244.jpg
    189.3 KB · Views: 20
It appears you did not connect Reset to Teensy GPIO pin.

This Teensy is 5V. Is your display 5V compatible?
 
It appears you did not connect Reset to Teensy GPIO pin.

This Teensy is 5V. Is your display 5V compatible?
According to the manufacturer's description, this display can be operated with both 3.3 and 5 volts. The reset pin can be omitted; this is only necessary if the display freezes during operation. So it should also work without a reset pin.
 
The display can be powered from 5V because it has a voltage regulator to drop 5V down to 3.3V which is needed to power SSD1306. The processor interface, in this case SPI, can only drive 3.3V as a logic HIGH into SSD1306 or else you'll damage the chip. Teensy 2.0 drives 5V unless modified for 3.3V operation (also means slowed down to 8MHz cpu clock).

You need to have voltage level shifters to interface with this display.

And, if you don't connect Reset pin, then at the very least, tie Reset to logic HIGH as indicated in chip datasheet. AdaFruit driver is likely toggling Reset to get SSD1306 into a known state. You should hook this up to Teensy (with logic level shifted to 3.3V along with other interface signals).
 
The display can be powered from 5V because it has a voltage regulator to drop 5V down to 3.3V which is needed to power SSD1306. The processor interface, in this case SPI, can only drive 3.3V as a logic HIGH into SSD1306 or else you'll damage the chip. Teensy 2.0 drives 5V unless modified for 3.3V operation (also means slowed down to 8MHz cpu clock).

You need to have voltage level shifters to interface with this display.

And, if you don't connect Reset pin, then at the very least, tie Reset to logic HIGH as indicated in chip datasheet. AdaFruit driver is likely toggling Reset to get SSD1306 into a known state. You should hook this up to Teensy (with logic level shifted to 3.3V along with other interface signals).
Why do I need a voltage logic shifter if the display already has a voltage regulator implemented in the form of a resistor?

Where should the reset pin be on Teensy2.0 pin0 or pin3?
 
Can you attach the display schematic?
A pair of resistors can act as a voltage divider. Does the display have this for each of the SPI signals?

Reset signal can go to any spare GPIO pin.
 
Can you attach the display schematic?
A pair of resistors can act as a voltage divider. Does the display have this for each of the SPI signals?

Reset signal can go to any spare GPIO pin.
Sure in the attachment i put the schematic
 

Attachments

  • IMG_20250207_200625.jpg
    IMG_20250207_200625.jpg
    116.8 KB · Views: 16
Sorry the second one in this attachment suites more to my Display.
 

Attachments

  • IMG_20250207_201327.jpg
    IMG_20250207_201327.jpg
    89.2 KB · Views: 13
Where should the reset pin be on Teensy2.0 pin0 or pin3?

Depends on which library you're using, and for libraries like most of Adafruit's, can also depend on how your program creates the instance. Many of those libraries can use any digital pin, where you just tell it which pin. But again, this depends on which library and exactly how your program uses that library. Can you understand how we're unable to answer your questions asking for specific help when we don't know enough information about what software you're using?
 
Depends on which library you're using, and for libraries like most of Adafruit's, can also depend on how your program creates the instance. Many of those libraries can use any digital pin, where you just tell it which pin. But again, this depends on which library and exactly how your program uses that library. Can you understand how we're unable to answer your questions asking for specific help when we don't know enough information about what software you're using?
Hello Paul, thanks for answer.
I tried to operate it with the adafruit ssd1306 in Arduino IDE and the associated gfx library. I used the corresponding standard example of code for SPI 128x32 OLED Display from Adafruit 1306. My pins were configured for it, compiled and transferred without errors, but there was no text output at all. After then I checked all the connections again with the multimeter. There was no short circuit and I was able to verify that the connections were correct with the multimeter
 
Last edited:
I'm looking at that library's ssd1306_128x32_spi example. It says software SPI is the default.

Code:
// Declaration for SSD1306 display connected using software SPI (default case):
#define OLED_MOSI   9
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 13
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

Perhaps you should try these connections?

Remember, all the signals need to be reduced from 5V level to only 3.3V level.
 
I'm looking at that library's ssd1306_128x32_spi example. It says software SPI is the default.

Code:
// Declaration for SSD1306 display connected using software SPI (default case):
#define OLED_MOSI   9
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 13
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

Perhaps you should try these connections?

Remember, all the signals need to be reduced from 5V level to only 3.3V level.
A resistor is already implemented in my OLED display, which reduces the voltage from 5 volts to 3.3 volts. I also use a Teensy 2.0 short version there is a Mosi connection according to the data sheet at pin 2 and a serial connection according to the data sheet from pin0 to pin4. I also only have to use these because my teensy sits on a specially manufactured board which taps pin0 to pin 4, a total of 5 connections for the screen when adding GND and VCC we have total Pin Layout 7 for spi
 
Last edited:
Please remember we can't see your custom PCB over the internet, unless you show us. We can't see this unusual display which incorporates "A resistor is already implemented in my OLED display, which reduces the voltage from 5 volts to 3.3 volts". The photo in msg #3 seems to have only 1 resistor. The schematic in msg #10, which looks like it's probably the display, doesn't seem to have such voltage reducing circuitry for the data signals. I do see a buffer chip, not resistors, in msg #9, but how this really connects to everything isn't clear (at least to me).

Best I can say is it really ought to work if you just run Adafruit's default Software SPI with the pins connected through level reducing circuitry like a buffer chip or resistor dividers of low enough impedance to handle the signal speed.

But you've said it's not working. That's really unfortunate. Much as I want to help you, I really can't offer any specific advice when I'm so in the dark about how everything. If you want to keep asking for help, please at the very least shoot several photos to really show exactly how you have connected everything. All the info you've given so far is at best confusing. Maybe someone can make some sense of all this, but without photos and very clear info, I can not.
 
Thanks for posting the schematics images.
It's clear the schematic in msg#10 represents your LCD module shown in msg#3.
Component U2 would be a 5V to 3.3V voltage regulator. This is the voltage source for SSD1306 chip.
And, this LCD module requires external logic level voltage conversion such that logic levels are limited to 3.3V.

The schematic in msg#9 is a good illustration of how to add external logic level voltage conversion. This would work with your display module.
 
Thanks for posting the schematics images.
It's clear the schematic in msg#10 represents your LCD module shown in msg#3.
Component U2 would be a 5V to 3.3V voltage regulator. This is the voltage source for SSD1306 chip.
And, this LCD module requires external logic level voltage conversion such that logic levels are limited to 3.3V.

The schematic in msg#9 is a good illustration of how to add external logic level voltage conversion. This would work with your display module.
I understand it better now, I have grilled my display, since I have all the pins directly on Teensy2.0, I have to see a txb0104 image for every single pin, which could be the solution of course with a new display
 

Attachments

  • Screenshot_2025-02-08-12-09-44-548_com.amazon.mShop.android.shopping-edit.jpg
    Screenshot_2025-02-08-12-09-44-548_com.amazon.mShop.android.shopping-edit.jpg
    739.3 KB · Views: 14
Good to hear you have a better understanding of the display interface.
The convertor you found should work. Teensy has the GPIO output drive current needed for this device.
I've used the 74HC4050 and CD4050B for logic level conversion (and other chips like 74LVC245).

Good luck with your project.
 
Back
Top