[Guide] ili9341 SPI TFT Screen on Retropie

Various user-contributed guides for hardware-related things
User avatar
moosepr
Posts: 509
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 227 times
Contact:

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by moosepr » Mon Sep 04, 2017 12:33 am

Dam that is bad news 😞 if you can get your hands on a temperature controlled soldering iron, and keep it as low as you can while still being able to melt the solder. If you order those boats from osh, check the pads don't touch the traces (scroll back though the chat to find a picture) it's easy to fix with a knife, just cut a gap in the copper.

The board is designed for 14 pin screens, but it will work on 18 pin ones too, you just get a little overhang
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

username 123
Posts: 134
Joined: Thu Jun 09, 2016 5:45 pm
Has thanked: 33 times
Been thanked: 29 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by username 123 » Fri Sep 08, 2017 7:30 pm

Does anyone know how to setup the touch screen part of this tft lcd?

User avatar
moosepr
Posts: 509
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 227 times
Contact:

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by moosepr » Sat Sep 09, 2017 1:54 am

There is information about the code side of things over on the notro github (the guy who wrote the screen drivers)

https://github.com/notro/fbtft/wiki/FBTFT-on-Raspian

I'm not sure on the wiring though, might need a googling session
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

username 123
Posts: 134
Joined: Thu Jun 09, 2016 5:45 pm
Has thanked: 33 times
Been thanked: 29 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by username 123 » Sun Sep 10, 2017 12:50 pm

Thanks!

User avatar
Holydohnut
Posts: 197
Joined: Wed May 10, 2017 2:02 pm
Has thanked: 29 times
Been thanked: 70 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by Holydohnut » Tue Sep 12, 2017 6:21 am

Yum!
15052188348181265362146.jpg
15052188348181265362146.jpg (3.93 MiB) Viewed 1884 times

User avatar
moosepr
Posts: 509
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 227 times
Contact:

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by moosepr » Tue Sep 12, 2017 2:52 pm

It's worth it just for the sticker.! 😀
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

User avatar
RedPixel
Posts: 15
Joined: Sun Sep 17, 2017 4:41 am
Has thanked: 6 times
Been thanked: 8 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by RedPixel » Thu Sep 21, 2017 1:24 pm

I would like some help, please.

I have a couple of SPI screens lying around, and would like to hook them up to a few of my Raspberry Pi Zeroes (W).
2017-09-21 21.26.26.jpg
2017-09-21 21.26.26.jpg (231.74 KiB) Viewed 1748 times
My screens have the following text printed on them:
A red 1.44" SPI 128*128 V1.1
A red 1.8" SPI 128*160 V1.1
A black 1.44"SPI 128*128 V2.1

These screens, however, have slightly different pins:

I tried a few pinouts, but none worked... This was my latest try on the red V1.1:

Display Pin (GPIO)
LED 15 (22)
SCK 23 (11)
SDA 19 (10)
A0 16 (23)
RESET 18 (24)
CS 24 (8)
GND 20 (GND)
VCC 17 (3V3)

The command I entered was:
sudo modprobe fbtft_device custom name=fb_ili9341 gpios=reset:24,dc:23,led:22 speed=8000000 width=128 height=128
(I also tried different speeds and tried width=160, as I read somewhere that it actually is a 160*128 controller)

This gives me a black screen with some garbage pixels.. Backlight does come on.


Can anyone help me with a correct pinout and command?

User avatar
moosepr
Posts: 509
Joined: Wed Jan 25, 2017 6:18 am
Has thanked: 69 times
Been thanked: 227 times
Contact:

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by moosepr » Thu Sep 21, 2017 2:27 pm

Aha, your main problem is the driver on these smaller screens isn't actually ili9341

It will either be st7735r or ili9163, so try swapping the fb_ili9341 for fb_ili9163 or fb_st7735r

Also drop the speed to 40000000 the tiny screens don't like to go too fast.

Some of the v1.1 screens suffer from interesting issues with garbage pixels from a strange combination of screen and software configurations
Get a small cheep LCD in your project https://www.sudomod.com/forum/viewtopic.php?f=22&t=2312
Wrap it all round a battery https://www.sudomod.com/forum/viewtopic.php?f=13&t=2292
Or use a custom PCB to make it really small https://www.sudomod.com/forum/viewtopic.php?f=13&t=2512
or make it really really really really tiny!! https://www.sudomod.com/forum/viewtopic.php?f=13&t=2919

User avatar
RedPixel
Posts: 15
Joined: Sun Sep 17, 2017 4:41 am
Has thanked: 6 times
Been thanked: 8 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by RedPixel » Fri Sep 22, 2017 5:36 am

Yes! Thanks so much!

I followed your instructions on https://retropie.org.uk/forum/topic/917 ... ld-wip/117 and combined it with your advice here :)

So now my pinout is:

Display Pin (GPIO)
LED 16 (23)
SCK 23 (11)
SDA 19 (10)
A0 18 (24)
RESET 22 (25)
CS 24 (8)
GND 20 (GND)
VCC 17 (3V3)

The contents of /etc/modprobe.d/fbtft.conf is:
options fbtft_device name=fb_ili9163 gpios=reset:25,dc:24,led:23 speed=40000000 bgr=1 rotate=1 custom=1 fps=60


I'm gonna write a little guide soon :)

edit: Guide is here: http://www.sudomod.com/forum/viewtopic.php?f=22&t=4181

salami738
Posts: 129
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 62 times
Been thanked: 38 times

Re: [Guide] ili9341 SPI TFT Screen on Retropie

Post by salami738 » Thu Nov 02, 2017 3:30 am

moosepr wrote:
Thu Feb 02, 2017 2:36 am
I was having a bit of a play with speeds last night, managed to get it all the way up to 90000000 (7 zeros) and a stable screen. Turning on the FPS indicator in the emulationstation UI settings gave me a nice surprise (if you can read that!)

Image

so i had a bit more of a play, up to 100000000 (8 zeros) and that was a bit too fast!!

Image

although the actual screen does flicker up, so maybe with shorter cables, it might work
Hi moosepr,

did you check the fps indicator before your tuning?
I was wondering about the results, because:

Raspberry emulator renders its output to fb0 (framebuffer 0), because this is the only framebuffer with hardware acceleration. This framebuffer is used for DPI, HDMI and composite displays.
If you use a SPI display, you have to use a tool like fbcp to copy the framebuffer contents from fb0 to db1 (SPI),
BUT: the emulator does not know that. So i think you saw the fps the emuator is rendering to the primary (fb0) framebuffer and the fps of your display varies, depending on your frequency. I am not aware of any tool to measure the fps of a display that ist used via SPI.

Any thoughts about this?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests