RetroPie on a Raspberry Pi Zero at 50FPS on an SPI LCD Screen With ILI9341 Driver

  Рет қаралды 15,438

Bytes N Bits

Bytes N Bits

3 жыл бұрын

Running RetroPie on an SPI LCD screen can be slow. 5 to 10 FPS is common. But with a bit of work we can get a smooth 50+ FPS using only a cheap, generic, SPI panel.
In this video I'll show you how to set up RetroPie on a Raspberry Pi Zero, connect the LCD screen and then install and tune the FBCP-ILI9341 driver code. With just a small amount of tinkering you'll soon have a great start for your handheld retro games console.
Make sure you check out my main website for full project details. View the circuit diagrams and get all the code used in the video.
bytesnbits.co.uk/retropie-ras...
If you want to pick up an SPI LCD to make this project yourself go to...
Amazon
amzn.to/3xJKGNa
eBay
ebay.us/hpEezX

Пікірлер: 99
@beardedgitgaming6779
@beardedgitgaming6779 11 ай бұрын
just got into the world of rasberry pi, bought a zero w. this helped me quickly set up the screen and its running great. thank you
@BytesNBits
@BytesNBits 11 ай бұрын
Glad I could help
@freddycisneros5634
@freddycisneros5634 3 жыл бұрын
Great video. Im glad I subscribed to your channel. I have watched a few of your videos so far and look forward to watch all of them. I have learned a lot by watching your videos. Thank you for making these videos. Keep them coming.
@BytesNBits
@BytesNBits 3 жыл бұрын
Awesome, thank you!
@GorkaLarrazabal
@GorkaLarrazabal 2 жыл бұрын
THANKS, THIS IS THE GREATEST EXPLANATION I HAVE SEEN.
@BytesNBits
@BytesNBits 2 жыл бұрын
Glad it was helpful!
@criminalinfluencer071
@criminalinfluencer071 5 ай бұрын
Thanks friend, it helped me a lot, I used your video as a basis to use this display to display PC statistics with MoBro, in an image customized for the RPI. Hugs from Brazil/Portugal!
@BytesNBits
@BytesNBits 5 ай бұрын
Glad it helped
@Sodwmistis
@Sodwmistis 5 ай бұрын
the best explanation for use this screens. thanks a lot for this great guild. work fine with adafruit 2.8 tft and zero 2 w. thanks againe mate.
@BytesNBits
@BytesNBits 5 ай бұрын
Glad it helped. Thanks.
@johnbillings5260
@johnbillings5260 9 ай бұрын
That is pretty crazy. I have many of those screens and I have never seen performance like that!
@BytesNBits
@BytesNBits 9 ай бұрын
Yes. The adaptive driver really makes a differemce.
@MarkMiller-wj3ym
@MarkMiller-wj3ym 4 ай бұрын
i was trying to get hdmi and the screen working together ..after much tweaking i have managed to get both working at same time ...excellent video ..
@BytesNBits
@BytesNBits 4 ай бұрын
Great. I haven't tried that yet.
@KingALLO69
@KingALLO69 Жыл бұрын
Very great explanation! Thank you.
@BytesNBits
@BytesNBits Жыл бұрын
Glad you enjoyed it!
@SycoSpartan
@SycoSpartan Ай бұрын
thank you. i had just chalked up my crappy frame rate to buying a cheap screen. now shes running a smooth 60fps !!!! since switching to this driver however my screensaver doesn't work in emulation station (playing game vids) i switched it off for now
@BytesNBits
@BytesNBits Ай бұрын
Glad to hear you got it running. Not sure why the screen saver would stop. I did find that some code needed the frequency lowered compared to other software.
@SycoSpartan
@SycoSpartan Ай бұрын
@@BytesNBits i turned off oxm player in the UI settings and now it works :P thanks again :)
@RoamingAdhocrat
@RoamingAdhocrat 3 жыл бұрын
This is inspiring. I was up all night trying to get an ESP8266 to speak to a GC9A01-driven 240x240 screen over SPI and the results are… slideshow animation. I need smooth fullscreen updates for my application!
@BytesNBits
@BytesNBits 3 жыл бұрын
Hi. You need to use some of the techniques used in the Raspberry Pi driver. Create a frame buffer in the ESP8266 so that your drawing code is writing to memory rather than trying to send small updates to the screen over SPI. When you've got a frame ready use the block data method to write the whole frame to the screen in one go. If you're using the Adafruit graphics drivers they have all the methods you need built in. I hope this helps.
@BytesNBits
@BytesNBits 3 жыл бұрын
Don't forget to experiment with your SPI data rate to get the fastest transfer speed.
@alanturner1184
@alanturner1184 4 ай бұрын
Absolutely made up Bob with your instructions on here and your web page took a few attempt's as I made mistakes then conflict with HMDI which got grey matter working. Only been playing with raspberry pi for a couple of months with grandson now have my eye on few more projects then maybe move up to Space Invaders a trip down memory lane lol. Thanks again all the best
@BytesNBits
@BytesNBits 4 ай бұрын
Great to hear you're enjoying it. Have fun!
@ritwikdube2798
@ritwikdube2798 10 ай бұрын
You are a legend
@BytesNBits
@BytesNBits 10 ай бұрын
If only more people would realise this ;)
@umutkayacan7659
@umutkayacan7659 3 жыл бұрын
A 45 min video? Nice!
@BytesNBits
@BytesNBits 3 жыл бұрын
Hi. Enjoy!
@duanefreeman3152
@duanefreeman3152 9 ай бұрын
Thank you so much friend I owe you my sanity!
@BytesNBits
@BytesNBits 9 ай бұрын
Glad I could help
@duanefreeman3152
@duanefreeman3152 5 ай бұрын
@@BytesNBits I finally got it to work tonite the 3.5 inch screen that looks identical to the one you use has a different driver. I almost danced with joy when I saw the screen light up thanx again!
@stephenelliott7071
@stephenelliott7071 3 жыл бұрын
SSH or just access the Raspberry Pi running Retro Pie over wifi (on Windows 10) by clicking on the File Explorer Icon, scroll down to Network and typing \\ and the ip address (use show ip from the Retro Pie Menu). Certainly for adding ROMs quickly. Cool project btw.
@BytesNBits
@BytesNBits 3 жыл бұрын
Hi Stephen. Thanks for the tip.
@stephenelliott7071
@stephenelliott7071 3 жыл бұрын
@@BytesNBits that's the great thing about the internet - we all learn something from each other. As I have learnt from you and others. A really great channel, thoroughly enjoying it.
@Fachher
@Fachher 11 ай бұрын
I really like the content you are producing. How can I support your great work? Do you have Patreon
@BytesNBits
@BytesNBits 11 ай бұрын
Thanks. Not yet. I think you can do a KZbin donation but not sure how it works. I haven't looked too much into monetising this project yet.
@dodzy
@dodzy 2 жыл бұрын
Great video thank you, is there any way to add backlight control to switch off the screen LED on shutdown?
@BytesNBits
@BytesNBits 2 жыл бұрын
The backlight is controlled by a logic signal on the LCD panel connector. In this tutorial I've just wired it to the 5V supply to turn it on. If this pin is pulled low it will turn off. Your LCD driver needs to support an extra IO pin for the backlight control. Off the top of my head I can't remember if this driver does - you'll need to check the documentation.
@ilyasseilyasse3093
@ilyasseilyasse3093 2 жыл бұрын
Great 💪💪✌️
@BytesNBits
@BytesNBits 2 жыл бұрын
Thanks
@HitAndMissLab
@HitAndMissLab 8 ай бұрын
Fantastic video! How can one use this same SPI screen but with touch pen in order to manage an electronically driven project?
@BytesNBits
@BytesNBits 8 ай бұрын
Thanks. There should be a driver for the SPI touch screen. There are a number of Waveshare screens that are basically the same device that have this all packaged up in their driver software.
@abreadofloaf9761
@abreadofloaf9761 4 ай бұрын
hey, i just want to say that i find your videos to be very helpful. I just cant figure out how i can blug in a keyboard to my raspberyy pi zero 2w.
@BytesNBits
@BytesNBits 4 ай бұрын
You either need an adapter to allow it to plug into the micro USB port, or if that's being used by something else you'll need a USB hub to give you more ports.
@Ryan-cx2fn
@Ryan-cx2fn 2 ай бұрын
I have a 1.8in st7735s. I get picture but a grey bar on the right side appears making it more the size of a 1.3in display area. Is there away to get that grey bar off?
@BytesNBits
@BytesNBits 2 ай бұрын
You need to play with the driver settings in config.txt to find a resolution that fills the screen.
@thetrufflegouda
@thetrufflegouda 4 ай бұрын
The repo mentions fbcp is deprecated - any updates on how to get the 9341 working?
@BytesNBits
@BytesNBits 4 ай бұрын
Yes. I see what you mean. I haven't looked at this project for a while. I'll have to see if there's another way around this. I guess at the moment you'd need to use an older version of the Pi OS which should still have support for the Dispmanx API.
@kiyoshinakamura8747
@kiyoshinakamura8747 Жыл бұрын
The screen works but if i overclock the rpi zero the screen flick. Are there some settings to overclock and use the screen?
@BytesNBits
@BytesNBits Жыл бұрын
Hi. It's really a matter of playing with the various settings to get the best compromise between overclock / spi bandwidth / screen performance. The screen should be OK with overclocking but you might have to lower the speed setting.
@Ryan-cx2fn
@Ryan-cx2fn 9 ай бұрын
Does this way still work by chance? When I go to download the GitHub file the file fails to download. I’ve tried multiple times and have re flashed the sd to make sure it wasn’t that.
@BytesNBits
@BytesNBits 9 ай бұрын
It should still work. I've checked the repository on GitHub and it's still all there. Cloning it should be fairly straight forward. The other option is to download the file archive and simply extract it into the correct location.
@aaronkahraman5896
@aaronkahraman5896 2 ай бұрын
Hey I dont know if you are still responding but I followed your tutorial and it worked great. But the next day when I powered it up it is stuck on a white screen. rebuilding or changing the configuration doesnt help. if you happen to know what this problem is I would love to hear it. Thank you. EDIT: the configuration I use: cmake -DILI9341=ON -DGPIO_TFT_DATA_CONTROL=8 -DGPIO_TFT_RESET_PIN=25 -DSPI_BUS_CLOCK_DIVISOR=10 -DSTATISTICS=0 -DDISPLAY_ROTATE_180_DEGREES=ON ..
@BytesNBits
@BytesNBits 2 ай бұрын
I'm not sure why it would stop working. Can you get it working with the standard screen drivers to verify the screen is OK? Try lowering the data speed to see if it's set too high.
@andersonand3720
@andersonand3720 10 ай бұрын
Bom dia! como faço para interligar o touch do tft spi 3.2 com raspiberry pi 3 , as ligações de cabeamento com as portas . Obrigado
@BytesNBits
@BytesNBits 10 ай бұрын
Dê uma olhada neste vídeo - kzbin.info/www/bejne/rWKzgoumpZudeZo
@RichDMonte
@RichDMonte 3 ай бұрын
Hi, I get code "vc_dispmanx_display_open failed! Make sure to have hdmi_force_hotplug=1 setting in /boot/config.txt" even though I have set " # uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 in /boot/config.txt. Any help? Im using Raspberry P 3 Model A+ and Raspberry Pi OS (Legacy 32 bit) Bullseye Released 2024-03-12. I tried Retropie but it wouldn't boot
@BytesNBits
@BytesNBits 3 ай бұрын
I think we make a number of settings changes in the video for the screen display. It's probably one of those that's trying to put the Pi into a mode it doesn't support. Try commenting out the settings and let it run with the default video modes to see if you get anything on the screen.
@mrpaulvoline1275
@mrpaulvoline1275 6 ай бұрын
Now I already have the raspian downloaded and the screen working now how do I get retro pie on all that? Cuz I have another raspberry pie but it works on the big screen with my raspberry pi, so now I'm trying to figure out how to get the raspberry pi working on the little screen nobody's doing those videos
@BytesNBits
@BytesNBits 6 ай бұрын
You can install RetroPie manually - have a look at retropie.org.uk/docs/Manual-Installation/. I'd probably advise flashing a new SD card and installing RetroPie from scratch, then adding the screen code to that. It will work out easier in the long run.
@MistralKriss
@MistralKriss 9 ай бұрын
Very interesting : would you know how to display simple graphical dashboard on a tft like yours ? I have mine working, (7735) but I don't wan't to use retropie, but to display values on a dashboard, like IP adress, and various informations, I can see the console boot (that [OK] thingy, and the getty process which I dont want ...) How do I display my own graphics ?
@BytesNBits
@BytesNBits 9 ай бұрын
This video series is about using the LCD panel as a replacement for the main display. You'd want to drive the LCD panel as a standalone SPI device that you can send alternative display data to. You'll need to write some sort of app (Python would be my choice) that will drive the GPIO pins and SPI channel. Then you can put whatever you want onto the screen, but you'll be coding it in terms of text here, image there, line there, etc. primitives. Have a look online. Someone will have written the driver libraries for all this. Good luck!
@MistralKriss
@MistralKriss 9 ай бұрын
@@BytesNBits isn't writing on /dev/fb0 an option (like retropie does, tbh I'm not so sure it does) ? I'd like to use a screen as a screen , apparently neither getty nor retropie have problems to write on the screen, I just don't want getty, neither do I want retrypie, juste the way they display is what I'm after. I was asking in case the answer was obvious. Thanks for your first reply.
@chrismason7294
@chrismason7294 7 ай бұрын
@@BytesNBits this would be a great video as I would also be interesting in this. Also for some reason when I worked through the steps I got an error with running the command and after some googling I found that I had to use the following as well to get it running: cmake -DILI9341=ON -DSPI_BUS_CLOCK_DIVISOR=10 -DWAVESHARE35B_ILI9486=ON -DGPIO_TFT_DATA_CONTROL=24 -DGPIO_TFT_RESET_PIN=25 -DDMA_TX_CHANNEL=0 -DDMA_RX_CHANNEL=5 .. then did make -j thought this might be useful for someone else if they also have that issue edit: to put the full cmake options for clarity
@ds2kx
@ds2kx Жыл бұрын
Failed to open VideoCore kernel mailbox! when we launch driver (even in SUDO). solutions ?
@BytesNBits
@BytesNBits Жыл бұрын
Hi. I've not come across that one. I'd check your Pi is fully updated and you're using the latest version of the driver. Check your setting and pin assignments.
@ds2kx
@ds2kx Жыл бұрын
@@BytesNBits i have tried on bananapi, videocode seems not to be on bananapi. ??
@BytesNBits
@BytesNBits Жыл бұрын
@@ds2kx Hi. I haven't tried this project on anything other than the Raspberry Pi. I guess there will be differences in the kernel setup.
@CHIKKOAJ
@CHIKKOAJ 26 күн бұрын
Can I order one of these cheap displays off of aliexpress? I found a 5$ one that looks the exact same. I am also using a pi 4.
@BytesNBits
@BytesNBits 23 күн бұрын
Yes. But I do need to update the video as the newer version of the RPi OS have changed so the FBCP driver no longer works on the newer versions. If you want to try this project make sure you use a pre 2024 OS version.
@CHIKKOAJ
@CHIKKOAJ 23 күн бұрын
@@BytesNBits I’m pretty sure the display is useless as the drivers out of date or something. I guess it’s my fault for not doing more research
@RBIBIANO
@RBIBIANO Жыл бұрын
Como você fez o comando Quit depois de instalar o monitor? Aqui aparece “…running main loop…” Como fazer para sair?
@BytesNBits
@BytesNBits Жыл бұрын
Hi. Ctrl C on your keyboard should quite the program.
@RBIBIANO
@RBIBIANO Жыл бұрын
@@BytesNBits Muito obrigado pela dica. Depois de sair, a tela lcd volta a ficar branca, apenas consigo ver através do monitor hdmi… O que posso estar fazendo de errado? Depois de inserir as configurações de resolução no HDMI, a tela LCD continua branca, mas agora o monitor HDMI conectado está com uma resolução em letras muito grandes! Não consigo mais acessar o terminal para refazer os comandos…😢
@RBIBIANO
@RBIBIANO Жыл бұрын
@@BytesNBits Consegui remover toda a pasta com o comando rm -r fbcp-ili9341. Refiz todos os passos. Consegui fazer funcionar!
@EvanLandry
@EvanLandry 7 ай бұрын
I tried to follow all the instructions but got stuck at actually running the drivers, my screen just stays white. I think everything is connected properly so idk what it could be
@BytesNBits
@BytesNBits 7 ай бұрын
Can you get the screen to work using the standard drivers? That will confirm that everything is connected correctly and working. Make sire you've got the pin assignments correct and start with a low bandwidth value. Hope you get it working.
@EvanLandry
@EvanLandry 7 ай бұрын
@@BytesNBits I rewired the connection and after a little bit for poking I got it to work. I think the main reason it that the connection is significantly less reliable than I thought so it’s now broken again. (this is the first time I’ve done anything with electronics, so I haven’t soldered it yet). It took a little while to realize it was a hardware problem on my end, I’m gonna try and solder a header on this week.
@BytesNBits
@BytesNBits 7 ай бұрын
@@EvanLandry Great to hear you've got some progress. Good Luck.
@justicestorm1942
@justicestorm1942 Жыл бұрын
does this work on rpi 3 b+?
@BytesNBits
@BytesNBits Жыл бұрын
Yes. It should work on any Pi.
@A_Malefic
@A_Malefic Жыл бұрын
error git (clone mkdir etc) command not found. What i doing wrone?
@BytesNBits
@BytesNBits Жыл бұрын
It sounds like you haven't got GIT installed. Either update your sd card to the latest version of Raspian as GIT is pre installed or install GIT separately. sudo apt update sudo apt install git
@A_Malefic
@A_Malefic Жыл бұрын
@@BytesNBits i use recalbox, not Raspain, and i get same errors when trying to instal whatewer.
@A_Malefic
@A_Malefic Жыл бұрын
@@BytesNBits how can i get all utills i need?
@BytesNBits
@BytesNBits Жыл бұрын
@@A_Malefic Have you logged into the console as root? wiki.recalbox.com/en/tutorials/system/access/root-access-terminal-cli You should get full access from there.
@A_Malefic
@A_Malefic Жыл бұрын
@@BytesNBits of course, im using root, because sudo didnt find too
@boycefenn
@boycefenn Жыл бұрын
I added that line to the rc.local with out the ampersand, now on bootup i get stuck at the running main loop screen and ctrl+c does not work. any suggestions?
@BytesNBits
@BytesNBits Жыл бұрын
You'll need to put the sd card into another computer and edit the rc.local file there.
@boycefenn
@boycefenn Жыл бұрын
@@BytesNBits I ran into issues doing that on my windows computer... Didn't consider doing it on a Linux computer until I read your reply. 🤦Thnx for the help
@perstoopid2024
@perstoopid2024 Ай бұрын
trying this with a pi 4, after running sudo ./fbcp-ili9341, the screen stays white and a gray line appears on one side. any fixes? i used this config cmake -DILI9486=ON -DGPIO_TFT_DATA_CONTROL=5 -DGPIO_TFT_RESET_PIN=6 -DSPI_BUS_CLOCK_DIVISOR=30 ..
@BytesNBits
@BytesNBits Ай бұрын
I think this video needs updating. The newer versions of the Pi OS miss part of the code the driver depends on. You could try installing an older version of the Pi OS. You'd need to use one from before the start of 2024.
@perstoopid2024
@perstoopid2024 Ай бұрын
@@BytesNBits i used retropie from 2022 but i ran sudo apt update, could that have updated it so that it doesn't work? either way im gonna try reinstalling retropie later, thanks edit: didnt work, still trying to fix
@Benzimma
@Benzimma Жыл бұрын
okay ive checked my connection twice went of gpio and did the install 5 times even tried on a new rasp-zero and Nothing on the screen when i sudo ./fbcp-ili9341 i have the same screen tft 3.2 and raspbery zero and nothing on the screen still please help! also nothing in folders to eddit >???
@BytesNBits
@BytesNBits Жыл бұрын
I'm not sure what to advise on this one. Have you been able to get anything on the screen with any other devices? I guess there are two possible causes. Either the code on the Pi is now out of date (the video is 2 years old and I haven't really played with this project since then) or the LCD panel has an issue.
@Benzimma
@Benzimma Жыл бұрын
@@BytesNBits thanks for the reply the pi zero connectors are adjacent to each other and I wasn’t getting a firm connection on breadboard I tried the pin connectors and works like a charm! … trying to work on a 8bitdo NES controller ! (But the ps5, controller ) works on Bluetooth like butter! …. Thanks A Bunch for the reply .. I had to bus my brain on this one 🤯😭🥳… I’m looking forward to any other projects your doing! Love the channel im At School 🥹👌🏾
@dejanjankovic9765
@dejanjankovic9765 Жыл бұрын
CMakeFiles/fbcp-ili9341.dir/depend.make:392: warning: NUL character seen; rest of line ignored i get this when i compile with make -j. Then an endless loop begins..
@BytesNBits
@BytesNBits Жыл бұрын
Hi. That's a strange one. I'd re download the library and try again. The Null character looks like some sort of file corruption.
@dejanjankovic9765
@dejanjankovic9765 Жыл бұрын
@@BytesNBits i did just that and it worked! thanks :) All this stuff with data is very sensitive and requires the utmost patience.
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 34 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 9 МЛН
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
RetroPie: A Raspberry Pi Gaming Machine
33:03
NetworkChuck
Рет қаралды 301 М.
I Made An Emulation Console For $15 & It Is AMAZING!
15:13
Madlittlepixel
Рет қаралды 62 М.
Orange Pi Zero 2W - Is It Really That Good? You'll Be Surprised!
29:23
Platima Tinkers
Рет қаралды 27 М.
Overclock Your Raspberry Pi Zero 2 to 1.4Ghz
20:53
Bytes N Bits
Рет қаралды 6 М.
When Did Raspberry Pi become the villain?
21:54
Jeff Geerling
Рет қаралды 1,5 МЛН
These Keys Shouldn't Exist | Nostalgia Nerd
19:32
Nostalgia Nerd
Рет қаралды 653 М.
Why You Need To Put A Raspberry Pi CM4 Inside Your PSP Right Now!
26:49
Macho Nacho Productions
Рет қаралды 975 М.
DIY Joystick wtih tactile switches for Retropie
11:59
Kalaakaar Makerspace
Рет қаралды 38 М.