Introduction: Connected Round Screen (240x240, GC9A01 Controller) to Raspberry PI!
X, google's moon shot factory has a famous metaphor that starts with:
"Let’s teach a monkey how to recite Shakespeare while on a pedestal".
I took it quite literally, and built this (attached).
For that, I wanted to play a video on a small round screen.
Little as I know, the fact that you could play video on some 240x240 LCD SPI screens doesn't mean it's easy on all of them. How I played video and showed my desktop on Round 240x240 1.28inch LCD Screen Module with a raspberry pi!
- Screen: Round 240x240 1.28inch LCD Screen Module + (it's cables)
- Raspberry pi 3 B+
- Micro SD and Power Suplly (for Pi)
- MicroSD port in your computer or microSD <--> USB adapter
Note: this require old Pi OS that I think doesn't work on Pi 4, (someone has Pi 4 to check?)
Step 1: Install Right OS on the Pi
Download OS into MicroSD
Follow this: https://www.raspberrypi.org/documentation/computers/getting-started.html#setting-up-your-raspberry-pi
One of the libraries that we use (fbtft flex https://github.com/notro/fbtft/wiki/flexfb ) need an old OS version to run which you can download here:
In the Raspberry Pi Imager -> choose OS -> Use custom -> choose the old OS file
Step 2: Connect to Regular Monitor
Connect your MicroSD to RPI, connect to power, connect keyboard and screen- your Pi is running!
The first time seeing that the Pi is a full-blown computer is super cool :)
Step 3: Setup OS to Work With the Round Screen #1
Short explanation (not a must):
It's hard to show videos (regular 24+ fps) on SPI (the protocol and connection type) connected screen. Because the SPI interface is limited in the amount of data it can transfer. So smart people repurposed the optimization in the HDMI connection for the SPI connection. Basically, processing it for the HDMI, and just copy the frame buffer HDMI output to the SPI frame buffer (fb1).
Like we can see a desktop when we connect the Pi to HDMI, we will see the same output in the SPI connected screen!
Original manual (for a different screen)
1. Open and edit the configuration file to enable modules
Write these in the linux command line (still connected to regular HDMI monitor)
sudo nano /etc/modules
Append three statements to the end. ( first one is to enable SPI and another is to enable fbtft module)
spi-bcm2835 flexfb fbtft_device
2. Create a new configure file
sudo nano /etc/modprobe.d/fbtft.conf
3. Save these statements to the file (this was the hard part I had to crack and change from the original manual) Note: you can open this guide on the Pi (you have a browser) and copy from here, or transfer with USB.
Explanation about the parameters here
4. Restart your Raspberry Pi
5. After restart you can find that a fb1 device is listed at /dev, it means the device has been enabled successfully
Step 4: Setup OS to Work With the Round Screen #2
To display the desktop, we just need to copy the data of fb0 to fb1, keep the fb0 and fb1 being same.
1) Install tools
sudo apt-get install cmake git
2) Download the open-source code
cd ~ git clone https://github.com/tasanakorn/rpi-fbcp cd rpi-fbcp/ mkdir build cd build/ cmake .. make sudo install fbcp /usr/local/bin/fbcp
3) Set the code to auto-run when booting
sudo nano /etc/rc.local
sleep 30 fbcp&
before "exit 0".
The “&” is necessary for code run in background, otherwise the OS cannot boot anymore.
4) Set display size on config file
sudo vi /boot/config.txt
5) Append to the file:
hdmi_force_hotplug=1 hdmi_cvt=300 300 60 1 0 0 0 hdmi_group=2 hdmi_mode=1 hdmi_mode=87 display_rotate = 1
Now after restart the Pi, the LCD will display desktop of Pi
Step 5: Connect the Round Screen!
Just connect the wires like the scheme. Ignore the 3 wires connected to the switch (the red button).
And reboot with the wires connected (and the HDMI disconnected).
If something went wrong and you can't see anything on the round screen, try to connect to HDMI, if also nothing, maybe you will need to start over and reinstall a fresh OS on the microSD :/
Step 6: Extra Footage
Step 7: Other Methods I Tried
-Draw images with provided python example, maybe try to change just changed pixels? (but then what about audio???)
-Using this post circuit python for this driver (slow fps ~9) https://www.pcbway.com/project/shareproject/Raspberry_Pi_Pico__CircuitPython_and_Round_Display_GC9A01.html
-Trying to make this amazing library https://github.com/juj/fbcp-ili9341 work for this controller?
Maybe using this 1.3” waveshare example (I have python code example that matches the same format of my 1.28”) and convert the options. https://www.waveshare.com/1.3inch-lcd-hat.htm
-Using fbtft: Using the deprecated flexfb option (need raspberry os before 5.4). https://www.waveshare.com/w/upload/6/6b/1.3inch_lcd_hat_user_manual_en.pdf
+ the specific init code for this screen (from waveshare python example for this round screen) WORKED!
Step 8: Share If It Helped!
It took many days to successfully connect the screen. I didn't really have the motivation after to share how I did it.
But if it will save someone some time it will be super cool!
1 year ago
Perfect tutorial. I just had to enable this in the /boot/config.txt in order to make fb1 to be enabled. I think its missing in the tutorial: dtparam=spi=on
Thank you very much for the tutorial.
Reply 1 year ago
I am soo glad it helped someone!
1. I don't remember using " dtparam=spi=on" and can't see it in the original tutorial https://www.waveshare.com/w/upload/6/6b/1.3inch_lc...
Did you add this to the end of config.txt? Did any one else encounter it?
2. What project did you use the round screen for? Can you share a photo? :)
Reply 1 year ago
Reply 1 year ago
1 year ago
Thank YOU!! You are a genius!! You saved me. :)
1 year ago
Sure :) https://www.thingiverse.com/thing:5079305
Question 1 year ago on Step 8
Very nice!!! Can you share the files for the 3d print?