0

I have an old TFT LCD SPI screen, which I believe uses ILI9341 and would like to use it on my (old) RPi A+. Unfortunately, it just stays blank. I am not even sure it is working... My RPiA+ has a fresh Raspbian Stretch.

I have wired my screen following this blog and using this pin layout. Just in case I haven't understood correctly:

  • I have wired VIN of the screen to 3.3 VDC power on the Pi (pin 1)
  • I haven't wired MISO and SDCS: my understanding is that they are for the SD card on the screen - which I do not use
  • The LED is my case is wired to GPIO 2
  • MOSI goes to "MOSI SPI GPIO 12"
  • SCK goes to "SCLK SPI GPIO 14"
  • CS goes to CE0 SPI GPIO 10
  • D/C goes to GPIO 24
  • RST goes to GPIO 25
  • GND goes to ground

I tried to load the driver fb_ili9341, but this isn't supported:

$ sudo modprobe fbtft_device name=fb_ili9341 gpios=reset:25,dc:24,led:2 speed=16000000 rotate=90 bgr=1
modprobe: ERROR: could not insert 'fbtft_device': Invalid argument

I listed the available modules with sudo modprobe fbtft_device name=list; dmesg | tail -30 and there was only one ili drivers: ili9481, so I decided to use that one (but I am not sure this is correct).

So, I tried again:

$ sudo modprobe fbtft_device custom width=320 height=240 name=ili9481 gpios=reset:25,dc:24,led:2,cs:10 speed=16000000 rotate=90 bgr=1

This loads correctly as we see in dmesg:

$ dmesg
...
 2229.934312] graphics fb1: fb_ili9481 frame buffer, 240x320, 150 KiB video memory, 4 KiB buffer memory, fps=20, spi0.0 at 16 MHz
[ 2229.934512] fbtft_device: GPIOS used by 'ili9481':
[ 2229.934524] fbtft_device: 'reset' = GPIO25
[ 2229.934530] fbtft_device: 'dc' = GPIO24
[ 2229.934536] fbtft_device: 'led' = GPIO2
[ 2229.934542] fbtft_device: 'cs' = GPIO10
[ 2229.934562] spidev spi0.1: spidev spi0.1 125000kHz 8 bits mode=0x00
[ 2229.934578] fb_ili9481 spi0.0: fb_ili9481 spi0.0 16000kHz 8 bits mode=0x00

Then, according to the blog, I used con2fbmap 1 1 to redirect the console to my screen. It remains totally blank.

Also, I have enabled SPI in raspi-config.

So my questions are:

  1. Is my wiring correct?
  2. Is the driver I am using correct, and if not, which one should I use. There is no specific indication on the device itself...
  3. Is there a way to test if my screen is still working or damaged? SHould a LED be lighting up? (can't see one)
  4. If it is functional, Why isn't it showing anything?

Thanks !

1
  • The correct command is sudo modprobe fbtft_device custom name=fb_ili9341 gpios=reset:25,dc:24,led:2 speed=16000000 rotate=90 bgr=1 in my case. The screen lights up, although nothing shows yet, but I think that's another issue.
    – user509010
    May 6, 2018 at 18:02

1 Answer 1

0

There were 2 issues:

  1. The Invalid argument in my modprobe does not mean ili_9431 is not supported, but that my command has an invalid argument. ili_9431 is supported. It seems that the keyword custom is mandatory. So the right command should be sudo modprobe fbtft_device custom name=fb_ili9341...
  2. The GPIOs I used in my command line were wrong. To find the correct numbering of GPIOs for a given model of Raspberry Pi, I recommend using the command pinout which is from gpiozero. In my case, the correct values were gpios=reset:26,dc:19,led:27.

So, the full command is: sudo modprobe fbtft_device custom name=fb_ili9341 gpios=reset:26,dc:19,led:27 speed=16000000 rotate=90 bgr=1. As soon as this command is launched the LED on the screen lights up.

Note that fbtft_device does not need to be downloaded or installed on current Raspbian versions, it's already there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.