-
1Step 1
Download retropie and flash your SD card
-
2Step 2
Connect screen to Raspberry like that (from screen to raspberry) :
- VCC to 3.3 volt (pin 17
- GND to GND (pin 20)
- CS to CE0 (pin 24)
- RESET to GPIO 25 (pin 22)
- D/C to GPIO 24 (pin 18)
- SDI/MOSI to MOSI (pin 19)
- SCK to SCLk (pin 23)
- LED to GPIO18 (pin 12)
- SDO/MISO to MISO (pin 21)
-
3Step 3
Activate SPI :
Use raspi-config command to activate SPI
or
edit /etc/modprobe.d/raspi-blacklist.conf and remove or comment the line "blacklist spi-bcm2708".
Then, after a reboot, a dmesg | grep spi should return something like bcm2708_spi.
-
4Step 4
Load screen module :
from there, you can load the module via
sudo modprobe fbtft_device name=adafruit22a verbose=1
Then, a
dmesg | tail
should return lines about fbtft_device
Also,
fbset -fb /dev/fb1
should return information about the screen.
You can then test the screen by sending random data to it via :
cat /dev/urandom > /dev/fb1
Screen should then show pixel of random colors.
-
5Step 5
Dupplicate HDMI output :
you can then duplicate the HDMI output to that screen by downloading rpi-fbcp (https://github.com/tasanakorn/rpi-fbcp) :
cd git clone https://github.com/tasanakorn/rpi-fbcp cd rpi-fbcp mkdir build cd build cmake .. make
You can test it by lanching the program freshly built
fbcp &
Then, you’ll need to add it at boot :
sudo nano /etc/rc.local
Then, go at the end of file (but before the exit 0) and add a line where to find fbcp :
/home/pi/rbi-fbcp/build/fbcp &
If you reboot, the screen should reproduce what you see on the HDMI output.
-
6Step 6
Persist changes :
if previous steps were successful, you can then load the module at boot.
For that, add to /etc/modules following lines :
fbtft dma fbtft_device name=adafruit22a verbose=0 speed=48000000 rotate=90
That seems not working on latest RetroPie build (failed to load linux kernel modules at boot). In dmesg, it seems that SPI is loaded after that module which may be the source of the problem. It may be since systemd migration.
To fix it (not the cleanest way but it works), you can load the module at boot so edit your /etc/rc.local and add at the end (but before the exit 0) :
modprobe fbtft_device name=adafruit22a verbose=0 speed=48000000 rotate=90
-
7Step 7
Bonus :
To avoid screen to blank when showing console, add
consoleblank=0
in /boot/config.txt as described here.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
does not work, screen just shows white and that cat command gives a strange "device is full" please help
Are you sure? yes | no
I was not able to get fbcp loaded on startup by adding "/home/pi/rbi-fbcp/build/fbcp &". It seems that rc.local would simply omit to launch fbcp, any lines before and after the launch command would execute well... I guess it is something related to login.
I finally got it running by launching fbcp from "/usr/bin/emulationstation". I don't know i this is the right way to do it but seems to work for me.
Cheers
Are you sure? yes | no
Very cool and awesome project.
For booting line (Step 6), I had to put the lines into .bashrc, because otherwise it did not work.
But I have an issue, where my FPS is low, the screen loads after every 3 seconds or so. How could that be fixed that it would be smooth?
Are you sure? yes | no
Maybe try to change the speed parameter. 48000000 is for 48 Mhz, perhaps your screen can’t handle it. Try a lower value (32 Mhz or 16).
Are you sure? yes | no
You can upload a video of how to do?
It would be very interesting,
thanks for your work
Are you sure? yes | no
I added a line to path where I build rpi-fbcp at the end of /etc/rc.local.
Are you sure? yes | no
(step 5) I was able to build the rpi-fbcp. But how do I set it to launch at boot?
Are you sure? yes | no
You’ll need to add a line to /etc/rc.local file : sudo nano /etc/rc.local
Then, go at the end of file (but before the exit 0) and add a line where to find fbcp :
/home/pi/rbi-fbcp/build/fbcp &
Are you sure? yes | no