Page 1 of 4

[Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Fri Apr 27, 2018 6:42 pm
by bamsegod
so you got one of these red pcb SPI screens (mine is 2.8" diagonally) and have no clue how to connect it or how to make it run at a decent framerate. there has been better methods for Adafruit and Waveshare screens but to be honest they are really priced high and almost at the price of HDMI screens.
these screens are really cheap on ebay and Aliexpress like $7 USD.

Image



so this whole guide is inspired from Moosepr's guide below.

https://sudomod.com/forum/viewtopic.php ... 3da377344e

with the frame buffer method there is still a bit of screen tearing visible when entire screen is refreshed. with this new method screen is much more smoother and faster.

Huge thanks to Juj who has written the code and helped me setting up his code in this generic screen.

lets get started.

wiring is pretty simple
Screen<------------>Raspberry Pi 3 or zero
SDO(MISO)<----->PIN 21
LED<-------------->Pin 2 (5V)
SCK<-------------->Pin 23
SDI(MOSI)<----->Pin 19
DC<--------------->Pin 22
RESET<----------->Pin 26
CS<----------------->Pin 24
GND<------------>Pin 20
VCC<------------>Pin 1 (3.3V)


if you used Mooepr's method on your Pi you will have to kill the fbcp to do that;

Code: Select all

sudo pkill fbcp
also change the follwing in the /boot/config.txt (put a # before this line)

Code: Select all

#dtparam=spi=on
now using Juj script on Github

Code: Select all

git clone https://github.com/juj/fbcp-ili9341.git
cd fbcp-ili9341
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DADAFRUIT_ILI9341_PITFT=ON ..
make -j
sudo ./fbcp-ili9341
Finally to make this changes permanent go to

Code: Select all

sudo nano /etc/rc.local
and remove this line

Code: Select all

fbcp& 
and add this line

Code: Select all

sudo /home/pi/fbcp-ili9341/build/fbcp-ili9341 &
and thats it. enjoy you ili-9341 in 60fps glory.

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sat Apr 28, 2018 1:59 am
by VeteranGamer
i havent tested it yet....


just one thing....
does the GPIO for the BL (LED) and VCC (3.3V) matter (and also RST)
(is it written into the script, or can you use other points)
(or can you edit the script to different points, if you already have builds wired up)

but thanks for this....




.

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sat Apr 28, 2018 3:23 am
by ABH
Interesting
Thanks for posting

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sat Apr 28, 2018 5:32 am
by snoek09
VeteranGamer wrote:
Sat Apr 28, 2018 1:59 am
does the GPIO for the BL (LED) and VCC (3.3V) matter (and also RST)
(is it written into the script, or can you use other points)
Some of the pins are hardcoded to follow the AdaFruit 2.8" PiTFT shield:
https://github.com/juj/fbcp-ili9341/blo ... /spi.h#L31

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sun Apr 29, 2018 4:22 am
by bamsegod
Veteran gamer. While I was figuring this out how it works and how it compared to moosepr method, I tried various pin options but none worked except this one. The pins are hard coded in the code, which is based on adafruit gpio screen (you know the one that plug straight into the pi). So I dig the internet to find what each pin does on adafruit screen and applied it to this red pcb screen and it worked. :D . Regarding the pin 18 that supply’s Current to the led backlight, I like the 5v brightness it’s much more readable in day light. Not sure if it will damage the screen in the long run though. Good luck

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sun Apr 29, 2018 4:24 am
by bamsegod
snoek09 wrote:
Sat Apr 28, 2018 5:32 am
VeteranGamer wrote:
Sat Apr 28, 2018 1:59 am
does the GPIO for the BL (LED) and VCC (3.3V) matter (and also RST)
(is it written into the script, or can you use other points)
Some of the pins are hardcoded to follow the AdaFruit 2.8" PiTFT shield:
https://github.com/juj/fbcp-ili9341/blo ... /spi.h#L31
Yup that’s the path I followed to reverse engineer the code for this screen

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sun Apr 29, 2018 7:32 am
by VeteranGamer
bamsegod wrote:
Sun Apr 29, 2018 4:22 am
Veteran gamer. While I was figuring this out how it works and how it compared to moosepr method, I tried various pin options but none worked except this one. The pins are hard coded in the code, which is based on adafruit gpio screen (you know the one that plug straight into the pi). So I dig the internet to find what each pin does on adafruit screen and applied it to this red pcb screen and it worked. :D . Regarding the pin 18 that supply’s Current to the led backlight, I like the 5v brightness it’s much more readable in day light. Not sure if it will damage the screen in the long run though. Good luck


i had a feeling that would be the case....

i've made/designed another little connector board that might assist/help in making things look a little cleaner with these screens


Image


https://sudomod.com/forum/viewtopic.php?f=25&t=5614


its not using the 5V for the LED/BL, so may not be as bright....
but will be a complete 3.3V powered option...



.

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sun Apr 29, 2018 2:47 pm
by Helder
5v input on these red boards will regulate them down to 3.2v and it can also be dimmed with some code.

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Sun Apr 29, 2018 8:53 pm
by bamsegod
VeteranGamer wrote:
Sun Apr 29, 2018 7:32 am
bamsegod wrote:
Sun Apr 29, 2018 4:22 am
Veteran gamer. While I was figuring this out how it works and how it compared to moosepr method, I tried various pin options but none worked except this one. The pins are hard coded in the code, which is based on adafruit gpio screen (you know the one that plug straight into the pi). So I dig the internet to find what each pin does on adafruit screen and applied it to this red pcb screen and it worked. :D . Regarding the pin 18 that supply’s Current to the led backlight, I like the 5v brightness it’s much more readable in day light. Not sure if it will damage the screen in the long run though. Good luck


i had a feeling that would be the case....

i've made/designed another little connector board that might assist/help in making things look a little cleaner with these screens


Image


https://sudomod.com/forum/viewtopic.php?f=25&t=5614


its not using the 5V for the LED/BL, so may not be as bright....
but will be a complete 3.3V powered option...



.
Is there a way to connect this screen with your pcb easily. This would further minimise unwanted red pcb.


Look what I found on AliExpress
http://s.aliexpress.com/IRrqY7re

Re: [Guide] ili-9341 true 60 fps fast refresh tutorial

Posted: Mon Apr 30, 2018 1:49 am
by VeteranGamer
bamsegod wrote:
Sun Apr 29, 2018 8:53 pm

Is there a way to connect this screen with your pcb easily. This would further minimise unwanted red pcb.


Look what I found on AliExpress
http://s.aliexpress.com/IRrqY7re

if you have a look at this post....

https://sudomod.com/forum/viewtopic.php?f=25&t=5614


the boards were designed to be used with a 3.2" 18 pin ili9341 LCD, which dont come with a red board and are just bare LCD...
(you can just soldered the screen to the board, and ignore/avoid using the 0.8mm pitch connector)
(it can also be used with any size bare LCD from 2.2" to 3.2")



it may not be the cheaper option, but IMHO is a cleaner option...
also may not be the easiest option initially, but does offer quick attachment and release once everything is done....



.