Teensy LC + I2C SSD1306 Oled + Xbee

Status
Not open for further replies.

Burnich

New member
Hi everybody,

First of all, I'm French and I apologize for my writing skill in English :rolleyes:

As writing in the title of this post, I want to use a teensy LC with an I2C SSD1306 OLED (128x64) and a Xbee using the Xbee PJRC shield. The idea is to make a remote to control a heater and some sensors.

I have received all that stuff last week and I started to play around ;)

In order to test the OLED and the Xbee with the shield I use a Buspirate and everything was fine.

So, I have installed the arduino IDE in version 1.6.5 and the Teensyduino extension in version 1.24. And I start some demo using I2C OLED library.

I tried to use different kind of library (Adafruit SSD1306 and U8glib) using "Wire" library, but they gave me the same result : a black screen... I tried to used the "i2c_t3" library instead but unfortunatly the result was the same.

I have used my Buspirate as spy and I discovered two kind of result :
1 - Using "Wire" library : start condition, device address on 7 bits, weird data (detect as new start condition by buspirate), stop conditon
2 - Using "i2c_t3" library : sometime start condition and always stop condition

To complete the investigation I have try to write my code based on the python script I used to drive the screen using the Buspirate (https://github.com/polarbeargarden/SSD1306-Bus-Pirate). I obtained the same result with each i2c library (Wire and i2c_t3) : black screen and weird transmission on the bus.

I have you some suggestions to help me ?

Here is the code I used in my last investigation

Code:
#include <i2c_t3.h>

#define qBlink() (digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) ))

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  qBlink();

  Wire.begin();
  delay(1000);
  Wire.beginTransmission(0x3C);
  Wire.write(0x00);
  Wire.write(0xAE);
  Wire.write(0xD5);
  Wire.write(0x80);
  Wire.write(0xA8);
  Wire.write(0x3F);
  Wire.write(0xD3);
  Wire.write(0x00);
  Wire.write(0x40);
  Wire.write(0x8D);
  Wire.write(0x14);
  Wire.write(0x20);
  Wire.write(0x00);
  Wire.write(0xA1);
  Wire.write(0xC8);
  Wire.write(0xDA);
  Wire.write(0x12);
  Wire.write(0x81);
  Wire.write(0xCF);
  Wire.write(0xD9);
  Wire.write(0xF1);
  Wire.write(0xDB);
  Wire.write(0x40);
  Wire.write(0xA4);
  Wire.write(0xA6);
  Wire.write(0xAF);
  Wire.endTransmission();
}

void loop() {
  qBlink();
  delay(1000);
}

Here is the result from the buspirate spy mode :
Capture d’écran 2015-08-27 à 23.24.55.png

P.S : I have 2 times 10kohms resistor in parallal on each i2c line and I used the 3v pin to supply the OLED screen.
 
Last edited:
One common problem on the Teensy with i2c is that you MUST add pull-up resistors between the i2c pins and 3.3v. Typically 4.7K resistors are used. It wasn't clear from your description of 10k resistors in parallel, whether you hooked the resistor to the power line (3.3v) or the ground line. If you hooked the resistor to the power line, you might want to try a 4.7K resistor instead of 10K. If you've hooked them to the ground line, please switch them to 3.3v (and then if that doesn't work switching to 4.7K or 2.7K resistors). I've seen some links that suggest using a 2.7K resistor is better for 3.3v, but the designer of the Teensy (Paul) has said in the past to use 4.7K resistors.

A second problem might be whether the particular OLED device that you have requires 5v instead of 3.3v. If that is the case, you will need to do level conversion on the i2c pins and feed it 5v. I suspect most OLEDs can work with both 3.3v and 5v, but there might be some that are 5v only.
 
Last edited:
I have the same problem. For me works perfectly with Arduino (at 5V or 3.3V module work with both), but I can't get it to work with Teensy LC. I tried with the pullup resistors, doesn't help. Display stays blank all the time.
Any new solutions here for this problem?
 
Bumping this. I too am trying to get a 128x64 (itead version) working.
SDA, SCL to pins 18,19, reset on 4, oled powered from Teensy (the display is 3.3V max input).
Using the SSD1306 library and setting the address to 0x3C or D I get nothing at all.
The itead wiki says "0x3C: D/C pin grounded; 0x3D: D/C pin connected to 3.3V" but neither works.
I don't get any sign of life from it. I have 5.7k pullups on SDA SCL (the closest values I had available).

400px-128_X_64_OLED_MODULE.jpg
 
Last edited:
Status
Not open for further replies.
Back
Top