New OLED in Town, troubles with SPI

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
acpadhi
 
Posts: 1
Joined: Sun Sep 14, 2014 2:48 pm

New OLED in Town, troubles with SPI

Post by acpadhi »

This is not related to an Adafruit Product. Please excuse me if I should not be posting here about it. Once informed, I will never post again such a post.
I am posting it here, since, the library is developed by Adafruit and is working with a Non - Adafruit well but in some conditions only.

I have got a OLED which has 8 PINs named :

GND, VCC, SCL, SDA, OUT, IN, SCK, CS - No further PINs or PADS in the back to solder like jumpers. Nothing configurable on the hardware side of any kind. Please refer to images.
P_20140913_152841.jpg

Front SIde - 8 PINS clearly labeled
Image

Back Side - No SOlderable Pads or Mode Switching option
Image

Please correct if I relate the pins properly as below :

- SCL and SDA - relate to I2C
- OUT and IN relate to MOSI and MISO in SPI
- SCK Relates to Clock in SPI.
- CS Relates to Chip Select in SPI.

From my understanding,
- I2C devices are always 2 wire protocol.
- SPI Devices are always 4 Wire Protocol. 3 Wired ones exist where the slave does not need to send back any information.

I have successfully managed to RUN the above OLED using I2C and by using only 2 data lines - SDL and SCL. Please see attached image.

Working well using I2C and 2 wire communication, rest 2 are power. 3.3V
Image

Used Wonderful instructions from https://learn.adafruit.com/ssd1306-oled ... ack/wiring
Since this OLED does not have any D/C and RST pins, those relevant parts from the Tutorial were skipped.

Got it running fine using the SSD1306 library using Python but in I2C mode only. All demos are working fine including the Animations.

Now the trouble starts with SPI.

The library posted wants the D/C and RST connections to be there, whereas in this Display as you can see from pictures, those PINS do not exist. Based on my experience of success at the I2C, I ignored the RST and DC connections completely in wiring because of lack of those PINs in the OLED.

However, none of the examples work in SPI. Going by Standards, I assume, the SPI has all the 4 wires it needs as per standards.

The Python library is programmed in such a way that you cannot feed a "None" or None value to the RST and D/C parameters in the function calls. SO I used 0 for them but it still does not work.

I have searched google for the last 2 days, but have not come across a single instance of such a display with 8 such PINS anywhere else other than from where I bought this(Ebay BANNED). As Usual, it is a Chinese product with No Documentation other than pointing to the PDF that some good soul there in the West wrote probably.

I am quite new to all this, this is the first ever attempt at getting a display or any kind of BUS peripheral device connecting to the Pi.

Can someone help further on getting it work on SPI ? I can survive with I2C as it is simple, elegant and lean. however. the performance is not great. My needs are to have pretty frequent communication happening to the display. So I feel SPI should be the way to go.

Also, Off the shelf, something very important as well I noticed. Is Python always a slow language on Pi ?
When running the Animation demo using the python lib in I2C mode, the CPU load increases to almost 50%. Is this the Python GPIO library or the Python OLED library which is causing it ?

I cannot understand, how it could put so much load, since I2C communication is happening at the hardware level, and python is probably just sending some commands to the hardware layer using a C Abstraction. I am doubtful, if the C Abstraction is that slow. This just does not happen in the animation demo. Even the demos that show static information(shapes/text/image) put similar loads on the CPU for the time they get executed.

Any further information on this ? please share your experiences.

Also, I will be highly thankful if someone helps in nailing down getting this display working in SPI.
SInce it is working in I2C, I am sure, this is SSD1306 and it should work well on the SPI too, May be I am doing connections wrong, or the library is not suitable for this one since, the lib demands RST and D/C pins to be there. GOD have mercy on all of us that we are all forced on non standard stuff daily !!! and that too without any documentation at all on these hieroglyphic elusive displays. Just kidding.

It is not easy in our Country(BANNED) to grab Adafruit products at affordable prices, and these cheap Chinese products come with literally no documentation at all. Pretty tough for new guys starting to do anything meaningful.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: New OLED in Town, troubles with SPI

Post by adafruit_support_mike »

Without a datasheet, you'd have to reverse-engineer the display's SPI command set.

Our library is clearly made for some other kind of display, but look around for datasheets of displays with a similar set of pin connections and see if those commands work for the one you have.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”