1
\$\begingroup\$

I am trying to interface my OLED 0.95'' 96*64 with my SAM D20 using SPI interface.

I am fairly new to interfacing, so I'm finding it difficult interfacing the part.

Question:

1) When I provide the 3.3-5V to Vcc and GND, should the OLED display something, or it only does on initializations?

2) I connected the Vcc, GND, SS=0(because MCU is Master), MOSI and SCK pin on the OLED with the respective pins on the microcontroller using the SPI tutorial for the micro as in the second link below.

I saw no activity on the screen, is this an initializations issue. Since it says that the OLED has the SSD1331 driver, do I have to use/send commands that trigger the OLED for it to start.

I thought I should see something on the screen to indicate that it is powered on, I checked the SPI module on the MCU and that seems to be sending out data correctly, however I have not regulated the data.

I would appreciate if someone who has worked on such a project give me a top level outline of steps I should carry out if I am going wrong somewhere.

Also, if it could be a parts error please indicate.

Useful Links:

1) OLED Module

2) Atmel SAMD20 MCU (SPI Documentation):

\$\endgroup\$
  • 1
    \$\begingroup\$ Look into the datasheet of the SSD1331. It will tell you how to communicate with the controller, and if any initialization is necessary. Note that, in addition to MOSI, SCK and SS, you'll also need to control the "D/C" (data/command) pin. \$\endgroup\$ – JimmyB Oct 20 '16 at 9:38
  • 1
    \$\begingroup\$ Can you ask your seller to provide you the documentation for the product? It would be a valid request. \$\endgroup\$ – Nazar Oct 20 '16 at 14:47
1
\$\begingroup\$

I am fairly new to interfacing, so I'm finding it difficult interfacing the part.

Nothing personal, but unfortunately another reason is because you have bought from a supplier who has given no information about how you should use the device. That is the real "cost" of buying from a cheap supplier - you need to do everything yourself. If you cannot do all that yourself (because you are a beginner) then consider choosing a supplier who gives much more information and support e.g. Adafruit, SparkFun etc.

Some people here understandably dislike being treated as the technical support for cheap suppliers (that might be the reason for the downvote on this question). Also please remember that we don't have your module in our hands, so even if someone did have the time to do all the research for you, we simply couldn't do so fully, without that exact hardware which you have.

Notice that the advert title says: "[...] SPI,Parallel Interface [...]". That is wrong. That OLED module does not provide any connections for a parallel interface to the MCU (the driver IC can provide a parallel interface to the MCU, but the module would need lots more interface pins to do that, and would not match the photograph). If they cannot show the correct technical information in the title, how can we trust anything else they say?

Also note that the picture in that advert claims the serial interface is SPI, but lists the interface pins as:

SPI PIN interface:
1.GND
2.VCC
3.SCL
4.SDA
5.RES
6.DC
7.CS

That makes no sense - "SCL" and "SDA" are I2C interface labels, not SPI. I can only guess that your module has different interface pin labels, since you mention "MOSI" later. However, again, this is a warning about how little information from the advert you can trust and how much work you will need to do yourself.

1) When I provide the 3.3-5V to Vcc and GND

I did not see any information on the seller's page that you linked, which gives the allowed range of Vcc for that module. How do you know that this is the allowed voltage range? FYI, when I buy things from cheap suppliers, I only do so with the expectation that I will have to reverse-engineer the hardware myself, to understand things like power supply voltages, interfaces etc. I suggest being careful in relying on any information provided by cheap suppliers - remember that they described the module as having a parallel interface, which it doesn't!

should the OLED display something

No, not after only connecting power.

or it only does on initializations?

Yes.

2) I connected the Vcc, GND, SS=0(because MCU is Master)

Not correct. Assuming that your module really has an SPI interface, and not the I2C interface implied by their advert's listed interface signals - you do not "hard wire" SS (the advert calls it "CS") to ground. It must be driven low and high by the MCU, as required by the standard SPI protocol, for each command. It is common that the command or data from the SPI shift-register is only read and used when "CS" transitions from low to high, at the end of receiving those bytes.

Read the SSD1331 datasheet and SSD1331 code examples from people with other similar OLED modules, to learn more.

As JimmyB kindly pointed out in a comment, you also need to drive the "C/D#" pin during SPI communications, to indicate to the driver IC whether the SPI interface is carrying command or data bytes.

[...] MOSI and SCK pin on the OLED with the respective pins on the microcontroller using the SPI tutorial for the micro as in the second link below.

I saw no activity on the screen, is this an initializations issue.

At the least, yes, it is an initialisation issue (nothing is displayed until you tell the display what to show). Of course other problems are possible as well e.g. faulty hardware, incorrect interfacing etc.

Since it says that the OLED has the SSD1331 driver, do I have to use/send commands that trigger the OLED for it to start.

Yes.

I thought I should see something on the screen to indicate that it is powered on

No, although with some modules, a slight flicker may sometimes be seen.

I checked the SPI module on the MCU and that seems to be sending out data correctly, however I have not regulated the data.

I don't know what you mean by "regulated", but if you have the ability to decode the SPI data (e.g. a logic analyser), then using the SSD1331 datasheet and especially some of the existing SSD1331 libraries from other OLED display suppliers, you have a better chance of getting your display working than someone who cannot check the data on the SPI interface.

I would appreciate if someone who has worked on such a project give me a top level outline of steps I should carry out if I am going wrong somewhere.

One example of an outline would be:

  • Confirm hardware requirements i.e. correct power supply voltage range, I/O voltage range, and all required interface signals. This might require reverse-engineering the PCB on that specific module.
  • Research display driver IC datasheet and sample code for displays using the same display driver IC. Note that sometimes sample code for other similar display modules will not work on every module using the same driver IC. This is due to differences in the display connected to that driver IC on the module, or other hardware configuration choices made by the manufacturer of that specific module.
  • Modify sample code to make it suitable for your MCU and its SPI functionality.

Good luck!

\$\endgroup\$
  • \$\begingroup\$ After researching a couple of youtube tutorials, I realised that the pins are named incorrectly, SDA should be MOSI and CS should be SS as in the SPI protocol, Agreed I messed up on buying a cheaper part, hence making it difficult to interface, I am grateful you answered despite it being down-voted. My intent was not to treat anyone as technical support, just to move past my assumption that POWER AND GND should show something on the OLED since a lot of YouTube tutorials show the same \$\endgroup\$ – Siddhant Oct 20 '16 at 12:13
  • 1
    \$\begingroup\$ @SIddhant - Hi - "My intent was not to treat anyone as technical support, just to move past my assumption that POWER AND GND should show something on the OLED" - I could understand that from your question, which is why I chose to answer. :-) Other people ask much less reasonable questions than you! || "since a lot of YouTube tutorials show the same" - None of the OLED modules I have used, have displayed anything until initialised by the attached MCU. If you have a link to a YouTube video to one which display something that is not sent from an MCU, I would be interested to see it. :-) \$\endgroup\$ – SamGibson Oct 20 '16 at 12:30
  • 2
    \$\begingroup\$ Resolution Firstly, thanks a lot Sam, you helped me understand the protocol quite a bit I got my OLED 0.95'' to work, I bit-banged SPI because I hadn't used the right pins for SERCOM while getting my PCB board done, For anyone looking to get a solution to this, please refer to the following code, specifically look at the initializations secion, a lot is derived from the given SSD 1331 driver but I have it laid out clearer in a function, I'll be willing to help if I see any questions on this, github.com/sekale/ECE477/blob/master/GccBoardProject5/… \$\endgroup\$ – Siddhant Nov 27 '16 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.