ssd1306 hal library & helping - Page 1
Forum section: electronics / general

author: huseyink
author_rank: Contributor
timestamp: June 30, 2018, 12:47:26 pm
content: 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 >> SCLD1 >> MOSIRES >> 0~Reset Mode / 1~Normal ModeDC >> I dont know connection of this pin.If someone who used this lcd,can you explain me how I should connect DC pin?

author: andyturk
author_rank: Frequent Contributor
timestamp: June 30, 2018, 02:36:45 pm
content: Quote from: huseyink on June 30, 2018, 12:47:26 pm"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.

author: madires
author_rank: Super Contributor
timestamp: June 30, 2018, 02:44:20 pm
content: 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.

author: huseyink
author_rank: Contributor
timestamp: June 30, 2018, 04:28:18 pm
content: Quote from: madires on June 30, 2018, 02:44:20 pmI 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.

author: madires
author_rank: Super Contributor
timestamp: June 30, 2018, 04:50:07 pm
content: 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).

author: andyturk
author_rank: Frequent Contributor
timestamp: June 30, 2018, 05:01:57 pm
content: Quote from: huseyink on June 30, 2018, 04:28:18 pmThe 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.

author: huseyink
author_rank: Contributor
timestamp: June 30, 2018, 05:14:09 pm
content: Quote from: andyturk on June 30, 2018, 05:01:57 pmI 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.

author: andyturk
author_rank: Frequent Contributor
timestamp: June 30, 2018, 05:23:00 pm
content: 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:

author: huseyink
author_rank: Contributor
timestamp: June 30, 2018, 05:25:00 pm
content: Quote from: andyturk on June 30, 2018, 05:23:00 pmMy OLED doesnt have a CS or SS pin.. I try to say that. what should I do??

author: ataradov
author_rank: Super Contributor
timestamp: June 30, 2018, 05:31:49 pm
content: Quote from: huseyink on June 30, 2018, 05:25:00 pmWhat 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.