seeed OLED library

Status
Not open for further replies.

DavidDC

Member
Hello,

I am a beginner trying to get this oled display work on a teensyLC :
http://wiki.seeedstudio.com/Grove-OLED_Display_0.96inch/
Grove-OLED-0.96.png

The SeeedOLED.h seems not to work, as the example programs won't work.
https://github.com/Seeed-Studio/OLED_Display_128X64

One curious thing is that it is not needed to declare the SCL SDA pins attached to the device.

Thank you for your ideas or advice!
 
If you tell us what exactly does not work...
Compiling? Hardware? It seems to be for the 5 V Arduinos..and has levelshifters..no I2C Pullups.How is it connected?
 
Thank you for your answer!
It is compiling fine, I added some code to print on serial and this works ok, only the OLED part doesn't work. Nothing is displayed.
I have put the voltage of the OLED on the "5V" pin, and powered the Teensy LC by usb
I haven't put any resistor, should I?
 
Arduinos have integrated pull-up resistors on the SCL and SDA lines. Teensys don't. You have to terminate the I2C bus externally.
 
Hello,
Here is the wiring :
Schematic01-SEEED OLED.jpg

And here is the code used :

#include <Wire.h>
#include <SeeedOLED.h>

void setup()
{
Wire.begin();
SeeedOled.init(); //initialze SEEED OLED display

SeeedOled.clearDisplay(); //clear the screen and set start position to top left corner
SeeedOled.setNormalDisplay(); //Set display to normal mode (i.e non-inverse mode)
SeeedOled.setPageMode(); //Set addressing mode to Page Mode
SeeedOled.setTextXY(0,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString("Hello World!"); //Print the String
}

void loop()
{
Serial.begin(9600);
Serial.println("Hello World");
delay(1000);
}

And the blink sketch works fine
 
Arduinos have integrated pull-up resistors on the SCL and SDA lines. Teensys don't. You have to terminate the I2C bus externally.

Could you tell me how to wire the termination of the i2C bus and the value of the resistance? Thank you !
 

Attachments

  • ds18b20-copia.jpg
    ds18b20-copia.jpg
    23.5 KB · Views: 62
You need 2 resistors, 1 from SDA to +3.3V and one from SCL to +3.3V. 3k3 for both would be a good starting point.

Lesson for advanced readers:
The optimal termination resistance of an I2C bus depends on the bus capacitance and inductance. If the bus capacitance and the termination resistor values are both high, the signal ramps (transitions from low to high or from high to low) might take too much time, lead to timing conflicts and increase the power dissipation in the I2C drivers. If the bus inductance is high, "ringing" might occur with too high or with too low termination. That means that voltage peaks even above the allowed voltages might theoretically occur and the ramp timing will be imprecise again, just to cite a few typical examples of what can go wrong.
The professional way of designing an optimal I2C bus termination is to build a prototype with an average resistor value (1kOhm/Volt) and with a wiring length, inductance, and capacitance similar to the planned PCB layout in mass production (thus taking parasitic copper stripe capacitances and inductances into account). Then to look at the SDA and SCL signals with an oscilloscope and modifying the resistor values until you observe the most clean waveforms with quick ramps but without ringing.
 
yes. the current is not high, it might survive that(??) but I don't know how to get that working - additional levelshifters? that would mean 3v-5v-3v.
 
yes. the current is not high, it might survive that(??) but I don't know how to get that working - additional levelshifters? that would mean 3v-5v-3v.

Best would be to drop that display as it is clearly designed for 5V Arduinos and look for a 3.3V compatible one (starting from 4$ on eBay...). Besides of that, the integrated level shifters on this display using series MOS transistors are incredibly slow and imprecise. If I'd be forced to stay with exactly that display, I'd unsolder R1 to R4 and Q3, Q4 and connect directly to LSDA and LSCL with 3.3k resistors towards 3.3V.
 
David, the last picture you have posted is OneWire bus, not I2C. Dont try to add more resistors to 5v.
 
You might try the Adafruit SSD1306 library that is included in the Teensy release:

You would need to edit the hardware/teensy/avr/libraries/Adafruit_SSD1306/Adafruit_SSD1306.h file to change the size of the display to 128x64:

Code:
   #define SSD1306_128_64
// #define SSD1306_128_32

I've not used the Seeed OLED display. The OLED displays I've used from Adafruit and Dig-ole both worked with 3.3v input. So you might try hooking it up to the 3.3v power and ground.

Run the Examples -> Wire -> Scanner program, and see if it finds the device. If it doesn't, then you need to investigate adding 2 separate pull-up resistors, one between SCL (19/A5) and 3.3v and the other between SDA (18/A4) and 3.3v. Typically you would want 2.2K resistors, but you could use the 4.7K resistors used in 5v systems (as I understand it, if you have the higher resistors, you might not be able to run the i2c bus at higher speeds, but the default speed should work).

If it doesn't work, you likely need to use level shifting up to 5v. For i2c, you want level shifting that goes both ways. Some level shifters to consider include:

Or alternatively get a display that works with 3.3v. An alternative connection technology is SPI. It uses different pinouts, but it doesn't need pull-up resistors:
 
Last edited:
I tryed all of the solutions proposed, it still doesn't work...
Either the display is damaged or not fitted for this puspose.
I will go for a proper oled display based on SSD1306

Thanks to you all!
 
For your information I tried to run the OLED_Display_128X64 on a spare teensy 2.0 and it works fine with the SeeedOLED.h librarie! And with no resistor added.
 
Status
Not open for further replies.
Back
Top