Easy with you, hard with newbee, Oled 12864 4spi Helppppp me, god bless you:(

I have a Mega adruino , and a oled screen like this

I've set it to 4spi (0.0.0) already

How could i conect it to adruino:

Mega Wire Oledscreen:
3.3v red 1:3,3v
gnd brown 2:gnd
? green 14:reset
? blue 10:D0
? violet 9:D1
? yelow 13:DC
? orange 15:CS

pleasseeee help me :drooling_face:

what i have to change in the example code of adafruit?

The following table display on which pins the SPI lines are broken out on the different Arduino boards:

Arduino Board MOSI MISO SCK SS (slave) SS (master)

Mega1280
Mega2560 51 or 50 or 52 or 53
ICSP-4 ICSP-1 ICSP-3

Note that MISO, MOSI, and SCK are available in a consistent physical location on the ICSP header; this is useful, for example, in designing a shield that works on every board.

thank you so much

i have this pic

IS THAT PIC RIGHT???
why mosi is D1 and clk is D0, where is miso

The SPI pins for the Mega are: 51 (MOSI), 52 (SCK), 53 (SS)

pin 9 (D1) goes to pin 51 ?
pin 10 (D0) goes to pin 52 ?
pin 15 (CS) goes to pin ?
pin 14 (RES) goes to reset pin by 3.3V pin or pin 13?
pin 13 (DC) goes where ?

do i have have to change the baud speed to: Serial.begin (9600)
what i have to change in this:

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// If using software SPI (the default case):
#define OLED_MOSI 9
#define OLED_CLK 10
#define OLED_DC 11
#define OLED_CS 12
#define OLED_RESET 13
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

You can define them with software SPI

Hic hic anyone know what is DC pin ?? i know CS is SS but DC is what, and where it conects to in ardruino Mega =(

I now understand your trouble. Really i tried to find an answer for you.

Hi

Sunlolo:
Hic hic anyone know what is DC pin ?? i know CS is SS but DC is what, and where it conects to in ardruino Mega =(

If you've got the SSD1306 controller (I guess as I see in your sample code) the DC pin does the following:

This is Data/Command control pin. When it is pulled HIGH (i.e. connect to VDD), the data at D[7:0] is treated as data. When it is pulled LOW, the data at D[7:0] will be transferred to the command register.
In I2C mode, this pin acts as SA0 for slave address selection.
When 3-wire serial interface is selected, this pin must be connected to VSS.

I found this in the controller datasheet.

thank you ,bro
i try following this link http://arduino.cc/en/Guide/TFTtoBoards

Arduino Mega 2560 e Mega ADK:
To connect the lcd screen to a Mega board, use this pin configuration:
+5V: +5V
MISO: 50 on Mega 2560 (Miso on ADK)
SCK: 52 on Mega 2560 (Sck on ADK)
MOSI: 51 on Mega 2560 (Mosi on ADK)
LCD CS: pin 10
SD CS: pin 4
D/C: pin 9
RESET: pin 8
BL: +5V
GND: GND

mycode:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// If using software SPI (the default case):
#define OLED_MOSI 51
#define OLED_CLK 52
#define OLED_DC 9
#define OLED_CS 10
#define OLED_RESET 8
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

but nothing happen, just the redled on screen blink-stop-blink

This is ridiculous. Why no information out there

Which is better, SPI4 Or I2C, i ,m going to change SPI to I2C,
Any one have this screen lightup

:zipper_mouth_face:

Hi

Let me start with the very beginning:

I have a Mega adruino , and a oled screen like this

Do not show a picture which is like your screen. Provide a picture of your screen together with the correct datasheet. Anything else is guessing. It seems that you have used some pictures from/for Adafruit Displays. Is your OLED an Adafruit OLED? If not, then the Adafruit software might not work at all (the Adafruit library only supports SSD1306, but not the SH1106 controller).

Regarding the connection: My suggestion is to use the 4-wire SPI, because 3-wire SPI is usually not implemented by the Arduino libraries and I2C is unreliable for far east variants of this OLED with the SSD1306 controller.
For 4-wire SPI:

  • The display does not have a MISO output
  • DC is data/command line, which is required in 4-wire SPI mode
  • CS, MOSI and CLK are the other 3 lines required for 4-wire SPI mode.

Oliver

olikraus:
Is your OLED an Adafruit OLED? If not, then the Adafruit software might not work at all (the Adafruit library only supports SSD1306, but not the SH1106 controller).

  • The display does not have a MISO output
  • DC is data/command line, which is required in 4-wire SPI mode
  • CS, MOSI and CLK are the other 3 lines required for 4-wire SPI mode.

Thanks for your help bro, im sure that screen have ssd1306 controller, and i have its datasheet
but my problem is i cant find where pin to tonect in my case using mega, its defferent with the tuts using uno on web:((

i cant find where pin to tonect

This depends on the library. U8glib has as SW SPI included, so you can use any digital or analog Arduino pin for any of the display pins. Just inform U8glib which pins you actually use.

Oliver