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

Thread: Teensy 3.6 with SSD1351 OLED

  1. #1

    Teensy 3.6 with SSD1351 OLED

    Hi,

    I'm having some problems getting my SSD1351 OLED and Teensy 3.6 connected on a breadboard. https://www.adafruit.com/product/1431

    Found a few forum posts connecting the display to a Teensy 3.1 but none of the example wirings worked for me. I'm not sure if the issue is bad wiring on the breadboard or misconfigured pinouts in code.
    I've been testing with the teensy_ssd1351 and Adafruit-SSD1351 libraries. With examples from both libraries the debug output prints but nothing is displayed on the oled.

    Can anyone share some advice on wiring the display up on a breadboard or what I can do to debug this?

    Thanks for any guidance!

    Click image for larger version. 

Name:	23023319_10155568377966609_1924258188_o.jpg 
Views:	240 
Size:	61.5 KB 
ID:	11913
    Click image for larger version. 

Name:	23107131_10155568377106609_494565322_o.jpg 
Views:	314 
Size:	93.8 KB 
ID:	11914

  2. #2
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,883
    Looking at the tutorial wiring you are supposed to have reset/chip select/DC on pins4/5/6. Your photo seems to have them out 32/33/34/ That can probably be made to work but you would need to update code to reflect that.

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,063

    Cool

    Quote Originally Posted by harleybussell View Post
    Hi,

    I'm having some problems getting my SSD1351 OLED and Teensy 3.6 connected on a breadboard. https://www.adafruit.com/product/1431

    Found a few forum posts connecting the display to a Teensy 3.1 but none of the example wirings worked for me. I'm not sure if the issue is bad wiring on the breadboard or misconfigured pinouts in code.
    I've been testing with the teensy_ssd1351 and Adafruit-SSD1351 libraries. With examples from both libraries the debug output prints but nothing is displayed on the oled.

    Can anyone share some advice on wiring the display up on a breadboard or what I can do to debug this?

    Thanks for any guidance!
    I've mostly been using the TFT 128x128 bit displays, but I have used the OLED displays in the past for the uncanny eyes (I hope to put up a blog post about it).

    Some points I recall:
    • Paul does not include the Adafruit-SSD1351 library in teensydunio, and the version from Adafruit does not have any special teensy optimizations (like the TFT displays do), so you don't have to worry about using the CS0 pins for OLEDCS and DC.
    • My OLED displays from Adafruit were VERY sensitive to the clock speed of the Teensy. I found I could not run uncanny eyes with the Adafruit displays at any clock speed above 24Mhz. When I was testing it with the 3.6, it was a shame to have to reduce the clock speed of the 3.6 down to 24Mhz. And note, any speed lower than 24Mhz will mean the Teensy can't use the USB serial line for printing debug messages. I also got 128x128 OLED displays that were made by New Haven, and those I could run at 48 Mhz. Others have posted in the Adafruit forums, that they could get their Adafruit displays running at 48 Mhz, but 96 Mhz and above seem too fast.
    • In addition to clock speed of the Teensy, you need to have short wires. You might want to get a set of 3" jumper wires, or possibly make your own custom wires (and/or solder the wires to the display). For breadboard use, I tend to prefer solid 22AWG wire, which are thick enough that they fit in the breadboard snuggly.
    • I have switched to using the TFT displays which can run at any Teensy clock speed. Note, the version in teensydunio does not support the 128x128 display, only the 128x64 and 128x32 displays. You need to use the version from Adafruit which doesn't have the latest teensy optimizations. The downside is TFT can only be seen from a much narrower angle of view, and the colors are more washed out. The TFT display I use is: https://www.adafruit.com/product/2088.
    Last edited by MichaelMeissner; 10-29-2017 at 02:17 PM.

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,453
    Instead of clocking down the whole Teensy which is definitively a waste, wouldn't it be possible to just reduce the SPI speed?

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,063
    Quote Originally Posted by Theremingenieur View Post
    Instead of clocking down the whole Teensy which is definitively a waste, wouldn't it be possible to just reduce the SPI speed?
    Perhaps. I didn't dig too far into it, but it sounds reasonable (I was using somebody else's code). My point was out of the box, the OLEDs I tried (both Adafruit and New Haven) were sensitive to the data speed.

  6. #6
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    891
    The SSD1351 Max SPI clock speed is documented in the datasheet but I don't remember the exact value. It's not very high though

  7. #7
    Junior Member
    Join Date
    Apr 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by Theremingenieur View Post
    Instead of clocking down the whole Teensy which is definitively a waste, wouldn't it be possible to just reduce the SPI speed?
    That's what I did with my Newhaven OLED. In ssd1351.h, I changed it to
    Code:
    #define SPICLOCK 16000000
    and was able to run the Teensy 3.6 at full speed.

  8. #8
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    891
    I can confirm at least 12 MHz clock on a breadboard with the adafruit 1.5 OLED breakout board, which uses the SSD1351

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,303
    I wonder how much of the speed limit is due to that (not terribly fast) HC4050 chip Adafruit uses on the board?

    It's a shame they didn't use a faster LCX chip instead of the old HC types. But their main focus until very recently has been only the old 8 bit AVR chips. Now that they're starting to use SAMD chips, maybe they'll start using faster chips on their breakout boards?

  10. #10
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    891
    I don't think the HC4050 is really limiting speed, it's the SSD1351.

  11. #11
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,063
    Quote Originally Posted by christoph View Post
    I can confirm at least 12 MHz clock on a breadboard with the adafruit 1.5“ OLED breakout board, which uses the SSD1351
    I happened to still have the breadboard setup for the OLED displays from the last time I was trying to get the OLED displays to work, and I plugged a 3.5 into the breadboard. I found that if I modified the SPIsettings line in the program (the program only uses the library to setup the chip, it does all of the main processing itself using the DMA optimizations and SPI.begin_transactions) to be:

    Code:
    SPISettings settings(18000000, MSBFIRST, SPI_MODE3); // Slower clock for OLED
    With those settings, it would work at all clock speeds of the 3.5 up to the max 168 Mhz overclock. I first tried, 16000000, and it worked, and then I tried various settings up to the default 24000000 that the program originally used (which works for the TFT displays), and 18000000 seemed to be the fastest that the Adafruit displays would run at. Thanks for the pointer.

    I did run the two side by side, with the 3.2 driving the TFT displays and the 3.5 driving the OLED displays. With the OLED display, you can see the display at any angle, while with the TFT display, if you aren't looking at it straight on, you start seeing distortion in the image. The TFT seemed a little sharper and punchier colors than the OLED.
    Last edited by MichaelMeissner; 11-04-2017 at 04:32 AM.

  12. #12
    Senior Member
    Join Date
    Dec 2016
    Posts
    101
    Hi

    Any idea if the same goes for the small adafruit 1306 type of monochrome displays? (https://learn.adafruit.com/monochrome-oled-breakouts)?

    Alain

  13. #13
    Senior Member
    Join Date
    Sep 2013
    Location
    Hamburg, Germany
    Posts
    891
    What "same" are you interested in?

  14. #14
    Senior Member
    Join Date
    Dec 2016
    Posts
    101
    Quote Originally Posted by christoph View Post
    What "same" are you interested in?
    I would like to use one of the 1306 types to add a small display to a teensy. First a teensy 3.2 and normally running at 24Mhz and later probably on a 3.6.
    Checking if I would run into problems.

    Alain

  15. #15
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,453
    No risk, everything will work as long as you manage, depending on the used library, to adapt the OLED SPI speed.

  16. #16
    Senior Member
    Join Date
    Dec 2016
    Posts
    101
    Quote Originally Posted by Theremingenieur View Post
    No risk, everything will work as long as you manage, depending on the used library, to adapt the OLED SPI speed.
    Thanks for the prompt answer.

  17. #17
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,063
    Quote Originally Posted by AlainD View Post
    I would like to use one of the 1306 types to add a small display to a teensy. First a teensy 3.2 and normally running at 24Mhz and later probably on a 3.6.
    Checking if I would run into problems.

    Alain
    If you are running 24Mhz because you are running on battery and are worried about power usage, you might want to look into the Teensy e-paper display. As I understand it, the display only uses power when you are writing to it, so if the writes are infrequent, this might be for you. The new version has the pins soldered in, so you could just putting stacking headers (or normal female headers if you are not attaching the teensy to a breadboard/pcb), and possibly remove it as necessary. I bought this, but so far, I haven't tried it.

    Another alternative is to attach the Adafruit feather wing adapter shield, and use the Adafruit feather wing OLED display. This works better for the 3.2 than the 3.5/3.6, as you need to mount the feather specially because of the extra pins in the 3.5/3.6. I have the older problem that needed some surgery to work on the Teensy. The new version is claimed to work fine on the Teensy without modification (the problem was they were tying the reset button to the display reset, but on the Teensy/feather, the reset button is actually the program button):


    Sparkfun has SSD1306 128x32 mono OLED display with a board that just mounts on top of the Teensy. Because it doesn't use the back row pins, it can just as easily be put on the 3.5/3.6. This is nice because it sits on top of the Teensy. There are jumpers so you can control which pins are used:


    Sparkfun has their own library for the Teensyview, but I imagine the Adafruit library will also work. Note, the Sparkfun library does not support transactions, so it won't play with other SPI devices on your system that have been modified for transactions. The Sparkfun library sets the SPI bus speed to 1Mhz. Like the Teensy e-paper, I think I bought one, but I haven't used it yet.

    Note, the SPI code in the Teensydunio release that has been modified by Paul for the Teensy has this line in it:

    Code:
    #ifdef SPI_HAS_TRANSACTION
          SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0));
    #else
          SPI.setClockDivider (4);
    #endif
    That sets the SPI bus speed to 8Mhz. That means you should not have to modify the library (if I'm reading it right).

    In addition, many of the SSD1306 OLED 128x32 mono displays also come in I2C variants. You would need to add 2 pull-up resistors (usually 2.2Khz) between pin 18 and 3.3v, and between pin 19 and 3.3v to enable i2c. I2c is a shared bus, and it is a little slower than SPI. So, it more likely will work if you aren't constantly redrawing the display.
    Last edited by MichaelMeissner; 11-05-2017 at 03:28 PM.

  18. #18
    Senior Member
    Join Date
    Dec 2016
    Posts
    101
    Quote Originally Posted by MichaelMeissner View Post
    If you are running 24Mhz because you are running on battery and are worried about power usage, you might want to look into the Teensy e-paper display.
    ...
    Another alternative is to attach the Adafruit feather wing adapter shield, and use the Adafruit feather wing OLED display. This works better for the 3.2 than the 3.5/3.6, as you need to mount the feather specially because of the extra pins in the 3.5/3.6. I have the older problem that needed some surgery to work on the Teensy. The new version is claimed to work fine on the Teensy without modification (the problem was they were tying the reset button to the display reset, but on the Teensy/feather, the reset button is actually the program button):


    In addition, many of the SSD1306 OLED 128x32 mono displays also come in I2C variants. You would need to add 2 pull-up resistors (usually 2.2Khz) between pin 18 and 3.3v, and between pin 19 and 3.3v to enable i2c. I2c is a shared bus, and it is a little slower than SPI. So, it more likely will work if you aren't constantly redrawing the display.
    Thanks

    The feather wing seems nice, especially because there's also a lipo charger built in. If I understand it correctly it will "automatically" charge the battery if it's connected to the usb. Could be nice with a small battery. Not much info on the charger speed, so using a 500mAh pack could be to small.

    The lower speed is because it will be enough (doing only 10-100 analog reads/second before averaging). No problem if the display is using energy from the battery if I can turn it off (or minimise the power consumption) if not in use.

    Alain

  19. #19
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,063
    My one complaint about the featherwing is it would be nice to be able to have an on/off switch to be able to enable the battery. I've had a lot of problems with the JST connector and lipo batteries, either having the JST connector that I soldered to to the board come out or the wires coming out of the battery or the JST connector. The JST connector on the feather wing adapter is very firmly attached. Unlike some of the other lipo chargers, you don't have to cut the trace between VIN and VUSB on the Teensy.

    As I said, for the 3.5, you have to think about how you want to mount the Teensy. I would suspect the best bet for using a display is to put the Teensy underneath the feather wing. You may need to connect the Teensy program (or reset depending on taste) to the feather wing, and possibly bring out the program button in case you need to force the Teensy into programming mode.

    The normal way I mount the Teensy 3.2 to the feather wing adapter is to mount the feather wing on the bottom, and use tall headers for the feather pins to mount the various wings, but the extra pins of the Teensy 3.5 would get in the way.

    Here are some pictures of how I combined a full prop shield, breakouts for the underneath pins, Teensy 3.2, and the feather wing adapter:





    Here is the PCB that FrankB designed to give access to the underneath pins:
    Last edited by MichaelMeissner; 11-05-2017 at 03:55 PM.

Posting Permissions

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