SPI 3.5inch RPi LCD on Orange Pi PC Plus
Edited by bmoir556114 at 2017-2-5 01:23Hi
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 :
spi_used = 1
spi_cs_bitmap = 1
spi_mosi = port:PC00<3><default><default><default>
spi_miso = port:PC01<3><default><default><default>
spi_sclk = port:PC02<3><default><default><default>
spi_cs0 = port:PC03<3><1><default><default>
gpio_used = 1
gpio_num = 2
gpio_pin_1 = port:PC07<1><default><default><0>
gpio_pin_2 = port:PA02<1><default><default><0>
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 :
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
modprobe fbtft_device name=flexfb speed=16000000 debug=0 rotate=90 fps=30 txbuflen=32768 gpios=reset:2,dc:1As it seem to be an ili9486, I also tryed
modprobe fb_ili9486
modprobe fbtft_device custom name=fb_ili9486 speed=16000000 debug=0 rotate=90 fps=30 txbuflen=32768 gpios=reset:2,dc:1
...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 :
[ 2631.628332] fbtft_device:SPI devices registered:
[ 2631.628362] fbtft_device:'fb' Platform devices registered:
[ 2632.155315] graphics fb8: flexfb frame buffer, 480x320, 300 KiB video memory, 32 KiB buffer memory, fps=33, spi0.0 at 16 MHz
[ 2632.155393] fbtft_device:GPIOS used by 'flexfb':
[ 2632.155414] fbtft_device: 'reset' = GPIO2
[ 2632.155432] fbtft_device: 'dc' = GPIO1
[ 2632.155448] fbtft_device:SPI devices registered:
[ 2632.155479] fbtft_device: flexfb spi0.0 16000kHz 8 bits mode=0x00One 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 ?
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 section of script.bin. This seems to be mandatory to me, to access any GPIOs.
Take a look at this post, it might be helpful; https://forum.armbian.com/index.php/topic/1080-tiny-3-lcd-on-orange-pi/
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 :
graphics fb1: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 32 KiB DMA buffer memory, fps=33, spi0.0 at 15 MHz up.
Since this post is a few month old, maybe someone faced the same problem, and found a solution ? 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.
I got an XPT2046 / ILI9486 working on Orange Pi Zero, in portrait mode:
https://forum.armbian.com/topic/4656-orangepi-zero-mainline-kernel-spi-lcd-touchscreen/?do=findComment&comment=68246 I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Situs Slot Gacor I would like to say that this blog really convinced me to do it! Thanks, very good post. เว็บบอล888
page:
[1]