0

Confusion for SSD1351 BMP Tutorial
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Confusion for SSD1351 BMP Tutorial

by dennisonb on Sat Dec 15, 2018 11:53 am

Hello, I have an Arduino Uno and a SSD1351 OLED Display. Disclaimer I am not experienced in this area.

When following this tutorial I manage to get the display to work using the wiring as listed in this particular tutorial.
https://learn.adafruit.com/adafruit-1-5 ... g-and-test

However I have not been able to get the BMP tutorial working and am a bit confused.
https://learn.adafruit.com/adafruit-1-5 ... ng-bitmaps

The wiring according to the tutorial does not work with the example code (stock, unchanged bmp sample code), despite the tutorial saying: "The Arduino connections listed below match the code in the "bmp" example from the library:". Display does not light up, nothing appears to happen. As a note, the abbreviations and names for pins are frustratingly not consistent across the tutorial and the example code.

Ok.

So, then there is a note: "Note that the Bitmap example code uses hardware SPI wiring for maximum speed. You can still use software SPI, but make sure that the pin definitions match your wiring and that you modify the example to select the Software SPI option (#1) in the code. The SPI pins shown are for Atmega-328 processors. To use this wiring on other processors, software SPI must be used."

However, there is no "option (#1)" in the code. So, I don't understand what this is supposed to refer to.

Ok.

Googling around many people seem to have this problem, and solve it, but with the unfortunate symptom in forums that once they solve it they never bother to post exactly what they did, so I'm left experimenting/wondering.

Thanks internet.

So I do find some helpful ideas and trying to figure out what all the references to hardware SPI and software SPI mean in this context, and I come to this modification:

Original tutorial code:
#define sclk 13
#define mosi 11
#define cs 5
#define rst 6
#define dc 4

I changed it to this, which seems to follow the wiring better from the code. As a note- "cs"? Thats not the abbreviation used in the tutorial at all, yet is in the code.

#define sclk 13
#define mosi 11
#define cs 10
#define rst 9
#define dc 8

Now, the display lights up, it shows a solid color but the serial port says, "Initializing SD card...failed!"

At this point I'm stuck, and not sure where to go further. I know now the display works, but the tutorial nor the code properly illustrate how to make it work. I can get the display to work (draw) and fill with color but I can not seem to get the SD card to work.

My thoughts:
My SD card is bad (tested- works. tested multiple SD cards)
I suspect it's a wiring issue, but don't know where to go from here.

dennisonb
 
Posts: 3
Joined: Sat Dec 15, 2018 11:33 am

Re: Confusion for SSD1351 BMP Tutorial

by adafruit_support_carter on Sat Dec 15, 2018 4:26 pm

Looks like the guide and code do not agree. The guide has this for the wiring:
GND -> GND (G)
5v -> VIN (+)
#4 -> SDCS (SC)
#8 -> DC
#9 -> RST (R)
#10 -> OLEDCS (OC)
#11 -> MOSI (SI)
#12 -> MISO (SO)
#13 -> SCLK (CL


But it looks like the example code does not match that.
Code: Select all | TOGGLE FULL SIZE
#define CS_PIN   5
#define RST_PIN  6
#define DC_PIN 4

and
Code: Select all | TOGGLE FULL SIZE
#define SD_CS 10 // Set the chip select line to whatever you use (10 doesnt conflict with the library)


We could either change your wiring, or change the code. Let's try changing your wiring first so you can use the code as is. Change your wiring between the UNO and the display to be:
GND -> GND (G)
5v -> VIN (+)
#10 -> SDCS (SC)
#4 -> DC
#6 -> RST (R)
#5 -> OLEDCS (OC)
#11 -> MOSI (SI)
#12 -> MISO (SO)
#13 -> SCLK (CL)

and then try running the unmodified sketch:
https://github.com/adafruit/Adafruit-SS ... mp.ino#L60

adafruit_support_carter
 
Posts: 11647
Joined: Tue Nov 29, 2016 2:45 pm

Re: Confusion for SSD1351 BMP Tutorial

by dennisonb on Mon Dec 17, 2018 12:42 pm

Thanks! That did the trick! Works like a charm now. Thank you very much!

dennison

dennisonb
 
Posts: 3
Joined: Sat Dec 15, 2018 11:33 am

Please be positive and constructive with your questions and comments.