Author Topic: ssd1306 hal library & helping  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

Offline huseyinkTopic starter

  • Contributor
  • Posts: 11
ssd1306 hal library & helping
« on: June 30, 2018, 12:47:26 pm »


I bought this lcd what is 0.96” 12864 oled.
I searched something and I found this info. This lcd compatible with spi. At leats it was on the site that I bought. But I dont know which pin is SS/CS. DC pin is usefull this work??
D0 >> SCL
D1 >> MOSI
RES >> 0~Reset Mode / 1~Normal Mode
DC >> I dont know connection of this pin.

If someone who used this lcd,can you explain me how I should connect DC pin?
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: ssd1306 hal library & helping
« Reply #1 on: June 30, 2018, 02:36:45 pm »
If someone who used this lcd,can you explain me how I should connect DC pin?
"DC" = Data/Command. You connect that to a GPIO which you drive high to transfer pixel data or low for commands to the controller inside the display.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: ssd1306 hal library & helping
« Reply #2 on: June 30, 2018, 02:44:20 pm »
In SPI mode D0 is SCK and D1 is MOSI. RES is for resetting the display controller after power-on. DC is the signal line for data (high) or command (low). And CS selects the controller (low = selected). If the SSD1306 is the only slave on the SPI bus you can wire CS to Gnd. You'll find everything explained in the SSD1306's datasheet which can be found easily by a quick internet search.
 

Offline huseyinkTopic starter

  • Contributor
  • Posts: 11
Re: ssd1306 hal library & helping
« Reply #3 on: June 30, 2018, 04:28:18 pm »
In SPI mode D0 is SCK and D1 is MOSI. RES is for resetting the display controller after power-on. DC is the signal line for data (high) or command (low). And CS selects the controller (low = selected). If the SSD1306 is the only slave on the SPI bus you can wire CS to Gnd. You'll find everything explained in the SSD1306's datasheet which can be found easily by a quick internet search.

I searched a lot of info about that. But I didnt an example about this. I connected this pin to MCU according to my info. But it didnt work.

 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7764
  • Country: de
  • A qualified hobbyist ;)
Re: ssd1306 hal library & helping
« Reply #4 on: June 30, 2018, 04:50:07 pm »
Please see ComponentTester-1.33m.tgz (https://github.com/svn2github/transistortester/tree/master/Software/Markus) for a working implementation of a SSD1306 driver (SPI and I2C).
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: ssd1306 hal library & helping
« Reply #5 on: June 30, 2018, 05:01:57 pm »
I searched a lot of info about that. But I didnt an example about this. I connected this pin to MCU according to my info. But it didnt work.
The code you posted uses I2C, not SPI. With I2C, the DC "bit" comes in the first byte of each transaction rather than from a hardware signal. In fact, I believe the DC pin is repurposed with I2C to determine the slave address of the display.

These are basic issues that are described well in the documentation for the display.
 

Offline huseyinkTopic starter

  • Contributor
  • Posts: 11
Re: ssd1306 hal library & helping
« Reply #6 on: June 30, 2018, 05:14:09 pm »
I searched a lot of info about that. But I didnt an example about this. I connected this pin to MCU according to my info. But it didnt work.
The code you posted uses I2C, not SPI. With I2C, the DC "bit" comes in the first byte of each transaction rather than from a hardware signal. In fact, I believe the DC pin is repurposed with I2C to determine the slave address of the display.

These are basic issues that are described well in the documentation for the display.

I know that this uses I2C.. I used I2C because there is no SS/CS pin. But the site which I bought this lcd,write that this lcd compatible with spi. I am confused.  How should I do for what I drive the lcd with spi.
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: ssd1306 hal library & helping
« Reply #7 on: June 30, 2018, 05:23:00 pm »
First, this is an OLED display, not LCD.

Second, the SSD1306 controller can work with both SPI and I2C. It's up to you to determine which interface signals are available on the hardware you've got.

Here's one way to hook it up with SPI:
 

Offline huseyinkTopic starter

  • Contributor
  • Posts: 11
Re: ssd1306 hal library & helping
« Reply #8 on: June 30, 2018, 05:25:00 pm »
First, this is an OLED display, not LCD.

Second, the SSD1306 controller can work with both SPI and I2C. It's up to you to determine which interface signals are available on the hardware you've got.

Here's one way to hook it up with SPI:

My OLED doesnt have a CS or SS pin.. I try to say that. what should I do??
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11251
  • Country: us
    • Personal site
Re: ssd1306 hal library & helping
« Reply #9 on: June 30, 2018, 05:31:49 pm »
My OLED doesnt have a CS or SS pin.. I try to say that. what should I do??
What pins do you have on the actual display board? Many Chinese boards only have one interface exposed, but still claim to support all in the name. Some have resistors you can resolder to get the different interface.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf