View: 19313|Reply: 6

SPI 3.5inch RPi LCD on Orange Pi PC Plus

[Copy link]

2

threads

5

posts

46

credits

Novice

Rank: 1

credits
46
Published in 2017-2-5 01:17:47 | Show all floors |Read mode
Edited by bmoir556114 at 2017-2-5 01:23

Hi

I am trying to use this lcd https://www.aliexpress.com/item/ ... 13010608.0.0.dJRjkn on my Orangepi PC Plus, but unsucesfully so far.As I've seen posts on this forum of people that managed to make it work, somebody might have a idea of what's wrong in my setup?
Note that the LCD works fine when plugged on a RaspberryPi, using the image provided by Waveshare (http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)). So their is no faulty LCD hardware here, and no miss-identification of the LCD.

Here is what I did, using an Armbian image (both desktop and server, same result) :

1. First, to be sure of the requiered pins, I tested the LCD on Raspberry with only pins 18, 19, 21, 22, 23, 24 connected (as well as 3.3v, 5v, and GND).
It works (I am not looking at the touch for now). So I only need SPI pins (19, 21, 23, 24) and 2 gpio : 18 (LCD_RS) and 22 (RST).

2. In my script.fex (script.bin), I checked that spi was activated, and declared the 2 GPIOs pins I use :

  1. [spi0]
  2. spi_used = 1
  3. spi_cs_bitmap = 1
  4. spi_mosi = port:PC00<3><default><default><default>
  5. spi_miso = port:PC01<3><default><default><default>
  6. spi_sclk = port:PC02<3><default><default><default>
  7. spi_cs0 = port:PC03<3><1><default><default>

  8. [gpio_para]
  9. gpio_used = 1
  10. gpio_num = 2
  11. gpio_pin_1 = port:PC07<1><default><default><0>
  12. gpio_pin_2 = port:PA02<1><default><default><0>
Copy code

SPI pins are the same on Raspberry, and OrangePi pins 18 and 22 are PC07 and PA02 (checked here : http://orange314.com/Hardware).
==> I map pin18 (PC07) to gpio1, and pin22 (PA02) to gpio2

3. I add gpio_sunxi to /etc/modules

4. Convert my fex to bin, reboot, connect to ssh, and try the following :
  1. modprobe flexfb regwidth=16 buswidth=8 width=320 height=480 nobacklight init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3
  2. modprobe fbtft_device name=flexfb speed=16000000 debug=0 rotate=90 fps=30 txbuflen=32768 gpios=reset:2,dc:1
Copy code
As it seem to be an ili9486, I also tryed
  1. modprobe fb_ili9486
  2. modprobe fbtft_device custom name=fb_ili9486 speed=16000000 debug=0 rotate=90 fps=30 txbuflen=32768 gpios=reset:2,dc:1
Copy code
...as well and hundred of other variants (changing the speed, reg and bus widths, other ili drivers, etc...).
So far, the best I can get is the LCD to turn to grey instead of black. Also, it reacts when I send an image to fb8, using fbi, by blinking a little, but nothing more.

According to the logs, the device is registered :
  1. [ 2631.628332] fbtft_device:  SPI devices registered:
  2. [ 2631.628362] fbtft_device:  'fb' Platform devices registered:
  3. [ 2632.155315] graphics fb8: flexfb frame buffer, 480x320, 300 KiB video memory, 32 KiB buffer memory, fps=33, spi0.0 at 16 MHz
  4. [ 2632.155393] fbtft_device:  GPIOS used by 'flexfb':
  5. [ 2632.155414] fbtft_device:    'reset' = GPIO2
  6. [ 2632.155432] fbtft_device:    'dc' = GPIO1
  7. [ 2632.155448] fbtft_device:  SPI devices registered:
  8. [ 2632.155479] fbtft_device:      flexfb spi0.0 16000kHz 8 bits mode=0x00
Copy code
One more "funny" thing : nothing happens right after the first modprobe fbtft_device .... I have to remove the device (modprobe -r fbtft_device), and add it again to see the LCD turning to grey.

So... It seem that I can communicate with the LCD, but something is definitly wrong somewhere, and I don't know what...


Any idea ?

2

threads

5

posts

46

credits

Novice

Rank: 1

credits
46
 Author| Published in 2017-2-10 13:17:12 | Show all floors
Edited by bmoir556114 at 2017-2-11 09:58

No idea, anybody ? Seems that I am on my own ;-)
I am surpsrised to see that not many people on the forum (or maybe I missed it) refers to changes in [gpio_para] section of script.bin. This seems to be mandatory to me, to access any GPIOs.

0

threads

2

posts

10

credits

Novice

Rank: 1

credits
10
Published in 2017-2-13 21:09:02 | Show all floors
Take a look at this post, it might be helpful; https://forum.armbian.com/index. ... 3-lcd-on-orange-pi/

2

threads

5

posts

46

credits

Novice

Rank: 1

credits
46
 Author| Published in 2017-2-15 21:53:29 | Show all floors
Thanks for sharing the link. Unfortunately, I already saw this post, but I think the LCD used is different. I tried it anyway, with no success.

I also tried this one, which also used an ili9486 : https://github.com/notro/fbtft/issues/174. The init sequence is different, but the result is always the same for me : slight change in intensity, but still white screen.

I am sure that the ili9486 is the correct driver, as this is what is in dmesg on my RaspberryPi, where it is working :
  1. graphics fb1: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 32 KiB DMA buffer memory, fps=33, spi0.0 at 15 MHz
Copy code

2

threads

5

posts

46

credits

Novice

Rank: 1

credits
46
 Author| Published in 2017-7-1 14:08:36 | Show all floors
up.
Since this post is a few month old, maybe someone faced the same problem, and found a solution ?

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2017-7-2 17:02:43 | Show all floors
Edited by nopnop2002 at 2017-7-20 08:48
bmoir556114 replied at 2017-7-1 14:08
up.
Since this post is a few month old, maybe someone faced the same problem, and found a solution ? ...

I have R61509V 3.6 inch tft.
It's command is 16 bit width.
So I have tried regwidth=16.
But it didn't work in OPI.

7

threads

38

posts

181

credits

Registered member

Rank: 2

credits
181
Published in 2018-12-21 08:56:26 | Show all floors
I got an XPT2046 / ILI9486 working on Orange Pi Zero, in portrait mode:

https://forum.armbian.com/topic/ ... t&comment=68246
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list