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

Thread: Teensy 3.6... OLED display.. SPI or I2C?

  1. #1

    Teensy 3.6... OLED display.. SPI or I2C?

    Greetings all,

    I have a project connected to an SSD 1306 OLED thats working fine through I2C. However, I watched comparison between I2C and SPI https://www.youtube.com/watch?annota...&v=Wz6Fzo3rsLM that showed a definitive speed advantage to using SPI as opposed to I2C. When it comes to the Teensy, is there a preferred option? I'm considering rewiring for SPI as I'm at the breadboard stage, and wondering if its worth the effort.

    Thanks.

  2. #2
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,512
    SPI is well worth it, your comparing i2c with an average use of 400khz to an SPI bus with speeds above 1MHz, that can be ran way higher as well, depending on your application, you could run 10MHz if the LCD supports it.

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,682
    I would suspect the SPI displays are faster than I2C, especially if you are using the default i2c speed, which limits the i2c bus to 100khz.

    One thing I've run into with highly optimized displays like the SSD1351, is the Teensy 3.5/3.6 can drive the display much faster than it can handle, and I had to go in and slow down the SPI bus so the Teensy wasn't sending data faster than the display could accept. I don't think the SSD 1306 has the special DMA optimizations, and so it it may not be an issue. But you have to tune the display.

  4. #4
    Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    83
    Driving this 1306 OLED display with hardware SPI on a Teensy 3.1, I was able to run the display at 862 fps.
    See this thread.

    Regards,
    Paul

    PS: I measured the SPI clock to be 8MHz in the example in the thread mentioned above.
    Last edited by PaulS; 01-12-2018 at 01:02 PM.

  5. #5
    The strange thing is, I've ported a circuit and sketch from the Mega to the Teensy 3.6.. the I2C OLED screen actually seems LAGGIER on the teensy. Any idea what might be causing this?

  6. #6
    Quote Originally Posted by MichaelMeissner View Post
    ...But you have to tune the display.
    any idea how I should go about this?

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,459
    Quote Originally Posted by vfxwolf View Post
    Any idea what might be causing this?
    Did you try the Wire.setClock(400000) suggestion I wrote on your other thread?

Posting Permissions

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