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

SSD1963 support? #58

Closed
notro opened this issue Dec 21, 2013 · 63 comments
Closed

SSD1963 support? #58

notro opened this issue Dec 21, 2013 · 63 comments

Comments

@notro
Copy link
Owner

notro commented Dec 21, 2013

Copied from #45 (comment)

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
Copy link
Owner Author

notro commented Dec 21, 2013

Two days ago I ordered a display that seems to be very similar to yours: http://www.ebay.com/itm/New-5-0-800-480-TFT-LCD-Module-Display-Touch-Panel-SSD1963-For-51-AVR-STM32-/171198903887?

It will arive in 3-4 weeks. I will start working on the SSD1963 driver when it arrives.

@goobiez
Copy link

goobiez commented Dec 24, 2013

thanks you for help me..

many thanks

@strancara
Copy link

I have a simmilar driver for ssd1963 - tested on 480x272 4.3" and 5" display. You can contact me for source code.

@goobiez
Copy link

goobiez commented Jan 11, 2014

thank you so much,

2014/1/8 strancara notifications@github.com

I have a simmilar driver for ssd1963 - tested on 480x272 4.3" and 5"
display. You can contact me for source code.


Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-31792055
.

@goobiez
Copy link

goobiez commented Jan 11, 2014

can request source code,

2014/1/11 agus sanjaya goobiez11@gmail.com

thank you so much,

2014/1/8 strancara notifications@github.com

I have a simmilar driver for ssd1963 - tested on 480x272 4.3" and 5"
display. You can contact me for source code.


Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-31792055
.

@notro
Copy link
Owner Author

notro commented Jan 12, 2014

I have received my SSD1963 displays and started testing. I'm using the flexfb driver, but there are some problems that might be caused by an inadequate power supply. Console works fine, fullscreen movie gives periodic displacement of horizontal lines. In X windows items are displaced to the right, jumping back and forth as I move the mouse.
Measuring the voltage at TP1 gives 4.67 volts which is below the required minimum of 4.75.
These displays are also powered from the 3.3 v rail instead of the 5.0v rail.
I have to try this later with a power supply that can give me a minimum of 4.75 with the display connected.
Maybe I have to get a 3.3 regulator as well, since the docs say we can pull max. 50mA from the 3.3 rail.

Nevertheless, it is possible to use the flexfb driver with the SSD1963. I will make a dedicated driver when I have sorted out these problems.

5.0" - 800x480
Product page: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=171198903887
Uses 0.34A @ 3.3V
3.3V rail voltage: 3.19V

sudo modprobe --first-time flexfb width=800 height=480 buswidth=16 init=-1,0xE2,0x23,0x02,0x04,-1,0xE0,0x01,-2,1,-1,0xE0,0x03,-2,5,-1,0x01,-2,5,-1,0xE6,0x03,0xff,0xff,-1,0xB0,0x27,0x00,0x03,0x1F,0x01,0xDF,0x00,-1,0xB4,0x03,0xA0,0x00,0x2E,0x30,0x00,0x0F,0x00,-1,0xB6,0x02,0x0D,0x00,0x10,0x10,0x00,0x08,-1,0xBA,0x0F,-1,0xB8,0x07,0x01,-1,0x36,0x00,-1,0xF0,0x03,-2,5,-1,0x29,-1,0xd0,0x0d,-3
sudo modprobe --first-time fbtft_device name=flexpfb debug=3 gpios=reset:29,dc:2,wr:31,db00:11,db01:9,db02:10,db03:22,db04:27,db05:17,db06:4,db07:3,db08:7,db09:8,db10:25,db11:24,db12:23,db13:18,db14:14,db15:15 rotate=0

FPS debug output
[32682.726095] flexfb flexpfb.0: Display update: 3839 kB/s (195.315 ms), fps=3 (250.118 ms)

4.3" - 480x272
Product page: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=181283191283
Uses 0.50A @ 3.3V
3.3V rail voltage: 3.18V

sudo modprobe --first-time flexfb width=480 height=272 buswidth=16 init=-1,0xE2,0x2d,0x02,0x04,-1,0xE0,0x01,-2,1,-1,0xE0,0x03,-2,5,-1,0x01,-2,5,-1,0xE6,0x00,0xff,0xbe,-1,0xB0,0x20,0x00,0x01,0xDF,0x01,0x0F,0x00,-2,5,-1,0xB4,0x02,0x13,0x00,0x2B,0x0A,0x00,0x08,0x00,-1,0xB6,0x01,0x20,0x00,0x0C,0x0A,0x00,0x04,-1,0x36,0x00,-1,0xF0,0x03,-2,5,-1,0x29,-1,0xBE,0x06,0xf0,0x01,0xf0,0x00,0x00,-1,0xd0,0x0d,-1,0xB8,0x00,0x01,-1,0xBA,0x00,-3
sudo modprobe --first-time fbtft_device name=flexpfb debug=3 gpios=reset:29,dc:2,wr:31,db00:11,db01:9,db02:10,db03:22,db04:27,db05:17,db06:4,db07:3,db08:7,db09:8,db10:25,db11:24,db12:23,db13:18,db14:14,db15:15 rotate=0

FPS debug output
[34253.633864] flexfb flexpfb.0: Display update: 4079 kB/s (62.513 ms), fps=9 (109.970 ms)

@strancara
Copy link

RPi’s power supply is for sure not powerfull enough for a 4.3” pannel. I am using 3.3V LDO (from +5V) in my design. Even with this the module can not be hot-plugged onto RPi – it causes a voltage dip and a RPi restart... No problems if it is connected before plugging the power.

@notro
Copy link
Owner Author

notro commented Jan 12, 2014

RPi’s power supply is for sure not powerfull enough for a 4.3” pannel. I am using 3.3V LDO (from +5V) in my design.

Thanks, I'll order one.

How are you going to connect the display, parallel?

I will try both parallel (which I have done) and using my SPI interface circuit. The circuit didn't work well with DMA on my Sainsmart 3.2" display (SSD1289) though.

I don't use these displays, I just make them work with Linux and the Raspberry Pi. My kind of fun :-)

SSD1963 is (unlike ssd1289 and some others)sensitive to the waveform on control pins. Make sure you first drive the CS\ low before WR\ and WR\ back high before CS.

I have just wired /CS permanently low.

With a parallel bus connection, I drive the bus GPIOs directly through the hardware registers to get a bit of extra speed (~15% speedup). This worked fine on the 8-bit ITDB2.8 (ILI9325).
The 16-bit Sainsmart 3.2" (SSD1289) didn't handle that well, so I had to use regular kernel functions to slow it down.
The SSD1963 seem to handle the fast approach, but I won't be certain until I have tried it with enough power.

@dawys
Copy link

dawys commented Feb 2, 2014

Hi everybody,

i have a 7" tft with an SSD1963. My wirering is:
T_CLK => SCLK
T_CS => CE0
T_DIN => MOSI
T_DO => MISO
RS => GPIO18
RESET => GPIO25

I start fbtft with:
modprobe flexfb width=800 height=480 buswidth=8 init=-1,0xE2,0x23,0x02,0x04,-1,0xE0,0x01,-2,1,-1,0xE0,0x03,-2,5,-1,0x01,-2,5,-1,0xE6,0x03,0xff,0xff,-1,0xB0,0x27,0x00,0x03,0x1F,0x01,0xDF,0x00,-1,0xB4,0x03,0xA0,0x00,0x2E,0x30,0x00,0x0F,0x00,-1,0xB6,0x02,0x0D,0x00,0x10,0x10,0x00,0x08,-1,0xBA,0x0F,-1,0xB8,0x07,0x01,-1,0x36,0x00,-1,0xF0,0x03,-2,5,-1,0x29,-1,0xd0,0x0d,-3

modprobe fbtft_device name=flexfb cs=1 gpios=dc:18,reset:25 debug=3

the syslog output is:
Feb 2 12:26:00 raspberrypi kernel: [ 115.425986] fbtft_device: GPIOS used by 'flexfb':
Feb 2 12:26:00 raspberrypi kernel: [ 115.426000] fbtft_device: 'dc' = GPIO18
Feb 2 12:26:00 raspberrypi kernel: [ 115.426010] fbtft_device: 'reset' = GPIO25
Feb 2 12:26:00 raspberrypi kernel: [ 115.426019] fbtft_device: SPI devices registered:
Feb 2 12:26:00 raspberrypi kernel: [ 115.426035] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
Feb 2 12:26:00 raspberrypi kernel: [ 115.426048] fbtft_device: flexfb spi0.1 32000kHz 8 bits mode=0x00
Feb 2 12:28:05 raspberrypi kernel: [ 240.697213] fbtft_device: SPI devices registered:
Feb 2 12:28:05 raspberrypi kernel: [ 240.697267] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
Feb 2 12:28:05 raspberrypi kernel: [ 240.697280] fbtft_device: 'fb' Platform devices registered:
Feb 2 12:28:05 raspberrypi kernel: [ 240.697301] fbtft_device: bcm2708_fb id=-1 pdata? no
Feb 2 12:28:05 raspberrypi kernel: [ 240.701327] flexfb spi0.1: fbtft_request_gpios: 'dc' = GPIO18
Feb 2 12:28:05 raspberrypi kernel: [ 240.701367] flexfb spi0.1: fbtft_request_gpios: 'reset' = GPIO25
Feb 2 12:28:05 raspberrypi kernel: [ 240.701385] flexfb spi0.1: flexfb_verify_gpios_dc()
Feb 2 12:28:05 raspberrypi kernel: [ 240.701404] flexfb spi0.1: fbtft_init_display()
Feb 2 12:28:05 raspberrypi kernel: [ 240.701421] flexfb spi0.1: fbtft_reset()
Feb 2 12:28:05 raspberrypi kernel: [ 240.836347] flexfb spi0.1: init: write(0xE2) 0x23 0x02 0x04
Feb 2 12:28:05 raspberrypi kernel: [ 240.836516] flexfb spi0.1: init: write(0xE0) 0x01
Feb 2 12:28:05 raspberrypi kernel: [ 240.836620] flexfb spi0.1: init: mdelay(1)
Feb 2 12:28:05 raspberrypi kernel: [ 240.837644] flexfb spi0.1: init: write(0xE0) 0x03
Feb 2 12:28:05 raspberrypi kernel: [ 240.837751] flexfb spi0.1: init: mdelay(5)
Feb 2 12:28:05 raspberrypi kernel: [ 240.842774] flexfb spi0.1: init: write(0x01)
Feb 2 12:28:05 raspberrypi kernel: [ 240.842851] flexfb spi0.1: init: mdelay(5)
Feb 2 12:28:05 raspberrypi kernel: [ 240.848308] flexfb spi0.1: init: write(0xE6) 0x03 0xFF 0xFF
Feb 2 12:28:05 raspberrypi kernel: [ 240.848483] flexfb spi0.1: init: write(0xB0) 0x27 0x00 0x03 0x1F 0x01 0xDF 0x00
Feb 2 12:28:05 raspberrypi kernel: [ 240.848614] flexfb spi0.1: init: write(0xB4) 0x03 0xA0 0x00 0x2E 0x30 0x00 0x0F 0x00
Feb 2 12:28:05 raspberrypi kernel: [ 240.848739] flexfb spi0.1: init: write(0xB6) 0x02 0x0D 0x00 0x10 0x10 0x00 0x08
Feb 2 12:28:05 raspberrypi kernel: [ 240.848854] flexfb spi0.1: init: write(0xBA) 0x0F
Feb 2 12:28:05 raspberrypi kernel: [ 240.848958] flexfb spi0.1: init: write(0xB8) 0x07 0x01
Feb 2 12:28:05 raspberrypi kernel: [ 240.849069] flexfb spi0.1: init: write(0x36) 0x00
Feb 2 12:28:05 raspberrypi kernel: [ 240.849172] flexfb spi0.1: init: write(0xF0) 0x03
Feb 2 12:28:05 raspberrypi kernel: [ 240.849268] flexfb spi0.1: init: mdelay(5)
Feb 2 12:28:05 raspberrypi kernel: [ 240.855609] flexfb spi0.1: init: write(0x29)
Feb 2 12:28:05 raspberrypi kernel: [ 240.855730] flexfb spi0.1: init: write(0xD0) 0x0D
Feb 2 12:28:05 raspberrypi kernel: [ 241.137250] flexfb spi0.1: Display update: 2665 kB/s (281.377 ms), fps=0 (0.000 ms)
Feb 2 12:28:05 raspberrypi kernel: [ 241.137284] flexfb spi0.1: fbtft_register_backlight()
Feb 2 12:28:05 raspberrypi kernel: [ 241.137302] flexfb spi0.1: fbtft_register_backlight(): led pin not set, exiting.
Feb 2 12:28:05 raspberrypi kernel: [ 241.137943] graphics fb1: flexfb frame buffer, 800x480, 750 KiB video memory, 4 KiB buffer memory, fps=20, spi0.1 at 32 MHz
Feb 2 12:28:05 raspberrypi kernel: [ 241.138000] fbtft_device: GPIOS used by 'flexfb':
Feb 2 12:28:05 raspberrypi kernel: [ 241.138015] fbtft_device: 'dc' = GPIO18
Feb 2 12:28:05 raspberrypi kernel: [ 241.138026] fbtft_device: 'reset' = GPIO25
Feb 2 12:28:05 raspberrypi kernel: [ 241.138036] fbtft_device: SPI devices registered:
Feb 2 12:28:05 raspberrypi kernel: [ 241.138052] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
Feb 2 12:28:05 raspberrypi kernel: [ 241.138065] fbtft_device: flexfb spi0.1 32000kHz 8 bits mode=0x00

But my display is completly white.

Can anybody help me please?

@notro
Copy link
Owner Author

notro commented Feb 2, 2014

The pins starting with T_ is for the touch panel controller. I guess the display has a 16-bit databus.
Like the one I tried further up the thread.

@giasone
Copy link

giasone commented Feb 4, 2014

Hi, I'm try to connect a 5.0" tft with a ssd1963 controller in parallel. i follow the connection as notro says in his post in the gpios section, also cs to gnd and power from external 3,3v circuit. what i get is only vertical colored link. nowhere i find where to connect RD ( no RS/DC). do you have some hints? I've double cheked all connections and all wirings are well connected.
thanks

@notro
Copy link
Owner Author

notro commented Feb 4, 2014

Hi, I'm try to connect a 5.0" tft with a ssd1963 controller in parallel.

Do you have a product page link?
RD should be tied HIGH (not used)
RS/DC has to be somewhere. This signal determine whether the data on the interface is for the index register or if it is register data/GRAM data.

@giasone
Copy link

giasone commented Feb 4, 2014

The product it's the same linked above, same seller. I already try to not connect RD. ED/DC in on GPIO2. I have to load something else?
thx

@notro
Copy link
Owner Author

notro commented Feb 4, 2014

It's difficult to answer when you give so little information. People jump in all the time in these issues, so it's hard to know what the facts are.
If you are using this:

sudo modprobe --first-time flexfb width=800 height=480 buswidth=16 init=-1,0xE2,0x23,0x02,0x04,-1,0xE0,0x01,-2,1,-1,0xE0,0x03,-2,5,-1,0x01,-2,5,-1,0xE6,0x03,0xff,0xff,-1,0xB0,0x27,0x00,0x03,0x1F,0x01,0xDF,0x00,-1,0xB4,0x03,0xA0,0x00,0x2E,0x30,0x00,0x0F,0x00,-1,0xB6,0x02,0x0D,0x00,0x10,0x10,0x00,0x08,-1,0xBA,0x0F,-1,0xB8,0x07,0x01,-1,0x36,0x00,-1,0xF0,0x03,-2,5,-1,0x29,-1,0xd0,0x0d,-3
sudo modprobe --first-time fbtft_device name=flexpfb debug=3 gpios=reset:29,dc:2,wr:31,db00:11,db01:9,db02:10,db03:22,db04:27,db05:17,db06:4,db07:3,db08:7,db09:8,db10:25,db11:24,db12:23,db13:18,db14:14,db15:15 rotate=0

Then RS should be connected to GPIO2, WR connected to GPIO31 and RD tied HIGH (3.3V).

@giasone
Copy link

giasone commented Feb 4, 2014

Hi,
thanks Notro for the quick reply. I apologize if the informations provided are so poor, but really I don't know what is usefull to know to troubleshoot my problem. I'll try to be more accurate:

The display is 5.0" - 800x480
Product page: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=171198903887
Uses 0.34A @ 3.3V
3.3V rail voltage: 3.19V

Raspberry Pi image with FBTFT support
2013-12-20-wheezy-raspbian-2014-01-03-fbtft.zip

connected as
LCD -> RaspberryPI

RST -> GPIO29
RS/DC -> GPIO2
WR -> GPIO31
RD -> 3.3V
LED_A -> 3.3V
CS -> GND
db00 -> GPIO11
db01 -> GPIO9
db02 -> GPIO10
db03 -> GPIO22
db04 -> GPIO27
db05 -> GPIO17
db06 -> GPIO4
db07 -> GPIO3
db08 -> GPIO7
db09 -> GPIO8
db10 -> GPIO25
db11 -> GPIO24
db12 -> GPIO23
db13 -> GPIO18
db14 -> GPIO14
db15 -> GPIO15

I've typed in the terminal exactly what you have posted in your last comment and the result is
foto

let me know if you want know more.
Many Thanks

@notro
Copy link
Owner Author

notro commented Feb 4, 2014

That's much better.
The connections looks fine to me.
The stripes on the display indicates that some info is getting through to the display.
Here is an example of the random nature when display memory has not been touched after poweron: #75 (comment)

In this situation I would use a script I made to verfiy the connections on the LCD header, to be sure there is no miswiring. I had to make the script because I couldn't get a display working, and it turned out I had swapped two databus wires.
https://github.com/notro/fbtft/wiki/Troubleshooting#wiki-wiring

@dawys
Copy link

dawys commented Feb 8, 2014

Connecting the CS of the dsiplay to Ground causes this image at startup.

do I have to connect sd_cs and t_cs also to ground?

Maybe the init parameter are wrong?

init=-1,0xE2,0x23,0x02,0x04,-1,0xE0,0x01,-2,1,-1,0xE0,0x03,-2,5,-1,0x01,-2,5,-1,0xE6,0x03,0xff,0xff,-1,0xB0,0x27,0x00,0x03,0x1F,0x01,0xDF,0x00,-1,0xB4,0x03,0xA0,0x00,0x2E,0x30,0x00,0x0F,0x00,-1,0xB6,0x02,0x0D,0x00,0x10,0x10,0x00,0x08,-1,0xBA,0x0F,-1,0xB8,0x07,0x01,-1,0x36,0x00,-1,0xF0,0x03,-2,5,-1,0x29,-1,0xd0,0x0d,-3

20140208_163009_1

@notro
Copy link
Owner Author

notro commented Feb 9, 2014

@dawys is the backlight connected to 3.3V on the Raspberry Pi?
If so, that might give you problems, because it's pulling to much current.
Please measure the backlight current.
Also measure the voltage at TP1, it should be 4.75V. Mine was 4.67V, so I ordered an extra voltage regulator. I haven't had time to try it yet.

@Plottr
Copy link

Plottr commented Feb 21, 2014

hey trying to get a 5" screen with the ssd1963 chip.
When i connect 3.3v to the vcc pin and gnd to the gnd pin nothing happens, then i wired it up for the flexfb driver and nothing happens, only time the panel did anything was when i removed the 3.3v wire and touched the 5v pin on my psu by accident and it lit up all white but still the only time anything happend at all.

Its a similar displat that you posted from Ebay earlier in the post notro. But its from Dx http://dx.com/p/800-x-480-5-0-lcd-tft-touch-screen-module-w-stylus-pen-for-arduino-blue-154505#.UwdvMHOJCIs

@notro
Copy link
Owner Author

notro commented Feb 21, 2014

hey trying to get a 5" screen with the ssd1963 chip.

From the product page: Model: TFT01-5.0

This page describes a product with the same name, and it has a schematic in the Material download file: http://www.elecfreaks.com/store/50-tft-lcd-screen-module-tft0150-p-420.html

Try connecting Vcc and and LED-A to 3.3V and Gnd to Gnd. That should light up the display.

@Plottr
Copy link

Plottr commented Feb 21, 2014

Yeah i have found the eledmfreaks page as well.
Tried your suggestion no result, must have broken the whole thing in some way.
I'm going to order a new one but it will take a while to get it delivered from China, will return with the result after that.

Thanks for the help.

@t0mac0
Copy link

t0mac0 commented Feb 23, 2014

Hi, best regards
I have a 7in TFT 800x480 with SSD1963 controller but is configured @8bits, how I can port this flexfb to my LCD.

Thank you for your help

@notro
Copy link
Owner Author

notro commented Feb 23, 2014

I have a 7in TFT 800x480 with SSD1963 controller but is configured @8bits, how I can port this flexfb to my LCD.

Set buswidth=8, init= to match your display and skip gpios= db08 to db15

@t0mac0
Copy link

t0mac0 commented Feb 23, 2014

Right, I already connected the LCD
RST -> GPIO29
RS/DC -> GPIO2
WR -> GPIO31
RD -> 3.3V
LED_A -> 3.3V
CS -> GND
db00 -> GPIO11
db01 -> GPIO9
db02 -> GPIO10
db03 -> GPIO22
db04 -> GPIO27
db05 -> GPIO17
db06 -> GPIO4
db07 -> GPIO3
and add the files into kernel source, select as "M"
Support for small TFT LCD display modules --->
Generic FB driver for TFT LCD displays
Module to for adding FBTFT devices
but doesn't work.
I type
modprobe flexfb width=800 height=480 buswidth=8 init=-1,0xE2,0x23,0x02,0x04,-1,0xE0,0x01,-2,1,-1,0xE0,0x03,-2,5,-1,0x01,-2,5,-1,0xE6,0x03,0xff,0xff,-1,0xB0,0x27,0x00,0x03,0x1F,0x01,0xDF,0x00,-1,0xB4,0x03,0xA0,0x00,0x2E,0x30,0x00,0x0F,0x00,-1,0xB6,0x02,0x0D,0x00,0x10,0x10,0x00,0x08,-1,0xBA,0x0F,-1,0xB8,0x07,0x01,-1,0x36,0x00,-1,0xF0,0x03,-2,5,-1,0x29,-1,0xd0,0x0d,-3

modprobe fbtft_device name=flexfb cs=1 gpios=dc:18,reset:25 debug=3

Thank you for your help.

@notro
Copy link
Owner Author

notro commented Feb 24, 2014

modprobe fbtft_device name=flexfb cs=1 gpios=dc:18,reset:25 debug=3

You have to use the flexpfb device, there's a 'p' in there (parallel), and specify all the pins.

Like this:

sudo modprobe fbtft_device name=flexpfb debug=3 gpios=reset:29,dc:2,wr:31,db00:11,db01:9,db02:10,db03:22,db04:27,db05:17,db06:4,db07:3

@t0mac0
Copy link

t0mac0 commented Feb 25, 2014

is a advance, it works halfway, I think that is because, in 8 bits mode the SSD1963 need 3 bytes for color like appears in this table. and I think the driver is only sending 2 bytes. If I'm right in what file I've to modify the routine that send the pixels?.
config_2

img_20140224_234617

img_20140224_234655

@notro
Copy link
Owner Author

notro commented Feb 25, 2014

The driver sends RGB565 in two bytes. If the display controller expected 3 bytes, the display would only be filled 66% with a distorted image.
You could try adjusting the gamma curve.

See if you can get some example code for that display. It usually contains the correct init sequence for the display.

@t0mac0
Copy link

t0mac0 commented Feb 26, 2014

Hi, again you are right, I changed the init config to 8 bits and the display look like this
command 0x0F
parameter 0x03 //565 16 bits
to
command 0x0F
parameter 0x00 //pixel format 8 bits

img_20140225_231312

detailed
img_20140225_231303

img_20140225_232507

It must have to convert the 565 format 16 bits, to 8 bits format and send 3 bytes instead 2 bytes, where is the routine that draw a pixel in LCD?

@notro
Copy link
Owner Author

notro commented Feb 26, 2014

It must have to convert the 565 format 16 bits, to 8 bits format and send 3 bytes instead 2 bytes, where is the routine that draw a pixel in LCD?

Why do want to change that, when the display controller supports RGB565? This will not affect the colors, just how the pixels are transferred.

The gamma curve is used to change the intensity of the colors.
See 9.14 Set Gamma Curve in the datasheet. 4 curves to choose from.

fbtft_write_vmem16_bus8() is used to transfer video memory in your case: https://github.com/notro/fbtft/blob/master/fbtft-bus.c#L130

@t0mac0
Copy link

t0mac0 commented Feb 27, 2014

Sorry but I do not want to be annoying, you have been nice to me in answering my questions, I need to handle touch screen along with the module touch, the module works perfectly, but I've had too many problems with TFT. I followed all your advice, but does not correct the errors. could you test with your TFT.
I changed
9.76 Set Pixel Data Interface
9.29 Set Pixel Format
9.14 Set Gamma Curve

this is a specific driver to ssd1963, I compiled into the kernel but doesn't start. there is the aswer to port to 8 bits bus

https://www.assembla.com/code/edmar_playground/subversion/nodes/24/trunk/embedded/RaspberryPi

http://www.youtube.com/watch?v=4U9TWmFlZDo

There are two drivers in the SVN repo:

  1. Driver in userspace that mmaps the GPIO region and writes the gpio-register directly
  2. Real kernel framebuffer driver. This driver is a little slower than the usespace driver though
    I recommend using the userspace driver.
    To use 8 Bit bus you need to configure the init routine for 8 Bit mode (e.g. by sending the 0xF0 command with data 0).
    In tft_lcfg.c change line 52 from {0x00F0, 0x0003, 5U, PARAM}, // pixel data interface 16 bit 0b011 is 16 Bit
    to {0x00F0, 0x0000, 5U, PARAM}, // pixel data interface 8 bit 0b000 is 8 Bit

To manage 8 Bit communicatin you need to adapt dio_writePortGroup to use 8 Pins instead of 16 in dio.c. Note that here the used Pins for the bus are defined.
Now in tft.c adapt tft_sendPixelData to use three writes instead of one. Have a look at www.microtipsusa.com/pdf/SSD1963.pdf page 16. You need to split the data in three sending routines.
Change tft_sendPixelData() in tft.c line 43 to:
void tft_sendPixelData
(
uint16 data_ui16
)
{
tft_selectRS();
dio_writePortGroup((uint8)((data_ui16 >> 9) & 0xF8));
tft_deSelectWR();
tft_selectWR();

dio_writePortGroup((uint8)((data_ui16 >> 3) & 0xFC));
tft_deSelectWR();
tft_selectWR();

dio_writePortGroup((uint8)((data_ui16 << 3) & 0xF8));
tft_deSelectWR();
tft_selectWR();
}

That's it.
NOTE: With this high resolution and 3 writes per pixel you won't be able to watch videos or yo high framerates on the display. If you can manage to give at least 9 bits for the display bus you can reduce writing cycles to 2. This would speed up the display 33%!

@notro
Copy link
Owner Author

notro commented Jul 14, 2014

From UTFT\tft_drivers\ssd1963\800alt

case SSD1963_800ALT:
    LCD_Write_COM(0xE2);        //PLL multiplier, set PLL clock to 120M
    LCD_Write_DATA(0x23);       //N=0x36 for 6.5M, 0x23 for 10M crystal
    LCD_Write_DATA(0x02);
    LCD_Write_DATA(0x04);
    LCD_Write_COM(0xE0);        // PLL enable
    LCD_Write_DATA(0x01);
    delay(10);
    LCD_Write_COM(0xE0);
    LCD_Write_DATA(0x03);
    delay(10);
    LCD_Write_COM(0x01);        // software reset
    delay(100);
    LCD_Write_COM(0xE6);        //PLL setting for PCLK, depends on resolution
    LCD_Write_DATA(0x04);
    LCD_Write_DATA(0x93);
    LCD_Write_DATA(0xE0);

    LCD_Write_COM(0xB0);        //LCD SPECIFICATION
    LCD_Write_DATA(0x00);   // 0x24
    LCD_Write_DATA(0x00);
    LCD_Write_DATA(0x03);       //Set HDP   799
    LCD_Write_DATA(0x1F);
    LCD_Write_DATA(0x01);       //Set VDP   479
    LCD_Write_DATA(0xDF);
    LCD_Write_DATA(0x00);

    LCD_Write_COM(0xB4);        //HSYNC
    LCD_Write_DATA(0x03);       //Set HT    928
    LCD_Write_DATA(0xA0);
    LCD_Write_DATA(0x00);       //Set HPS   46
    LCD_Write_DATA(0x2E);
    LCD_Write_DATA(0x30);       //Set HPW   48
    LCD_Write_DATA(0x00);       //Set LPS   15
    LCD_Write_DATA(0x0F);
    LCD_Write_DATA(0x00);

    LCD_Write_COM(0xB6);        //VSYNC
    LCD_Write_DATA(0x02);       //Set VT    525
    LCD_Write_DATA(0x0D);
    LCD_Write_DATA(0x00);       //Set VPS   16
    LCD_Write_DATA(0x10);
    LCD_Write_DATA(0x10);       //Set VPW   16
    LCD_Write_DATA(0x00);       //Set FPS   8
    LCD_Write_DATA(0x08);

    LCD_Write_COM(0xBA);
    LCD_Write_DATA(0x05);       //GPIO[3:0] out 1

    LCD_Write_COM(0xB8);
    LCD_Write_DATA(0x07);       //GPIO3=input, GPIO[2:0]=output
    LCD_Write_DATA(0x01);       //GPIO0 normal

    LCD_Write_COM(0x36);        //rotation
    LCD_Write_DATA(0x02);       // -- Set to 0x01 to rotate 180 degrees

    LCD_Write_COM(0xF0);        //pixel data interface
    LCD_Write_DATA(0x03);


    delay(10);

    setXY(0, 0, 799, 479);
    LCD_Write_COM(0x29);        //display on

    LCD_Write_COM(0xBE);        //set PWM for B/L
    LCD_Write_DATA(0x06);
    LCD_Write_DATA(0xF0);
    LCD_Write_DATA(0x01);
    LCD_Write_DATA(0xF0);
    LCD_Write_DATA(0x00);
    LCD_Write_DATA(0x00);

    LCD_Write_COM(0xD0); 
    LCD_Write_DATA(0x0D);   

    LCD_Write_COM(0x2C); 
    break;

Before LCD_Write_COM value you add -1, and before delay value you add -2, and end it all with -3

init=-1,0xE2,0x23,0x02,0x04,-1,0xE0,0x01,-2,10, and so on,-3

@jamesdownsbell
Copy link

Hi notro,
Thank you for your help with this. I am waiting for my 7" ssd1963 to arrive from china .
When in gets here I will try the code and report the results.
Thanks again

Edit : hi again lol
I got my model B+ today and after rpi-update everything is still working flawlessly

@notro notro mentioned this issue Jul 21, 2014
@notro notro mentioned this issue Jul 30, 2014
@jamesdownsbell
Copy link

Hi notro,
Me again lol. I have received my 7" ssd1963 I have wrote the initialisation code you helped me with earlier, But I seem to be missing something the screen starts but the colors are distorted and the image is inverted. I can't see where I'm going wrong 👎 any input at this point would be helpful as I am scratching my head lol.
Thanks once again for your help

Edit : I've added a few pictures of the issues I mentioned
image
image
image
image

@jamesdownsbell
Copy link

Hi notro,
I've had a development,the screen is now starting as it should. 👍
The 4.3" & 7" ssd1963 screens are supported by flexfb :)
The only issue I'm finding is the image is reversed ie, the text reads from right to left.
I don't however think it is a problem with fbtft I think the issue lays with fbcp .I'm just not sure how to proceed at this point . I have attached a few images of the aforementioned issue.
Thanks once again for you help with this
image
image
image
image

@notro
Copy link
Owner Author

notro commented Aug 2, 2014

Set Address Mode, register 36h controls rotation and mirroring. You just have to try the different values. I have never understood how it works. I always end up trying different combinations until it works.
See the datasheet, maybe you understand how it ties together.

@jamesdownsbell
Copy link

Hi notro,
Thanks for your quick reply , I will check the data sheet and try to change the values then report back.
Thanks again

@jamesdownsbell
Copy link

Hi notro
You my friend are a genius 👍
I changed the 36h from 0x02 to 0x00 and just like magic it was solved.
Thanks once again.
image
image

Sorry about the image quality (crappy ipad camera)
Edit: everything is working fine other than the refresh rate seem a bit off. I have turned the speed up to 64000000 which has helped but I'm still not all the way there yet. Also I noticed changing the speed has upped the video memory 750 KiB but DMA is still at 4 KiB ? . Do think I should turn it up ?.

Edit 2 :
I have resolved the issue .It was a loose cable :). I have also uploaded a video to YouTube of the 7" screen running at 64000000.using the ultra slim raspbian,fbcp and fbtft.
Thanks again

https://m.youtube.com/watch?v=wBoRlrDtkwI

@jamesdownsbell
Copy link

Hi notro,
Just wondering what's the fastest speed you have had from the ssd1963 ?. At the moment the best I can get is 82MHz at 50fps. It still seems struggle a bit with 720p, I mean it's watchable but still not quite there yet. I'm not sure if there is anyway of improving it ?. I will upload another video and you will see what I mean.
edit: this what I am using to start the screen in case anybody else wants to give this a try 👍.
I have kept the size at 800x480 but for some reason this still set the screen to fit the 7". I am connecting the screen via a guzunty pi over spi. The init- code should be the same over parallel but you will need to change regwidth=16 to buswidth=16.
flexfb width=800 height=480 regwidth=16 init=-1,0xE2,0x23,0x02,0x04,-1,0xE0,0x01,-2,10,-1,0xE0,0x03,-2,10,-1,0x01,-2,100,-1,0xE6,0x04,0x93,0xE0,-1,0xB0,0x00,0x00,0x03,0x1f,0x01,0xdf,0x00,-1,0xB4,0x03,0xA0,0x00,0x2E,0x30,0x00,0x0f,0x00,-1,0xB6,0x02,0x0D,0x00,0x10,0x10,0x00,0x08,-1,0xBA,0x05,-1,0xB8,0x07,0x01,-1,0x36,0x00,-1,0xf0,0x03,-2,10,-1,0x29,-1,0xBE,0x06,0xf0,0x00,0x00,-1,0xd0,0x0d,-1,0x2C,-3
fbtft_device name=flexfb gpios=reset:22,dc:27 debug=3 rotate=0 verbose=0 speed=82000000 fps=50 txbuflen=0

edit 2: Heres the link to the video i have uploaded of the screen running a rom and a video (720p) @82MHz.. Sorry its so long but i could not get the video to start first time. This was my forth attempt so i just went with it. :)
http://www.youtube.com/watch?v=CKDNqlizkQk

@notro
Copy link
Owner Author

notro commented Aug 3, 2014

I'm very impressed with what you've done here. Doing 800x480 this well over SPI, quite amazing!
The only thing I can think of, is using some sort of simple compression. Is it possible to implement that in guzunty?

http://www.hwlevel.com/ uses compression in at least one of their displays.

@jamesdownsbell
Copy link

Hi notro,
Thanks for the reply, The glory is all yours :) I just followed your lead 👍 . I have seen the link you posted, but I wasn't sure if compression was possible with fbtft ? I will carry on playing with it and report back my findings. I might start a thread on the raspberry pi forum.
Thanks once again for you help with this

@notro
Copy link
Owner Author

notro commented Aug 4, 2014

I wasn't sure if compression was possible with fbtft ?

No, not currently, but that can change if guzunty can do decompression.

@jamesdownsbell
Copy link

Hi notro,
Thanks for the speedy reply, I'm sure the guzunty should be able to handle the decompression. The guys over at hwlevel are using the same cpld. However I'm not sure how this is implemented. I have contacted Derek over at guzunty to see if he can point me in the right direction. So I will let you know how I get on .
Thanks again

@tatkei
Copy link

tatkei commented Aug 6, 2014

How about using the 16-bits parallel interface. would it be any chance to get a better performance ?

@younatan
Copy link

younatan commented Apr 5, 2015

Hi notro may I ask you img file for fbtft for ssd1963? because I am using raspberry pi 2 and I cannot update my firmware thank you

@notro
Copy link
Owner Author

notro commented Apr 5, 2015

I have stopped making images, so I don't have one for the Pi2.
Using Raspian, this should get you close to the images I used to make: https://github.com/notro/fbtft/wiki/FBTFT-on-Raspian
There is fbtft support in the foundation kernels now: https://github.com/notro/fbtft/wiki#install

@RushHour99
Copy link

Hi, again you are right, I changed the init config to 8 bits and the display look like this
command 0x0F
parameter 0x03 //565 16 bits
to
command 0x0F
parameter 0x00 //pixel format 8 bits

img_20140225_231312

detailed
img_20140225_231303

img_20140225_232507

It must have to convert the 565 format 16 bits, to 8 bits format and send 3 bytes instead 2 bytes, where is the routine that draw a pixel in LCD?

Did this issue ever get resolved? I am having a similar problem when operating at buswidth=8. I get an image that seems to be superimposed on itself 3 times like the screenshot from @t0mac0 . Does the fbtft driver send the pixel data in 3 cycles as shown in this table when buswidth=8?

pixel_data_format

@navi78974
Copy link

Hello,
i am noob in rpi.
Could you help me.
I have a LCD SSD1963 WF35LTIBCDAN0# 8bit but i have only a multicolor point.

@navi78974
Copy link

i use:
sudo modprobe --first-time flexfb width=240 height=320 buswidth=8 init=-1,0x01,-2,0x0A,-1,0xE0,0x01,-2,0x05,-1,0xE0,0x03,-2,0x05,-1,0xB0,0x0C,0x80,0x01,0x3F,0x00,0xEF,0x00,-1,0xf0,0x03,-1,0x3A,0x50,-1,0xE2,0x1D,-1,0x02,0x54,-1,0xE6,0x01,0x40,0xFF,-1,0xB4,0x01,0xB8,0x00,0x44,0x07,0x00,0x00,0x00,-1,0xB6,0x01,0x08,0x00,0x12,0x07,0x00,0x00,-1,0x2A,0x00,0x00,0x01,0x3F,-1,0x2B,0x00,0x00,0x00,0xEF,-1,0x29,-1,0x2C,-3

@navi78974
Copy link

and sudo modprobe --first-time fbtft_device name=flexpfb debug=3 gpios=reset:4,dc:13,wr:12,db00:6,db01:5,db02:25,db03:24,db04:23,db05:22,db06:27,db07:18,led:26 rotate=0

@navi78974
Copy link

and dmesg it is

[ 15.453360] fuse init (API version 7.23)
[ 82.606742] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 82.611883] flexfb: module is from the staging directory, the quality is unknown, you have been warned.
[ 86.832385] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 86.833376] fbtft_device: SPI devices registered:
[ 86.833393] fbtft_device: 'fb' Platform devices registered:
[ 86.833418] fbtft_device: soc:fb id=-1 pdata? no
[ 86.833863] flexfb flexpfb.0: fbtft_request_gpios: 'reset' = GPIO4
[ 86.833893] flexfb flexpfb.0: fbtft_request_gpios: 'dc' = GPIO13
[ 86.833913] flexfb flexpfb.0: fbtft_request_gpios: 'wr' = GPIO12
[ 86.833934] flexfb flexpfb.0: fbtft_request_gpios: 'db00' = GPIO6
[ 86.833955] flexfb flexpfb.0: fbtft_request_gpios: 'db01' = GPIO5
[ 86.833975] flexfb flexpfb.0: fbtft_request_gpios: 'db02' = GPIO25
[ 86.833995] flexfb flexpfb.0: fbtft_request_gpios: 'db03' = GPIO24
[ 86.834017] flexfb flexpfb.0: fbtft_request_gpios: 'db04' = GPIO23
[ 86.834048] flexfb flexpfb.0: fbtft_request_gpios: 'db05' = GPIO22
[ 86.834068] flexfb flexpfb.0: fbtft_request_gpios: 'db06' = GPIO27
[ 86.834088] flexfb flexpfb.0: fbtft_request_gpios: 'db07' = GPIO18
[ 86.834107] flexfb flexpfb.0: fbtft_request_gpios: 'led' = GPIO26
[ 86.834120] flexfb flexpfb.0: flexfb_verify_gpios_db()
[ 86.834133] flexfb flexpfb.0: fbtft_init_display()
[ 86.834145] flexfb flexpfb.0: fbtft_reset()
[ 86.954206] flexfb flexpfb.0: init: write(0x01)
[ 86.954237] flexfb flexpfb.0: init: mdelay(10)
[ 86.964255] flexfb flexpfb.0: init: write(0xE0) 0x01
[ 86.964281] flexfb flexpfb.0: init: mdelay(5)
[ 86.969295] flexfb flexpfb.0: init: write(0xE0) 0x03
[ 86.969314] flexfb flexpfb.0: init: mdelay(5)
[ 86.974337] flexfb flexpfb.0: init: write(0xB0) 0x0C 0x80 0x01 0x3F 0x00 0xEF 0x00
[ 86.974384] flexfb flexpfb.0: init: write(0xF0) 0x03
[ 86.974406] flexfb flexpfb.0: init: write(0x3A) 0x50
[ 86.974425] flexfb flexpfb.0: init: write(0xE2) 0x1D
[ 86.974446] flexfb flexpfb.0: init: write(0x02) 0x54
[ 86.974468] flexfb flexpfb.0: init: write(0xE6) 0x01 0x40 0xFF
[ 86.974500] flexfb flexpfb.0: init: write(0xB4) 0x01 0xB8 0x00 0x44 0x07 0x00 0x00 0x00
[ 86.974540] flexfb flexpfb.0: init: write(0xB6) 0x01 0x08 0x00 0x12 0x07 0x00 0x00
[ 86.974574] flexfb flexpfb.0: init: write(0x2A) 0x00 0x00 0x01 0x3F
[ 86.974601] flexfb flexpfb.0: init: write(0x2B) 0x00 0x00 0x00 0xEF
[ 86.974625] flexfb flexpfb.0: init: write(0x29)
[ 86.974640] flexfb flexpfb.0: init: write(0x2C)
[ 87.250625] flexfb flexpfb.0: Display update: 542 kB/s (275.955 ms), fps=0 (0.000 ms)
[ 87.250646] flexfb flexpfb.0: fbtft_register_backlight()
[ 87.251150] graphics fb1: flexfb frame buffer, 240x320, 150 KiB video memory, 4 KiB DMA buffer memory, fps=20
[ 87.251168] flexfb flexpfb.0: fbtft_backlight_update_status: polarity=1, power=0, fb_blank=0
[ 87.251199] fbtft_device: GPIOS used by 'flexpfb':
[ 87.251208] fbtft_device: 'reset' = GPIO4
[ 87.251216] fbtft_device: 'dc' = GPIO13
[ 87.251223] fbtft_device: 'wr' = GPIO12
[ 87.251231] fbtft_device: 'db00' = GPIO6
[ 87.251238] fbtft_device: 'db01' = GPIO5
[ 87.251298] fbtft_device: 'db02' = GPIO25
[ 87.251308] fbtft_device: 'db03' = GPIO24
[ 87.251315] fbtft_device: 'db04' = GPIO23
[ 87.251347] fbtft_device: 'db05' = GPIO22
[ 87.251365] fbtft_device: 'db06' = GPIO27
[ 87.251382] fbtft_device: 'db07' = GPIO18
[ 87.251402] fbtft_device: 'led' = GPIO26
[ 87.251422] fbtft_device: 'fb' Platform devices registered:
[ 87.251451] fbtft_device: soc:fb id=-1 pdata? no
[ 87.251476] fbtft_device: flexpfb id=0 pdata? yes

@navi78974
Copy link

i see also
sudo fbset -fb /dev/fb1

mode "320x240"
geometry 320 240 320 240 16
timings 0 0 0 0 0 0 0
nonstd 1
rgba 5/11,6/5,5/0,0/0
endmode

and
ls -l /dev/fb*
crw-rw---- 1 root video 29, 0 Sep 20 18:45 /dev/fb0
crw-rw---- 1 root video 29, 1 Sep 20 19:08 /dev/fb1

@navi78974
Copy link

sudo FRAMEBUFFER=/dev/fb1 startx

X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-99-generic armv8l Raspbian
Current Operating System: Linux raspberrypi 4.0.7-v7+ #1 SMP PREEMPT Sat Jul 11 20:44:05 CEST 2015 armv7l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa01041 bcm2709.serial_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0xype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Build Date: 07 July 2020 09:38:51PM
xorg-server 2:1.20.4-1+rpt2 (https://www.debian.org/support)
Current version of pixman: 0.36.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Sun Sep 20 18:48:19 2020
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
modprobe: FATAL: Module g2d_23 not found in directory /lib/modules/4.0.7-v7+
^Cxinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

xinit: unexpected signal 2

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