Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 14 of 14

Thread: Teensy 3.2 with IIC 128x64 OLED Module

  1. #1
    Junior Member
    Join Date
    Dec 2015
    Posts
    13

    Teensy 3.2 with IIC 128x64 OLED Module

    Hello,

    I try to use an I2C 128x64 Oled display with the Teensy 3.2
    http://www.robotshop.com/en/iic-128-...dule-blue.html

    It works perfectly with an Arduino Nano but the same code with a Teensy 3.2 gives a black sceen
    Do I need to change the code from Nano to Teensy?

    Any idea what is wrong?
    Thank you for your help.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Is the nano powered with 3.3V, too ?
    Do you have the needed pullup-resitors to the I2C lines attached ?

  3. #3
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    No, as I read in the spec, the operating voltage for the screen is 3.3-5v.
    You suggest to place a resistor on SCL and SDA to the 3.3v pin of the Teensy? What value? 10k?
    Thanks!

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Yes, the teensy needs the external pullups for I2C. I'd use 3k3.

  5. #5
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    Thank you for your help, I try that ASAP

  6. #6
    Junior Member
    Join Date
    Oct 2017
    Posts
    8
    I briefly tried a couple packages with all the bells and whistles, like u8g2 https://github.com/olikraus/u8g2/ which is not Teensy friendly
    Or SSD_13XX https://github.com/sumotoy/SSD_13XX which may be the hot solution for Teensys, but doesn't handle the cheapest with SSD1306 drivers (due to lack of buffers

    One simple one with limited features that big bangs the I2C worked on first try with the under $3, 2 control wire (no reset) displays one finds on Ebay.
    It's evilOLED https://github.com/evilnick/evilOLED

    Just spotted this promising library: "Enhanced I2C library for Teensy 3.x devices "
    https://github.com/nox771/i2c_t3

    Here's the examples I just got from China, getting a few other things spreads out the big $1.85 shipping fee
    http://www.ebay.com/itm/0-96-I2C-IIC...-/311953510285
    Last edited by jake123; 10-23-2017 at 05:35 AM.

  7. #7
    Junior Member
    Join Date
    Oct 2017
    Posts
    8
    I believe the OLEDs all operate at 3.3V (Adafruit says they re all 3.3 interface safe) you can spot the little 3 lead voltage regulator chip coming off the VCC pin that drops the 5V input to 3.3. My test with bitbanged I2C was successful without pullup resistors.

    I noticed a post elsewhere that declared:
    real pullup resistors for SDA and SCL are required when using Teensy 3.x or Teensy-LC.
    Last edited by jake123; 10-23-2017 at 05:31 AM.

  8. #8
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    Does not work with pullups neither... Same code work on Arduino nano).

    Question: I've found a movie with a Teensy running without pullups...
    https://www.youtube.com/watch?v=qLCPHe3Ytko

  9. #9
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    Any clue to solve this problem? Is it possible to drive this oled display with a teensy?
    Thx

  10. #10
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,153
    Sometimes, I2C works without extra pull-ups but only if the target device (the display) has integrated pull-up resistors. You should look that information up in the display’s data sheet.

    If code works on the Nano, but not with the Teensy, it might be a pin problem, but I think you made sure to use the correct pins, or a speed problem - the Teensy is incredibly faster. Which I2C data rate did you select on the Nano and which one on the Teensy?

  11. #11
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    I use this setup for both
    Code:
    U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST);  // Fast I2C / TWI

  12. #12
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,153
    You see, the problem is most probably the U8G_I2C_OPT_FAST #define. I guess it resolves much faster on the Teensy (and thus too fast for the OLED) as on the Nano. I’ll have a look into the library’s code if you tell which one of the above listed you are finally trying.

    Since the Oli Kraus library uses U8g2() as constructor, it can’t already be that one....
    Last edited by Theremingenieur; 12-18-2017 at 10:30 PM.

  13. #13
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    Indeed I am using U8glib. I have tried all samples from the library: no problem with the nano and no result with the teensy.
    You're right, the initialization of the library is probably different. I have to dig that way.
    Thanks

  14. #14
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    Update: work perfectly with pullup, U8g2lib and U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •