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

Thread: adafruit 1.5" OLED pinout clarification for TEENSY application

  1. #1

    adafruit 1.5" OLED pinout clarification for TEENSY application

    Hi Gents,

    I am waaaay confused! I have a new 1.5" OLED display from Adafruit.

    Project deadline is closing fast, I need this sucker to work. SO I loaded their test.ino (attached).

    There is an issue between the board's 2 letter labeled pins and what their code calls out.

    A few of those are obvious to match to the code, but I'm tired of trying to guess the others.

    MOSI, MISO, SD, CS, CL...done my best researching the interwebs...need help!

    From the example code:

    #define sclk 2
    #define mosi 8
    #define dc 4
    #define cs 12
    #define rst 7


    From the printed pinouts on the actual OLED board you have:
    G
    +
    3V
    CD
    SO
    SC
    OC
    R
    DC
    CL
    SI



    Thanks!
    Attached Files Attached Files

  2. #2

  3. #3
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,521
    Quote Originally Posted by grayfx View Post
    Hi Gents,

    I am waaaay confused! I have a new 1.5" OLED display from Adafruit.

    Project deadline is closing fast, I need this sucker to work. SO I loaded their test.ino (attached).

    There is an issue between the board's 2 letter labeled pins and what their code calls out.

    A few of those are obvious to match to the code, but I'm tired of trying to guess the others.

    MOSI, MISO, SD, CS, CL...done my best researching the interwebs...need help!

    From the example code:

    #define sclk 2
    #define mosi 8
    #define dc 4
    #define cs 12
    #define rst 7


    From the printed pinouts on the actual OLED board you have:
    G
    +
    3V
    CD
    SO
    SC
    OC
    R
    DC
    CL
    SI



    Thanks!
    Hint from same page ecurtz gave:
    If you are confused by the abbreviations on the front of the board, the full signal names are printed on the back!

  4. #4
    ecurtz, thanks, saw that before.

    so, can you confirm what I think the tiny leftover missing pieces are?

    missing but here's my guess:

    sclk = sck (pretty sure about that one!)

    CS...2 options here: "SDCS" or "OLEDCS"

    which one sir?

    thanks!

  5. #5
    I've never used this product, but presumably if you want to talk to the screen you want OLEDCS.

  6. #6
    On the bright side you beat adafruit's support team by about a day...still waiting on this simple answer...

    I appreciate your looking at this though. Limits some of the questions.

    cheers

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,596
    There was a forum post showing the various/varied name associations. Here is a summary from Wikipedia: Serial_Peripheral_Interface_Bus

    The "SD" addresses the SD card versus the "OLED" CS pins as each needs a unique one to address the hardware

    The SPI bus specifies four logic signals:
    ◾SCLK : Serial Clock (output from master).
    ◾MOSI : Master Output, Slave Input (output from master).
    ◾MISO : Master Input, Slave Output (output from slave).
    ◾SS : Slave Select (active low, output from master).

    Alternative naming conventions are also widely used, and SPI port pin names for particular IC products may differ from those depicted in these illustrations:

    Serial Clock:
    ◾SCLK : SCK, CLK.

    Master Output --> Slave Input:
    ◾MOSI : SIMO, SDI(for slave devices), DI, DIN, SI, MTST.

    Master Input <-- Slave Output:
    ◾MISO : SOMI, SDO (for slave devices ), DO, DOUT, SO, MRSR.

    Slave Select:
    ◾SS : nCS, CS, CSB, CSN, EN, nSS, STE, SYNC.

    The MOSI/MISO convention requires that, on devices using the alternate names, SDI on the master be connected to SDO on the slave, and vice versa. Chip select polarity is rarely active high, although some notations (such as SS or CS instead of nSS or nCS) suggest otherwise. Slave select is used instead of an addressing concept.

  8. #8
    defragster, thank you!

    Actually I did ping the wiki link before starting this plead for help, I didn't understand the "Slave Select" part.

    I have re-wired "CS" to what adafruit's board calls out "OLEDCS" (confusing as the other side of the board calls that pin "SC", cute.).

    Double checked solder connections, wiring, and code...still nothing.

    OLED black is truly black. In this case it kind of sucks as if I saw a black shift (like TFTs turning on) I would know something was OK... BTW voltmeter check across the "+" and "G" pins is reading 5VDC.

    Ideas?

    Thanks again!
    Last edited by grayfx; 01-07-2016 at 08:43 PM.

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,596
    The first three lines listed in p#7 comment are common to one or more SPI devices where TEENSY is the MASTER - each SLAVE device needs a unique 'Select' line to tell it when to watch or ignore the bus when it or others are being 'addressed'. On your device the OLED and SD can be addressed in turn where each has a unique Teensy pin wired to the CS 'Select' line. Looking at a Teensy 3.1/3.2 card (I don't see noted which Teensy you have?) you'll see two options each for the primary three lines and 5 black/grayed pins to be used as CS. Only one active SPI bus is supported on T_3.x and the pins need to be specified/known in software - implicitly or explicitly depending on user choices and software expectations. The same goes for CS but multiple devices need to support a unique CS per device.

    Not sure if that helps you follow each line in hardware/software to understand why it is there and to see if your wiring and declarations are right. I'm not sure what the 5V .vs. 3.3V impact is with that device and your Teensy. Not sure exactly which OLED or Teensy you have.

  10. #10
    OK! Finally up and running. Test code and bmp slideshow from SD card are working. It's the small stupid details that screwed me up.

    Here's a (crappy) test vid of bmps going through: https://youtu.be/wujuuJ9KkMo

    Details: running this stupid test on an Uno rev3 only because that's what Adafruit had in their example vid. I have 3 TEENSY's (3.2) standing by and have had great success with them.

    Screen is this: https://www.adafruit.com/products/1431

    Their tech support finally came through and after 11 views and passing it to the manager the change they suggested was enabling this line of code:

    Adafruit_SSD1351 tft = Adafruit_SSD1351(cs, dc, rst)

    The issue I have now is the extremely slow refresh rate. Uno rocks in at a slow 16 Mhz, TEENSY is about 6x faster, right?

    SO: do you all think switching to the TEENSY will provide a faster refresh rate? Stupid question, I know...

    Thanks!

    (working bmp slideshow code attached)



    bmp_reading_010820105.ino

Posting Permissions

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