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?
Maybe it has 10K resistors? Found this schematic, but had to click a few links on Seeed's site, so not 100% sure if this is really the right schematic for that product.
I think it's this one - indeed there are 10k pullups on the 3v3 side. https://github.com/SeeedDocument/Gro...8x64_v0.9b.pdf
The "5V" side (3v3 from teensy on I2C) does not need to have pullups ? I learned something...
edit: err, no, there is a label "+5V".. did not see it.. so there are pullups to +5V
The Teensy LC is NOT 5V tolerant :-(
Can you load the BLINK-Sketch to test if it works ?
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
}
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.
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.
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:
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
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.