Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSD1306 Support #45

Closed
pacmac opened this issue Nov 1, 2013 · 18 comments
Closed

SSD1306 Support #45

pacmac opened this issue Nov 1, 2013 · 18 comments

Comments

@pacmac
Copy link

pacmac commented Nov 1, 2013

Hello

Any chance that you can provide a driver for the SSD1306

http://www.eimodule.com/index.php?main_page=product_info&cPath=25&products_id=51

http://learn.adafruit.com/monochrome-oled-breakouts

This is quite a popular driver !

Many Thanks

PeterC

@notro
Copy link
Owner

notro commented Nov 2, 2013

I had a SSD1306 display on my list earlier, but I removed it when I didn't find anything to drive the Nokia 3310 monochorome display, which I had a driver for.
First I implemented the Nokia 3310 driver as a monochrome driver, but couldn't find any programs to drive it. The Linux console didn't work either. So later I implemented it as a regular RGB565 driver, and convert to monochorme when updating the display. This means that black turns the pixel off, and any other color turns the pixel on.
This way it can be used as a Linux console, but of limited value as the screen is so small.

How do you plan to use such a display? With a custom program?

@pacmac
Copy link
Author

pacmac commented Nov 2, 2013

I bought 20 of the nokia 3310 displays a few years ago on ebay for a project, but never used them and other than the 6110 it's the only SPI display I have, so that's why I have used it to prove / test the install on ARCH Linux.

I have already ordered some 3.2" and 1.8" displays for a more thourough test, but they will only arrive late next week.

But I plan to use the little 128x 64 OLED display to show the machine status i.e.:

Date/Time, Uptime, Free Ram, Free Disk, CPU %, CPU Temp etc etc

It would not really be practical to use it as a console, it's really just for system info.

@notro
Copy link
Owner

notro commented Nov 2, 2013

What's the benefit of using a monochrome OLED display, compared to a color 1.8" TFT display (128x160)?
Size, power consumption?
I have seen the 1.8" displays as low as $6 on ebay: https://github.com/notro/fbtft/wiki/More-LCD-Modules#hy-18-spi

@pacmac
Copy link
Author

pacmac commented Nov 2, 2013

For me it's space, I'm using RPI in embedded solutions that often do not require full graphic touch screens, and to reduce costs I prefer to stick to a commercially available casing that requires only the front and rear panels to be machined.

@notro
Copy link
Owner

notro commented Nov 3, 2013

I haven't seen use cases for these tiny monochorme displays before, but this certainly is a good one.
I have ordered this one: Monochrome 1.3" 128x64 OLED graphic display (SSD1306): http://www.adafruit.com/products/938

@notro
Copy link
Owner

notro commented Nov 18, 2013

New release out with SSD1306 support.

@koenkooi
Copy link

SSD1306 and SSD1307 support is already in mainline linux: https://github.com/torvalds/linux/blob/master/drivers/video/ssd1307fb.c

And there are better drivers for other displays available as well, e.g. st7735

@notro
Copy link
Owner

notro commented Nov 22, 2013

SSD1306 and SSD1307 support is already in mainline linux

Thanks, I wasn't aware of that driver.
I would regard this as a complementary driver, as it supports I2C and not SPI.

And there are better drivers for other displays available as well, e.g. st7735

Can you elaborate on what you mean by 'better'?
Are you referring to Matt Porter's driver?

@goobiez
Copy link

goobiez commented Dec 21, 2013

Help me .. l

I have lcd tft 4.3 inchi but I can not use it because I can not make a driver for raspberries like you, can you can provide a driver for the SSD1963

http://www.emartee.com/product/42175/

Many Thanks

@notro notro mentioned this issue Dec 21, 2013
@notro
Copy link
Owner

notro commented Dec 21, 2013

I have opened another issue, as this request has nothing to do with this issue.

@notro
Copy link
Owner

notro commented Mar 18, 2014

Closing issue since there has been no activity for more than 2 months. Reopen if needed.

@notro notro closed this as completed Mar 18, 2014
@cmcqueen
Copy link

I'm trying to use this driver, by cross-compiling. I've followed the instructions as best I can here and here. I'm compiling kernel 3.12.20+ (branch rpi-3.12.y, commit eb514e9620).

When I try booting, I get an error in /var/log/messages:

May 20 07:17:22 raspberrypi kernel: [   16.211083] fb_ssd1306 spi0.0: no default functions for regwidth=8 and buswidth=0
May 20 07:17:22 raspberrypi kernel: [   16.232274] ------------[ cut here ]------------
May 20 07:17:22 raspberrypi kernel: [   16.238594] WARNING: CPU: 0 PID: 336 at drivers/gpio/gpiolib.c:160 gpio_ensure_requested+0x6c/0xe8()
May 20 07:17:22 raspberrypi kernel: [   16.251039] autorequest GPIO-23
May 20 07:17:22 raspberrypi kernel: [   16.255782] Modules linked in: fb_ssd1306(+) fbtft syscopyarea sysfillrect sysimgblt fb_sys_fops snd_soc_bcm2708_i2s regmap_mmio snd_soc_core snd_compress regmap_i2c snd_pcm_dmaengine regmap_spi snd_pcm snd_page_alloc snd_seq snd_seq_device snd_timer leds_gpio led_class snd spi_bcm2708
May 20 07:17:22 raspberrypi kernel: [   16.288083] CPU: 0 PID: 336 Comm: modprobe Not tainted 3.12.20+ #2
May 20 07:17:22 raspberrypi kernel: [   16.296010] [<c001444c>] (unwind_backtrace+0x0/0xec) from [<c001172c>] (show_stack+0x10/0x14)
May 20 07:17:22 raspberrypi kernel: [   16.307879] [<c001172c>] (show_stack+0x10/0x14) from [<c001f794>] (warn_slowpath_common+0x68/0x88)
May 20 07:17:22 raspberrypi kernel: [   16.320347] [<c001f794>] (warn_slowpath_common+0x68/0x88) from [<c001f7e4>] (warn_slowpath_fmt+0x30/0x40)
May 20 07:17:22 raspberrypi kernel: [   16.333460] [<c001f7e4>] (warn_slowpath_fmt+0x30/0x40) from [<c0264edc>] (gpio_ensure_requested+0x6c/0xe8)
May 20 07:17:22 raspberrypi kernel: [   16.346691] [<c0264edc>] (gpio_ensure_requested+0x6c/0xe8) from [<c0265814>] (gpiod_direction_input+0x5c/0x1bc)
May 20 07:17:22 raspberrypi kernel: [   16.360419] [<c0265814>] (gpiod_direction_input+0x5c/0x1bc) from [<bf0cf250>] (fbtft_free_gpios+0x64/0xc8 [fbtft])
May 20 07:17:22 raspberrypi kernel: [   16.374454] [<bf0cf250>] (fbtft_free_gpios+0x64/0xc8 [fbtft]) from [<bf0d0064>] (fbtft_register_framebuffer+0x19c/0x310 [fbtft])
May 20 07:17:22 raspberrypi kernel: [   16.389758] [<bf0d0064>] (fbtft_register_framebuffer+0x19c/0x310 [fbtft]) from [<bf0d13f8>] (fbtft_probe_common+0x144/0x2d8 [fbtft])
May 20 07:17:22 raspberrypi kernel: [   16.405488] [<bf0d13f8>] (fbtft_probe_common+0x144/0x2d8 [fbtft]) from [<c02a7290>] (really_probe+0x60/0x1e4)
May 20 07:17:22 raspberrypi kernel: [   16.419170] [<c02a7290>] (really_probe+0x60/0x1e4) from [<c02a7500>] (__driver_attach+0x98/0x9c)
May 20 07:17:22 raspberrypi kernel: [   16.431700] [<c02a7500>] (__driver_attach+0x98/0x9c) from [<c02a5824>] (bus_for_each_dev+0x60/0x94)
May 20 07:17:22 raspberrypi kernel: [   16.444516] [<c02a5824>] (bus_for_each_dev+0x60/0x94) from [<c02a6b0c>] (bus_add_driver+0x1c4/0x274)
May 20 07:17:22 raspberrypi kernel: [   16.457396] [<c02a6b0c>] (bus_add_driver+0x1c4/0x274) from [<c02a7b78>] (driver_register+0x78/0xf8)
May 20 07:17:22 raspberrypi kernel: [   16.470236] [<c02a7b78>] (driver_register+0x78/0xf8) from [<bf0df00c>] (fbtft_driver_module_init+0xc/0x30 [fb_ssd1306])
May 20 07:17:22 raspberrypi kernel: [   16.484839] [<bf0df00c>] (fbtft_driver_module_init+0xc/0x30 [fb_ssd1306]) from [<c000861c>] (do_one_initcall+0x114/0x17c)
May 20 07:17:22 raspberrypi kernel: [   16.499597] [<c000861c>] (do_one_initcall+0x114/0x17c) from [<c006cc2c>] (load_module+0x1988/0x1e98)
May 20 07:17:22 raspberrypi kernel: [   16.512498] [<c006cc2c>] (load_module+0x1988/0x1e98) from [<c006d218>] (SyS_init_module+0xdc/0xf0)
May 20 07:17:22 raspberrypi kernel: [   16.525209] [<c006d218>] (SyS_init_module+0xdc/0xf0) from [<c000dec0>] (ret_fast_syscall+0x0/0x30)
May 20 07:17:22 raspberrypi kernel: [   16.537929] ---[ end trace e2cac251df303484 ]---
May 20 07:17:22 raspberrypi kernel: [   16.546423] fb_ssd1306: probe of spi0.0 failed with error -22

I tried adding .buswidth = 8 in struct fbtft_display display in fb_ssd1306.c. That seems to get rid of that error.

But I'm still getting the other error fb_ssd1306: probe of spi0.0 failed with error -22. I notice there's no device /dev/spidev0.0, only a /dev/spidev0.1.

@cmcqueen
Copy link

I've got it working now. I had to add an entry { "dc", 24 }, to struct spi_board_info bcm2708_spi_devices[] in bcm2708.c. I removed the line { "backlight", 23 }, which isn't needed I guess.

@kenrestivo
Copy link

Well I'm glad you got it working. It doesn't seem to want to work at all for me, referencing here: #169

The hardware works; I can drive it beautifully using spidev and some userspace libraries. However, fbtft does not work; I just get a blank screen. I'm using the default GPIOs described in the wiki.

@pingec
Copy link

pingec commented Apr 3, 2015

Hello. notro, you mentioned that you wrote an I2C driver for SSD1306? Where can it be found? I am looking for a tiny lcd to add to the wt3020 device and have only 2 gpios to spare...

@notro
Copy link
Owner

notro commented Apr 3, 2015

I have some code, but I'm not sure how the future of fbtft is going to be, so it's still not finished.
There is however support in the kernel for ssd1306 and i2c: http://lxr.free-electrons.com/source/drivers/video/fbdev/ssd1307fb.c

@timonsku
Copy link

Is the 128x32 SPI version also supported? If not what would I need to modify in order to get it working?

@kenrestivo
Copy link

The SSD1306 is 128x32. It supports SPI. You have to set the frequency to low enough to deal with whatever wiring you have (1Mbps is fine, 6Mbps is too fast).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants