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

Various user-contributed guides for hardware-related things
bamsegod
Posts: 10
Joined: Tue Apr 24, 2018 7:01 am
Has thanked: 3 times
Been thanked: 7 times

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

Post by bamsegod » Fri Apr 27, 2018 6:42 pm

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.

User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

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

Post by VeteranGamer » Sat Apr 28, 2018 1:59 am

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....




.

User avatar
ABH
Posts: 188
Joined: Sat May 28, 2016 7:01 pm
Location: Qatar
Has thanked: 82 times
Been thanked: 113 times

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

Post by ABH » Sat Apr 28, 2018 3:23 am

Interesting
Thanks for posting

snoek09
Posts: 145
Joined: Sat May 20, 2017 3:06 am
Location: Amsterdam, The Netherlands
Has thanked: 48 times
Been thanked: 43 times

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

Post by snoek09 » 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

bamsegod
Posts: 10
Joined: Tue Apr 24, 2018 7:01 am
Has thanked: 3 times
Been thanked: 7 times

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

Post by bamsegod » 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

bamsegod
Posts: 10
Joined: Tue Apr 24, 2018 7:01 am
Has thanked: 3 times
Been thanked: 7 times

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

Post by bamsegod » Sun Apr 29, 2018 4:24 am

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

User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

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

Post by VeteranGamer » 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...



.

User avatar
Helder
Trailblazer
Trailblazer
Posts: 2985
Joined: Thu May 05, 2016 8:33 am
Location: Rogers, AR
Has thanked: 1459 times
Been thanked: 3114 times

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

Post by Helder » Sun Apr 29, 2018 2:47 pm

5v input on these red boards will regulate them down to 3.2v and it can also be dimmed with some code.
Chat with me and other members On Discord

Don't contact me about obtaining my board files (as you will not get them). If my Boards or PCB Kits are sold out, they will be restocked as soon as I can get them and there is demand for them. You can join the mailing list on my Website to be notified when they are available.


Helder's Game Tech Website

We will not support any cloned work so don't come to us with technical issues to resolve, go talk to the cloner for help.

bamsegod
Posts: 10
Joined: Tue Apr 24, 2018 7:01 am
Has thanked: 3 times
Been thanked: 7 times

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

Post by bamsegod » Sun Apr 29, 2018 8:53 pm

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

User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

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

Post by VeteranGamer » Mon Apr 30, 2018 1:49 am

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....



.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest