Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

3.95 screen - ili9488 #311

Closed
kiwifruktish opened this issue Aug 17, 2015 · 67 comments
Closed

3.95 screen - ili9488 #311

kiwifruktish opened this issue Aug 17, 2015 · 67 comments

Comments

@kiwifruktish
Copy link

And here is some more info:
image

same as in #254

So the first part will probebly be if im not wrong:
sudo modprobe fbtft_device name=flexpfb rotate=180 fps=70 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8
But it is the other part im not realy sure how it should be, sudo modprobe flexfb ...

Documentation can be found at https://www.lpcware.com/system/files/ILI9488_Preliminary_DS_V090.pdf

I tested https://gist.github.com/ont/52c91e4ff090ee805e27 and it did work but i dont think the color is 100% right but it works.

When runing:
fbtft_device name=flexpfb rotate=180 fps=70 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8
flexfb width=320 height=480 buswidth=8 init=-1,0xE9,0x20,-1,0x11,-2,100,-1,0x3A,0x55,-1,0xD1,0x00,0x6B,0x19,-1,0xD0,0x07,0x07,0x80,-1,0x36,0x48,-1,0xC1,0x10,0x10,0x02,0x02,-1,0xC0,0x00,0x35,0x00,0x00,0x01,0x02,-1,0xC5,0x01,-1,0xD2,0x01,0x22,-1,0xC8,0x01,0x52,0x37,0x10,0x0D,0x01,0x04,0x51,0x77,0x01,0x01,0x0d,0x08,0x80,0x00,-1,0xEA,0x80,-1,0x29,-3

i have the fallowing info in dmesg:
[ 11.796719] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 11.823613] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 11.841446] fbtft_device: SPI devices registered:
[ 11.846408] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
[ 11.859142] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 11.865906] fbtft_device: 'fb' Platform devices registered:
[ 11.871856] fbtft_device: soc:fb id=-1 pdata? no
[ 11.880554] fbtft_device: GPIOS used by 'flexpfb':
[ 11.885527] fbtft_device: 'dc' = GPIO18
[ 11.889726] fbtft_device: 'reset' = GPIO7
[ 11.910401] fbtft_device: 'wr' = GPIO17
[ 11.914643] fbtft_device: 'cs' = GPIO4
[ 11.918726] fbtft_device: 'db00' = GPIO22
[ 11.924882] fbtft_device: 'db01' = GPIO23
[ 11.929237] fbtft_device: 'db02' = GPIO24
[ 11.933886] fbtft_device: 'db03' = GPIO10
[ 11.938259] fbtft_device: 'db04' = GPIO25
[ 11.942750] fbtft_device: 'db05' = GPIO9
[ 11.947021] fbtft_device: 'db06' = GPIO11
[ 11.951531] fbtft_device: 'db07' = GPIO8
[ 11.955834] fbtft_device: 'fb' Platform devices registered:
[ 11.961746] fbtft_device: soc:fb id=-1 pdata? no
[ 11.966941] fbtft_device: flexpfb id=0 pdata? yes
[ 12.053062] flexfb: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.745963] Console: switching to colour frame buffer device 40x60
[ 12.770403] graphics fb1: flexfb frame buffer, 320x480, 300 KiB video memory, 4 KiB DMA buffer memory, fps=100

But still no picture when adding: fbcon=map:10 fbcon=font:VGA8x8 fbcon=rotate:3 to cmd before rootwait.

@kiwifruktish
Copy link
Author

I did get better color now when making changes to https://gist.github.com/ont/52c91e4ff090ee805e27 with:

import time
import RPi.GPIO as g

g.setmode(g.BOARD)

pins = [
    7,    # cs
    11,   # wr - clock (rising edge)
    12,   # rs - data/command
    15,   # d1
    16,   # d2
    18,   # d3
    19,   # d4 (???)
    21,   # d6 (???)
    22,   # d5 (???)
    23,   # d7
    24,   # d8
    26    # rst
]

CSX = 7
DCX = 12
WRX = 11
RES = 26
D = [
    15,   # d1
    16,   # d2
    18,   # d3
    19,   # d4 (???)
    22,   # d5 (???)
    21,   # d6 (???)
    23,   # d7
    24,   # d8
]

def init():
    # prepare raspberry pins for output
    for x in pins:
        print x
        g.setup(x, g.OUT)
        g.output(x, 1)


# hard reset sequence
g.output(RES, 1)
time.sleep(0.005)  ## 5 ms
g.output(RES, 0)
time.sleep(0.015)  ## 15 ms
g.output(RES, 1)
time.sleep(0.015)  ## 15 ms

g.output(CSX, 1)
g.output(WRX, 1)
g.output(CSX, 0)



def send_data(cs, byte):
g.output(DCX, cs)
g.output(WRX, 0)
for i in xrange(8):
g.output( D[i], (byte >> i) & 1 )
g.output(WRX, 1)


def cmd(byte):
    send_data(0, byte)

def data(byte):
    send_data(1, byte)


init()
#cmd( 0xE9 )
#data( 0x20 )
cmd( 0x11 ) #Exit Sleep
time.sleep( 0.100 )

cmd( 0xD1 )     # VCOM Control
data( 0x00 )    #    SEL/VCM
data( 0x0C )    #    VCM
data( 0x0F )    #    VDV

cmd( 0xD0 )     # Power_Setting
data( 0x07 )    #    VC
data( 0x04 )    #    BT
data( 0x00 )    #    VRH

cmd( 0x36 )     # Set_address_mode
data( 0x48 )
# 0x48 = 0b01001000
# 0 - top to bottom
# 1 - right to left
# 0 - normal mode of columns order
# 0 - refresh top to bottom
# 1 - RGB or BGR  (here BGR order)
# 0 - <skip>
# 0 - no hflip
# 0 - no flip

cmd(0xE0)
data(0x00)
data(0x04)
data(0x0E)
data(0x08)
data(0x17)
data(0x0A)
data(0x40)
data(0x79)
data(0x4D)
data(0x07)
data(0x0E)
data(0x0A)
data(0x1A)
data(0x1D)
data(0x0F)

cmd(0xE1)
data(0x00)
data(0x1B)
data(0x1F)
data(0x02)
data(0x10)
data(0x05)
data(0x32)
data(0x34)
data(0x43)
data(0x02)
data(0x0A)
data(0x09)
data(0x33)
data(0x37)
data(0x0F)

cmd(0xB1)
data(0xB0)

cmd(0xB4)
data(0x02)

cmd(0xF7)
data(0xA9)
data(0x51)
data(0x2C)
data(0x82)

cmd(0XB0)
data(0x00)

cmd( 0x3A )     # Set pixel format
data( 0x55 )
cmd( 0xC1 )     # Display timing setting for normal/partial mode
data( 0x41 )
cmd( 0xC0 )     # Set Default Gamma
data( 0x18 )
data( 0x16 )
cmd( 0xC5 )     # Set frame rate
data( 0x00 )
data( 0x1E )
data( 0x80 )
cmd( 0xD2 )     # Power setting
data( 0x01 )
data( 0x44 )
cmd( 0xC8 )     # Set Gamma
data( 0x04 )
data( 0x67 )
data( 0x35 )
data( 0x04 )
data( 0x08 )
data( 0x06 )
data( 0x24 )
data( 0x01 )
data( 0x37 )
data( 0x40 )
data( 0x03 )
data( 0x10 )
data( 0x08 )
data( 0x80 )
data( 0x00 )
cmd( 0x2A )
data( 0x00 )
data( 0x00 )
data( 0x01 )
data( 0x3F )
cmd( 0x2B )
data( 0x00 )
data( 0x00 )
data( 0x01 )
data( 0xDF )
cmd( 0x29 ) #display on
cmd( 0x2C ) #display on

x1 = 100
y1 = 100
x2 = 200
y2 = 200
cmd(0x2a) # Set_column_address
data(x1>>8)
data(x1)
data(x2>>8)
data(x2)
cmd(0x2b) # Set_page_address
data(y1>>8)
data(y1)
data(y2>>8)
data(y2)
cmd(0x2c) # Write_memory_start

# write pixel by pixel
for x in xrange(100):
    for y in xrange(100):
        data(0xee)  ## low part of word
        data(0)     ## hight part of word

g.output(CSX, 1)    ## end command / data session

image

This is the screen:
image
image

This is what happens when you run win32_screem.rar that was for the 3.6 screen:
image

It seams it shouldn't be that much different to get it running, sure its a cheap screen from aliexpress ;)

@toxaq
Copy link

toxaq commented Aug 21, 2015

I have the exact same screen (even though I ordered a different one), so very keen on your progress!

@kiwifruktish kiwifruktish changed the title ili9488 3.95 screen - ili9488 Aug 21, 2015
@kiwifruktish
Copy link
Author

ok, now i have stuff on the screen :P but it is mirrored :( hahah

sudo modprobe fbtft_device name=flexpfb rotate=180 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8

sudo modprobe flexfb width=320 height=480 buswidth=8 init=-1,0xb0,0x0,-1,0x11,-2,120,-1,0x3A,0x55,-1,0xC2,0x33,-1,0xC5,0x00,0x1E,0x80,-1,0xE0,0x00,0x04,0x0E,0x08,0x17,0x0A,0x40,0x79,0x4D,0x07,0x0E,0x0A,0x1A,0x1D,0x0F,-1,0xE1,0x00,0x1B,0x1F,0x02,0x10,0x05,0x32,0x34,0x43,0x02,0x0A,0x09,0x33,0x37,0x0F,-1,0x11,-1,0x29,-3

con2fbmap 1 1

Now mirroring is need to be fixed and rotate need to be fixed some how ;)

image

@notro
Copy link
Owner

notro commented Aug 21, 2015

Register 0x36 is usually responsible for rotation/flip/mirror/bgr

@kiwifruktish
Copy link
Author

kiwifruktish commented Aug 21, 2015 via email

@kiwifruktish
Copy link
Author

Everything's working now but the screen looks like it is "lagging" every lines updates way to slow, any use'?

@notro
Copy link
Owner

notro commented Aug 21, 2015

Yes it's slow to drive a parallel bus with gpiolib.
If you use a Pi and can build your own kernel, you can add the optimization that was left out when fbtft went into staging: https://github.com/notro/fbtft/blob/master/fbtft-io.c#L133
See here for preformance numbers with this optimization: https://github.com/notro/fbtft/wiki/Performance#itdb28

@mwilliams03
Copy link

If you want a visual comparison, I created a short video a month ago of two TFTs running next to each other, one with optimization and the other without the optimization.
https://www.youtube.com/watch?v=TyqHsEw4ids

@notro
Copy link
Owner

notro commented Aug 22, 2015

That's a different optimization: DMA. The display we are talking about here is driven with a 8-bit parallel bus directly, no SPI. Upstream FBTFT uses gpiolib and sets one bit at a time (unless it's the same value as the previous one), whereas the old optimized FBTFT wrote directly to the hw register making it possible to set 8 bit in one go.

@kiwifruktish
Copy link
Author

For any one that wants the screen to show some thing ;) :

pi@raspberrypi ~ $ cat /etc/modules
snd-bcm2835
fbtft_device name=flexpfb rotate=180 fps=60 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8
#flexfb width=320 height=480 buswidth=8 init=-1,0xb0,0x0,-1,0x11,-2,120,-1,0x3A,0x55,-1,0xC2,0x33,-1,0xC5,0x00,0x1E,0x80,-1,0x36,0x48,-1,0xB1,0xB0,-1,0xE0,0x00,0x04,0x0E,0x08,0x17,0x0A,0x40,0x79,0x4D,0x07,0x0E,0x0A,0x1A,0x1D,0x0F,-1,0xE1,0x00,0x1B,0x1F,0x02,0x10,0x05,0x32,0x34,0x43,0x02,0x0A,0x09,0x33,0x37,0x0F,-1,0x11,-1,0x29,-3

landscape mode

flexfb width=480 height=320 buswidth=8 init=-1,0xb0,0x0,-1,0x11,-2,120,-1,0x3A,0x55,-1,0xC2,0x33,-1,0xC5,0x00,0x1E,0x80,-1,0x36,0x28,-1,0xB1,0xB0,-1,0xE0,0x00,0x04,0x0E,0x08,0x17,0x0A,0x40,0x79,0x4D,0x07,0x0E,0x0A,0x1A,0x1D,0x0F,-1,0xE1,0x00,0x1B,0x1F,0x02,0x10,0x05,0x32,0x34,0x43,0x02,0x0A,0x09,0x33,0x37,0x0F,-1,0x11,-1,0x29,-3

@kiwifruktish
Copy link
Author

notro, stupid question, isent it just possible to change like fb_ili9486.c and make it as a new driver?

@toxaq
Copy link

toxaq commented Aug 23, 2015

I asked my supplier for the driver and this is what I got back


/*************************************************/
void initi(void)
{
   res=1;
   delay(1);
   res=0;
   delay(10);
   res=1;
   delay(120);
/***************************************/ 
write_command(0xE0); 
write_data(0x00); 
write_data(0x04); 
write_data(0x0E); 
write_data(0x08); 
write_data(0x17); 
write_data(0x0A); 
write_data(0x40); 
write_data(0x79); 
write_data(0x4D); 
write_data(0x07); 
write_data(0x0E); 
write_data(0x0A); 
write_data(0x1A); 
write_data(0x1D); 
write_data(0x0F);  

write_command(0xE1); 
write_data(0x00); 
write_data(0x1B); 
write_data(0x1F); 
write_data(0x02); 
write_data(0x10); 
write_data(0x05); 
write_data(0x32); 
write_data(0x34); 
write_data(0x43); 
write_data(0x02); 
write_data(0x0A); 
write_data(0x09); 
write_data(0x33); 
write_data(0x37); 
write_data(0x0F); 

write_command(0xC0); 
write_data(0x18); 
write_data(0x16); 

write_command(0xC1); 
write_data(0x41); 

write_command(0xC5); 
write_data(0x00); 
write_data(0x1E); //VCOM
write_data(0x80); 

write_command(0x36); 
write_data(0x48); 

write_command(0x3A); //Interface Mode Control
write_data(0x55); //16BIT 

write_command(0xB1);   //Frame rate 70HZ  
write_data(0xB0); 

write_command(0xB4); 
write_data(0x02);   

write_command(0xE9); 
write_data(0x00);

write_command(0XF7);    
write_data(0xA9); 
write_data(0x51); 
write_data(0x2C); 
write_data(0x82);

//**********set rgb interface mode******************
write_command(0XB0);  //Interface Mode Control  
write_data(0x00);  //set DE,HS,VS,PCLK polarity

write_command(0xB6); 
write_data(0x30); //30 set rgb
write_data(0x02); //GS,SS 02£¨42
write_data(0x3B); 
 /**************************************************/ 
write_command(0x2A); //Frame rate control
write_data(0x00);
write_data(0x00);
write_data(0x01);
write_data(0x3F);

write_command(0x2B); //Display function control
write_data(0x00);
write_data(0x00);
write_data(0x01);
write_data(0xDF);

write_command(0x21);

write_command(0x11);
delay(120);
write_command(0x29); //display on
write_command(0x2c); 

}
//******************************************
void LCD_Enter_Standby(void)
{
   write_command(0x28);//display off
   delay(10);
  write_command(0x10);
   delay(120);
   RGB_OFF();
   }
void LCD_Exit_Standby (void)
{
   RGB_ON();
   delay(10);
   write_command(0x11);// Exit Sleep/ Standby mode
   delay(120);
   write_command(0x29);
  }

Not sure if that's of any use to anyone.

@kiwifruktish How do I use that example you've got above?

@notro
Copy link
Owner

notro commented Aug 23, 2015

isent it just possible to change like fb_ili9486.c and make it as a new driver?

Sure it's possible.
I'm working on some patches and one of the big changes is moving away from having controller drivers to display drivers instead. The main reason for this is that the Device Tree guys won't allow register initialisation sequences in DT.
https://github.com/notro/linux-staging/commits/next

@kiwifruktish
Copy link
Author

@toxaq i used same example from the supplier,

"sudo nano /etc/modules" and add to enable screen:
fbtft_device name=flexpfb rotate=180 fps=60 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8
#flexfb width=320 height=480 buswidth=8 init=-1,0xb0,0x0,-1,0x11,-2,120,-1,0x3A,0x55,-1,0xC2,0x33,-1,0xC5,0x00,0x1E,0x80,-1,0x36,0x48,-1,0xB1,0xB0,-1,0xE0,0x00,0x04,0x0E,0x08,0x17,0x0A,0x40,0x79,0x4D,0x07,0x0E,0x0A,0x1A,0x1D,0x0F,-1,0xE1,0x00,0x1B,0x1F,0x02,0x10,0x05,0x32,0x34,0x43,0x02,0x0A,0x09,0x33,0x37,0x0F,-1,0x11,-1,0x29,-3

landscape mode

flexfb width=480 height=320 buswidth=8 init=-1,0xb0,0x0,-1,0x11,-2,120,-1,0x3A,0x55,-1,0xC2,0x33,-1,0xC5,0x00,0x1E,0x80,-1,0x36,0x28,-1,0xB1,0xB0,-1,0xE0,0x00,0x04,0x0E,0x08,0x17,0x0A,0x40,0x79,0x4D,0x07,0x0E,0x0A,0x1A,0x1D,0x0F,-1,0xE1,0x00,0x1B,0x1F,0x02,0x10,0x05,0x32,0x34,0x43,0x02,0x0A,0x09,0x33,0x37,0x0F,-1,0x11,-1,0x29,-3

"sudo nano /boot/cmdline.txt" Enable the Boot Splash Screen by adding:
fbcon=map:10 fbcon=font:VGA8x8 fbcon=rotate:3

please note that it will "lag" until we have a driver that dont use "gpiolib".

@kiwifruktish
Copy link
Author

@notro

I made changes to fb_ili9486.c
By changing "static int default_init_sequence[] = {" to:
/* this init sequence matches PiScreen /
static int default_init_sequence[] = {
/
Interface Mode Control /
-1, 0xb0, 0x0,
/
Sleep OUT /
-1, 0x11,
-2, 120,
/
Interface Pixel Format /
-1, 0x3A, 0x55,
/
Power Control 3 /
-1, 0xC2, 0x33,
/
VCOM Control 1 /
-1, 0xC5, 0x00, 0x1E, 0x80,
/
PGAMCTRL(Positive Gamma Control) /
-1, 0xE0, 0x00, 0x04, 0x0E, 0x08, 0x17, 0x0A, 0x40, 0x79,
0x4D, 0x07, 0x0E, 0x0A, 0x1A, 0x1D, 0x0F,
/
NGAMCTRL(Negative Gamma Control) /
-1, 0xE1, 0x00, 0x1B, 0x1F, 0x02, 0x10, 0x05, 0x32, 0x34,
0x43, 0x02, 0x0A, 0x09, 0x33, 0x37, 0x0F,
/
Sleep OUT /
-1, 0x11,
/
Display ON /
-1, 0x29,
/
end marker */
-3
};

And started "fbtft_device custom name=fb_ili9486 rotate=90 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8"

It worked after build, but still "laggy" because of gpiolib i guess.

But maybe you want to add a fb_ili9488 to next release ;)

@notro
Copy link
Owner

notro commented Aug 25, 2015

I won't be making a fb_ili9488 because many of these drivers are mipi compliant so I will add a mipi module instead that will cover many of the fbtft supported controllers: https://github.com/notro/linux-staging/blob/next/drivers/staging/fbtft/lcdctrl/mipi-dbi.c

This also solves the problem of the hardcoded register 0x36 values for rotation. Not all displays are equal in this respect, so currently they have to use flexfb.

Then there will be display drivers that use this module: https://github.com/notro/linux-staging/blob/next/drivers/staging/fbtft/ada-mipifb.c

So I'm moving away from controller drivers to display drivers mainly for the DT reason I mentioned earlier.

If I still find fbtft fun to work on when all this is in place, I will have a look at the SMI driver and see if I can add support for that in fbtft: raspberrypi/linux#1105
But anyway that will be months away. I would need to make a generic parallel bus subsystem first.

@bigpaulie
Copy link

Guy's I don't know how you did this but after I added :
fbtft_device name=flexpfb rotate=180 fps=60 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8
flexfb width=480 height=320 buswidth=8 init=-1,0xb0,0x0,-1,0x11,-2,120,-1,0x3A,0x55,-1,0xC2,0x33,-1,0xC5,0x00,0x1E,0x80,-1,0x36,0x28,-1,0xB1,0xB0,-1,0xE0,0x00,0x04,0x0E,0x08,0x17,0x0A,0x40,0x79,0x4D,0x07,0x0E,0x0A,0x1A,0x1D,0x0F,-1,0xE1,0x00,0x1B,0x1F,0x02,0x10,0x05,0x32,0x34,0x43,0x02,0x0A,0x09,0x33,0x37,0x0F,-1,0x11,-1,0x29,-3

to my /etc/modules , all I can see it's just a black screen ...

@kiwifruktish
Copy link
Author

did you add any thing to cmdline.txt ? if not you have to add:

fbcon=map:10 fbcon=font:VGA8x8 fbcon=rotate:3

before rootwait i think. and reboot or just type "con2fbmap 1 1" when module is loaded if you dont want to restart for the moment.

@bigpaulie
Copy link

@kiwifruktish , Thank you.
You were right, also I had to use this FRAMEBUFFER=/dev/fb1 startx to start the x .
It is very very laggy .. :)

@gibo65
Copy link

gibo65 commented Oct 8, 2015

@kiwifruktish
Hi, I have obtained the same yellow square with you, but how to di to redirect console on TFT screen?
Sorry but I'm dummy user ;-)
Thanks

@sima96
Copy link

sima96 commented Oct 9, 2015

I found a kernel for the ili9488 lcd and a raspbian image with kernel for this display.
I attached the link of the page.

http://www.ittgroup.ee/et/ekraanid-ja-naidikud/626-lcd-tft-ekraan-395-480x320-raspberry-pi-le.html

In the bottom of the page there are two links,Kernel and
Raspberry Pi image, click one of them and enjoy!

Bye.

@gibo65
Copy link

gibo65 commented Oct 10, 2015

@callievi
Hi, thanks to info but yunpan360.cn website release always an unknow error to download win32_3.95screem.zip 952.6Mb file so, I ask to show your cloud public link to download correclly resource.
Thanks ;-)

PS https://www.raspberrypi.org/forums/viewtopic.php?t=122736&p=826897

@gibo65
Copy link

gibo65 commented Oct 19, 2015

img_0136
Why with this distribution when I connect my wireless device IRQ32 disable and ext keyb don't work anymore? ;-/

@sima96
Copy link

sima96 commented Oct 19, 2015

I do not know, I used raspbian modify kernel.
You have download the kernel file o the win32 file?
Il 19/ott/2015 16:41, "Luigi" notifications@github.com ha scritto:

[image: img_0136]
https://cloud.githubusercontent.com/assets/4547349/10580876/0c1f2144-7680-11e5-8e05-4c272cf89de4.JPG
Why with this distribution when I connect my wireless device IRQ32 disable
and ext keyb don't work anymore? ;-/


Reply to this email directly or view it on GitHub
#311 (comment).

@gibo65
Copy link

gibo65 commented Oct 22, 2015

...maybe error config into etc/ files! Now I havn't.
into games-python foldere only 640x480 games trailer? ;-)
Thanks Bye

@JunkmailVictim
Copy link

I've been trying to follow along on this thread, but am unfortunately not experienced enough in this environment to get my display as far along as everyone here has. Mine is still that ugly faded image that doesn't fill up the screen.

Is there any possibility anyone would be willing to create and share an image that has this display working properly?

Thanks.

@gibo65
Copy link

gibo65 commented Nov 2, 2015

FYI
fyi

fyi2

@JunkmailVictim
Copy link

Thanks. That's very thoughtful. I had done that already, but my display is the same as that faded image that doesn't fill the screen in the earlier picture. I'm hoping someone sorts out the display, and then makes a new image. The photo of your screen looks great.

@1ucian
Copy link

1ucian commented Dec 20, 2015

I have a PiZero with this screen and I have attempted using the kernel. The image shows up on the screen but I'm unable to use any of my USB devices. Can you guys help me figure this out?
Thanks

@PaddleStroke
Copy link

Hello everyone,
I am trying to use this screen and I'm having some troubles.
Using raspberry pi zero. I am willing to use it for gameboy-like device with retropie.

I tried different things :

  • retropie rpi zero latest image v3.8.1 + changing the kernel, screen stays white. The pi LED blinks only once then stop.
  • win32_3.95screen image : the screen stays white and the pi LED does not turn on at all.

Anyone made it work well on rpi zero could explain me how to do it ? :)

Sorry I don't know much about LCD drivers/linux kernel etc. @gibo65 could you explain me how to use what you posted for @1ucian ?

@PaddleStroke
Copy link

It would be great if someone can give me the big picture on how this is working : linux-kernel kernel-drivers/rpi gpio/screen spec.
And how to modify.
It seems that I lack some basic knowledge to understand the different solutions discussed here. Is there somewhere to start? :)

@xxxSon1cxxx
Copy link

xxxSon1cxxx commented Sep 13, 2016

Has anyone tried to compile the kernel with this optimization https://github.com/notro/fbtft/blob/master/fbtft-io.c#L133 on Raspberry Pi 2? I used this guide https://github.com/notro/fbtft/wiki/Build-kernel-and-fbtft-drivers but no luck, still laggy((

@xxxSon1cxxx
Copy link

Tried to compile fbtft with -O3, -O2 flags, but this didn't help, display update time has increased from 178 ms to 280 ms(((

@cu6apum
Copy link

cu6apum commented Apr 11, 2017

Hi there.
Thanks for your efforts!

I have a 3.5" ILI9488 module from buydisplays and need to get it working via native SPI. As of now I tried ili9481 and 9486 modules by notro (thank you Sir) and custom init strings from this topic. All I achieved for the moment is the screen (9481 driver) or half the screen (9486 driver) changing from white to gray on modprobe. Nothing more happens whatever I do.

Is there a reason to try new DBI branch? If so, is there anything "for dummies" to start from? I'm new to low-level hardware under linux.

Thank you!!

@notro
Copy link
Owner

notro commented Apr 12, 2017

If wiring and the init string is corrrect it should turn black. Many drivers set register 0x36 in the set_var() function and can cause trouble if it doesn't match your panel. This register controls flip/mirror.
The flexfb driver doesn't set this register, so you can use it with the default setaddrwin=0 setting.
https://github.com/notro/fbtft/wiki/flexfb

@cu6apum
Copy link

cu6apum commented Apr 12, 2017

Notro, thanks a lot. It does not turn black in any case. This occurred once, when I occassionally told buswidth=8 instead of 9 used, and I could not repeat this. Even when it has, the module did not react to filling it from /dev/urandom or fbi viewer, so it's not initted yet. I keep trying.
Can the init string be different for parallel and SPI modes?!

@notro
Copy link
Owner

notro commented Apr 12, 2017

Can the init string be different for parallel and SPI modes?!

Not that I know of. The interface type is usally set with the IM[0:3] pins.

@cu6apum
Copy link

cu6apum commented Apr 12, 2017

I tried both 3-wire/9bit and 4-wire/8bit. The fbtft_device requires dc gpio in both modes. Gray screen and no response in any mode. Bum.
Will try with arduino first, there's too much unknown variables as of now. The init string is the first, as avr/stm forums say very different things from this thread.
Am I right that '-1' stands for command, and the rest is data? Sorry for being that dumb.

@notro
Copy link
Owner

notro commented Apr 12, 2017

Am I right that '-1' stands for command, and the rest is data?

Correct.

I you use the verbose=3 argument, you'll see the registers getting written to in the kernel log.

@cu6apum
Copy link

cu6apum commented Apr 12, 2017

I use debug=7 and dmesg.
Unfortunately, init from avr forums is leaving the display white. Heck, how do i debug this!..

@cu6apum
Copy link

cu6apum commented Apr 12, 2017

ok, let me know if you want to get rid of my posts, SORRY.

Is this the right seq?
[ 387.842762] flexfb spi0.0: fbtft_request_gpios: 'dc' = GPIO1
[ 387.842776] flexfb spi0.0: flexfb_verify_gpios_dc()
[ 387.842791] flexfb spi0.0: fbtft_init_display()
[ 387.842808] flexfb spi0.0: init: write(0xB0) 0x00
[ 387.842829] flexfb spi0.0: fbtft_write_reg8_bus8: b0 00
[ 387.842847] flexfb spi0.0: fbtft_write_spi(len=1): b0
[ 387.843023] flexfb spi0.0: fbtft_write_spi(len=1): 00
[ 387.843092] flexfb spi0.0: init: write(0x11)
[ 387.843106] flexfb spi0.0: fbtft_write_reg8_bus8: 11
[ 387.843116] flexfb spi0.0: fbtft_write_spi(len=1): 11
[ 387.843221] flexfb spi0.0: init: mdelay(120)
[ 387.963260] flexfb spi0.0: init: write(0x3A) 0x55
[ 387.963282] flexfb spi0.0: fbtft_write_reg8_bus8: 3a 55
[ 387.963294] flexfb spi0.0: fbtft_write_spi(len=1): 3a
[ 387.963379] flexfb spi0.0: fbtft_write_spi(len=1): 55
[ 387.963441] flexfb spi0.0: init: write(0xC2) 0x33
[ 387.963451] flexfb spi0.0: fbtft_write_reg8_bus8: c2 33
[ 387.963461] flexfb spi0.0: fbtft_write_spi(len=1): c2
[ 387.963521] flexfb spi0.0: fbtft_write_spi(len=1): 33
[ 387.963582] flexfb spi0.0: init: write(0xC5) 0x00 0x1E 0x80
[ 387.963593] flexfb spi0.0: fbtft_write_reg8_bus8: c5 00 1e 80
[ 387.963603] flexfb spi0.0: fbtft_write_spi(len=1): c5
[ 387.963655] flexfb spi0.0: fbtft_write_spi(len=3): 00 1e 80
[ 387.963708] flexfb spi0.0: init: write(0x36) 0x28
[ 387.963717] flexfb spi0.0: fbtft_write_reg8_bus8: 36 28
[ 387.963727] flexfb spi0.0: fbtft_write_spi(len=1): 36
[ 387.963779] flexfb spi0.0: fbtft_write_spi(len=1): 28
[ 387.963830] flexfb spi0.0: init: write(0xB1) 0xB0
[ 387.963840] flexfb spi0.0: fbtft_write_reg8_bus8: b1 b0
[ 387.963850] flexfb spi0.0: fbtft_write_spi(len=1): b1
[ 387.963901] flexfb spi0.0: fbtft_write_spi(len=1): b0
[ 387.963964] flexfb spi0.0: init: write(0xE0) 0x00 0x04 0x0E 0x08 0x17 0x0A 0x40 0x79 0x4D 0x07 0x0E 0x0A 0x1A 0x1D 0x0F
[ 387.963979] flexfb spi0.0: fbtft_write_reg8_bus8: e0 00 04 0e 08 17 0a 40 79 4d 07 0e 0a 1a 1d 0f
[ 387.963991] flexfb spi0.0: fbtft_write_spi(len=1): e0
[ 387.964043] flexfb spi0.0: fbtft_write_spi(len=15): 00 04 0e 08 17 0a 40 79 4d 07 0e 0a 1a 1d 0f
[ 387.964115] flexfb spi0.0: init: write(0xE1) 0x00 0x1B 0x1F 0x02 0x10 0x05 0x32 0x34 0x43 0x02 0x0A 0x09 0x33 0x37 0x0F
[ 387.964129] flexfb spi0.0: fbtft_write_reg8_bus8: e1 00 1b 1f 02 10 05 32 34 43 02 0a 09 33 37 0f
[ 387.964141] flexfb spi0.0: fbtft_write_spi(len=1): e1
[ 387.964194] flexfb spi0.0: fbtft_write_spi(len=15): 00 1b 1f 02 10 05 32 34 43 02 0a 09 33 37 0f
[ 387.964254] flexfb spi0.0: init: write(0x11)
[ 387.964264] flexfb spi0.0: fbtft_write_reg8_bus8: 11
[ 387.964273] flexfb spi0.0: fbtft_write_spi(len=1): 11
[ 387.964323] flexfb spi0.0: init: write(0x29)
[ 387.964333] flexfb spi0.0: fbtft_write_reg8_bus8: 29
[ 387.964343] flexfb spi0.0: fbtft_write_spi(len=1): 29
[ 387.964397] flexfb spi0.0: fbtft_update_display(start_line=0, end_line=319)
[ 387.964410] flexfb spi0.0: fbtft_set_addr_win(xs=0, ys=0, xe=479, ye=319)
[ 387.964420] flexfb spi0.0: fbtft_write_reg8_bus8: 2a 00 00 01 df
[ 387.964431] flexfb spi0.0: fbtft_write_spi(len=1): 2a
[ 387.964483] flexfb spi0.0: fbtft_write_spi(len=4): 00 00 01 df
[ 387.964536] flexfb spi0.0: fbtft_write_reg8_bus8: 2b 00 00 01 3f
[ 387.964547] flexfb spi0.0: fbtft_write_spi(len=1): 2b
[ 387.964598] flexfb spi0.0: fbtft_write_spi(len=4): 00 00 01 3f
[ 387.964650] flexfb spi0.0: fbtft_write_reg8_bus8: 2c
[ 387.964660] flexfb spi0.0: fbtft_write_spi(len=1): 2c
[ 387.964712] flexfb spi0.0: fbtft_write_vmem16_bus8(offset=0, len=307200)
[ 387.964741] flexfb spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...

@cu6apum
Copy link

cu6apum commented Apr 12, 2017

YESSS.
It's been wrong init my friends.
The proper for ILI9488 is:
-1,0xE0,0x00,0x03,0x09,0x08,0x16,0x0A,0x3F,0x78,0x4C,0x09,0x0A,0x08,0x16,0x1A,0x0F,-1,0xE1,0x00,0x16,0x19,0x03,0x0F,0x05,0x32,0x45,0x46,0x04,0x0E,0x0D,0x35,0x37,0x0F,-1,0xC0,0x17,0x15,-1,0xC1,0x41,-1,0xC5,0x00,0x12,0x80,-1,0x36,0x48,-1,0x3A,0x66,-1,0xB0,0x80,-1,0xB1,0xA0,-1,0xB4,0x02,-1,0xE9,0x00,-1,0xF7,0xA9,0x51,0x2C,0x82,-1,0x11,-2,150,-1,0x29,-3

Thank you for patience.

@elageneg
Copy link

Hi Cu6apum,
I recently bought the ER-TFT035-6 from buy display and I am trying to make it work with SPI interface in the raspberry pi 3. Looks like you solved the problem, however I tried your init sequence and still having trouble. Can you please specify if you finally used 3-wire or 4-wire SPI interface. Details would be really appreciated.
Thanks a lot!

@elageneg
Copy link

elageneg commented May 8, 2017

Hi Cu6apum and Notro, any comment about my last question? I would really appreciate any help...
All the best

@cu6apum
Copy link

cu6apum commented May 8, 2017

Gentlemen, sorry, was AFK for a week.
I've connected it in 8 bit mode with separate D/C gpio. Init cited above. It's not final, the display is using wrong color scheme - the bitmap rendered by fsb is wrong, I achieved only console prompt for now, in portrait orientation. My goal was to make it work via SPI, and it does. Details later, as I'm busy with PCB design now.
NanoPi Neo (alwinner H3) here, dietpi linux OOB.

@rogueturnip
Copy link

I was wondering if anyone has had success with the ILI9488 SPI (4wire)? I've got a driver working but the color is all messed up. My suspicion is it's due to the 18bit mode for 4wire spi. When I set 18bpp in the driver it doesn't display anything. The only thing I can think of trying is putting the buswidth to 9bits (although the spec sheet says 4 wire is 8).

Anyone have any ideas? I've considered the need to pad the 16bits before it's sent to the ILI9488 but I'm not sure where I'd do this. I started the driver off the ILI9486 one.

@sergey-suloev
Copy link

@elageneg any success with that display yet ?

@elageneg
Copy link

Unfortunately no, we finally changed display.

@sergey-suloev
Copy link

@elageneg I was able to make it work with mainline kernel

@tgreenwood93
Copy link

Hi everyone, I was able to get the ili9488 working with 4 channel SPI! Paying it forward to anyone who still wants to use this method to get their ili9488 tft display to work. Mine was from BuyDisplay (ER-TFT035-6) https://www.buydisplay.com/default/serial-spi-3-5-inch-tft-lcd-module-in-320x480-optl-touchscreen-ili9488

here's my repo with the code to get it to work. Follow @notro's excellent wiki on installing it. https://github.com/tgreenwood93/fbtft.git

@sergey-suloev
Copy link

sergey-suloev commented Feb 15, 2019

@tgreenwood93 hi, can you explain what is the 4-channel SPI you are referring to ?
And also: did you make it work with FBTFT or tinydrm ?

I made it work long time ago with tinydrm, my code is here:

https://github.com/orpaltech/armlinux/blob/master/patch/kernel/stable/v4.20/common/0092-tinydrm-Add-support-for-ILI9488-display-panels.patch

and also DT-overlay for Rpi3 (bcm2835-ertft0356-drm.dts) can be found inside this patch
https://github.com/orpaltech/armlinux/blob/master/patch/kernel/stable/v4.20/overlays/0005-bcm2835-add-DT-overlays.patch

@tgreenwood93
Copy link

I am using it on raspberry pi stretch right now. Using SPI. four wires/channels (SCLK, MOSI, MISO, D/C) -- I haven't made it TinyDRM complaint yet.

That's awesome @sergey-suloev! Thanks for posting the TinyDRM version as well!

@sergey-suloev
Copy link

sergey-suloev commented Feb 15, 2019

@tgreenwood93 oh you mean 4-wire SPI ! that means it is the normal SPI interface

@FELiXik
Copy link

FELiXik commented Mar 10, 2019

Hi everyone, I was able to get the ili9488 working with 4 channel SPI! Paying it forward to anyone who still wants to use this method to get their ili9488 tft display to work. Mine was from BuyDisplay (ER-TFT035-6) https://www.buydisplay.com/default/serial-spi-3-5-inch-tft-lcd-module-in-320x480-optl-touchscreen-ili9488

here's my repo with the code to get it to work. Follow @notro's excellent wiki on installing it. https://github.com/tgreenwood93/fbtft.git

Hello @tgreenwood93,
if youy have working drivers you save my day!

But I'm little bit noob, may I ask you for link How to install fbtft? I tried https://github.com/notro/fbtft/wiki#wiki-install but there is nothing. After many tries to install, I'm really confused.

https://learn.watterott.com/rpi-display/fbtft-install/ - tried manuall install, but still notning... :(

Thanks a lot!

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

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

No branches or pull requests