Pocket Adventures.com
by John Till

Products| Guides|

Setting up an ILI9341 SPI Display

The SPI Adapter is designed to operate with two different drivers. For a Raspberry Pi Zero, it is advised to use the 30Hz jumpers and the standard fbcp drivers. (Note that 30Hz and 60Hz are just approximations.)

The reason for this recommendation is because the 60Hz (fbcp-ili9341) driver is designed to utilize its own processing core. The Pi Zero only has a single core.

30Hz (recommended for Pi Zero)

These instructions are inspired by this Sudomod forum post.

Change a couple of options in the Raspberry Pi configuration:
sudo raspi-config
In the Advanced Options:
Disable Overscan
In the Interfacing Options: Enable SPI
Exit raspi-config and restart the device.
sudo modprobe fbtft_device custom name=fb_ili9341 gpios=reset:25,dc:24 speed=30000000 fps=30 bgr=1
con2fbmap 1 1 sudo nano /etc/modules
Enter the following two lines below what is already there:
spi-bcm2835
fbtft_device
Save the changes by pressing Ctrl-X, Y, Enter.

Next, create the SPI configuration:
sudo nano /etc/modprobe.d/fbtft.conf
Enter the following line:
options fbtft_device name=fb_ili9341 gpios=reset:25,dc:24 speed=30000000 fps=30 bgr=1 custom=1
Save the change by pressing Ctrl-X, Y, Enter.
Restart the device.

Finally, install fbcp. (You can learn more about it here.)
sudo apt-get install cmake
git clone https://github.com/tasanakorn/rpi-fbcp
cd rpi-fbcp/
mkdir build
cd build
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
To test it, type "fbcp" and press Enter.

Now, it's time to add it to the device startup:
sudo nano /etc/rc.local
JUST BEFORE the exit 0 line, add the following line:
fbcp &
Save the change by pressing Ctrl-X, Y, Enter.

60Hz (recommended for multi-core single board computers)

Follow the installation instructions here.




Copyright © 2018 Pocket Adventures.com