Raspberry Pi ili9341 Display Setup

Raspberry Pi ili9341 Display Setup

So, you are a proud owner of new Raspberry pi? Lets play with it a little bit. How about to add a spi LCD color display?

In order to use the spi display connected to the GPIO pins on raspberry, we need to have access to the raspberry pi. This can be easily achieved by following steps in my previous article. Once we have the connection over ssh, we can install the driver by following steps in this article. However, before we can start, make sure that the display is connected properly to correct GPIO pins. Specifically SCLK and MOSI pins must be connected to correct GPIO pins (SCLK->GPIO11 and MOSI->GPIO09). Also make note of where are connected pins RESET, DC and CS. Once we have this info, we can start installing the driver.

  1. ssh to the Pi using your favorite ssh client – connect to the IP you have found in previous part – most likely, the Pi keeps the IP address forever, but it might not be your case. In case you are not able to connect to the Pi after reboot, just try to find the IP on your router again
  2. once you are in Pi, enter following command “sudo raspi-config
  3. navigate to “Interfacing Options” and then select “SPI”
  4. on the next screen confirm that you want to enable the SPI interface – just select YES
  5. exit raspi-config
  6. enter following command “sudo nano /etc/modules
  7. once the file is open, add these two lines at the very end of file:
    spi-bcm2835
    fbtft_device
    

    Raspberry pi modules

  8. Install fbcp driver (one command per line you have to enter every line)
    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
  9. enter following command “sudo nano /etc/rc.local
  10. once the file is open, enter this text before line that says “exit“:
    fbcp&
  11. create a new file by entering this command: “sudo nano /etc/modprobe.d/fbtft.conf
  12. when the file is created and opened, enter following line(replace XX with your actual pins):
    options fbtft_device name=fb_ili9341 gpios=reset:XX,dc:XX,cs:XX speed=40000000 rotate=90 fps=60 bgr=1 width=240 height=320 custom=1
  13. reboot the pi by typing following comand: “sudo reboot

Leave a Reply

Vaša e-mailová adresa nebude zverejnená.

Táto webová stránka používa Akismet na redukciu spamu. Získajte viac informácií o tom, ako sú vaše údaje z komentárov spracovávané.