Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 8462|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
Post time 2017-2-5 01:17:47 | Show all posts |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 the 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 the 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 the 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 the 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| Post time 2017-2-10 13:17:12 | Show all posts
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
Post time 2017-2-13 21:09:02 | Show all posts
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| Post time 2017-2-15 21:53:29 | Show all posts
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 the Code

2

Threads

5

Posts

46

Credits

Novice

Rank: 1

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

10

Threads

221

Posts

2006

Credits

Gold member

Rank: 6Rank: 6

Credits
2006
Post time 2017-7-2 17:02:43 | Show all posts
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.

5

Threads

34

Posts

151

Credits

Registered member

Rank: 2

Credits
151
Post time 2018-12-21 08:56:26 | Show all posts
I got an XPT2046 / ILI9486 working on Orange Pi Zero, in portrait mode:

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

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-12-11 22:43 GMT+8 , Processed in 0.033422 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list