Adafruit 1.14" 240x135 Color TFT not working with Raspberry

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
55jr55
 
Posts: 4
Joined: Sun Nov 21, 2021 1:03 pm

Adafruit 1.14" 240x135 Color TFT not working with Raspberry

Post by 55jr55 »

I have the Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789 (https://www.adafruit.com/product/4383) connected to a Raspberry Pi Zero W.

I cannot get it to display an image or paint a rectangle on the display. I can see the display reset using the code below but that's it. I have gotten this code working on a generic ST7789 display with the appropriate wiring.

Any help is appreciated.

Regards,
John

Connections are:

display -> pi
Vin -> 3.3
GND -> GND
SCK -> SCLK (D11)
MISO -> not connected
MOSI -> MOSI (D10)
TFTCS -> CE0 (D8)
RST -> D6
DC -> D5
SDCS -> not connected
LIT -> D4

I have SPI enabled and the latest versions of the required libraries:
pi@raspberrypi:~/135x240 $ ls /dev/*spi*
/dev/spidev0.0 /dev/spidev0.1 /dev/spidev1.0 /dev/spidev1.1 /dev/spidev1.2
ST7789 0.0.4
Pillow 8.1.2
Python 3.9.2
pi@raspberrypi:~/135x240 $ uname -a
Linux raspberrypi 5.10.63+ #1459 Wed Oct 6 16:40:27 BST 2021 armv6l GNU/Linux

Code: Select all

import ST7789  
from PIL import Image  
from time import sleep  

display=ST7789.ST7789(port=0,cs=0,rst=6,dc=5,backlight=4,rotation=0,width=240,height=135,spi_speed_hz=160000000)  
display._spi.mode=3  
display.reset()  
display._init()  

image=Image.new('RGB',(240,135),(0,255,0))
display.display(image)  
sleep(2)  
image=Image.open("blinka.jpg")  
image=image.resize((240,135),resample=Image.LANCZOS)  
display.display(image)

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit 1.14" 240x135 Color TFT not working with Raspbe

Post by mikeysklar »

Those pinouts look a little off when comparing to our guide for the 1.14" display.

Code: Select all

Vin connects to the Raspberry Pi's 3V pin
GND connects to the Raspberry Pi's ground
CLK connects to SPI clock. On the Raspberry Pi, thats SLCK
MOSI connects to SPI MOSI. On the Raspberry Pi, thats also MOSI
CS connects to our SPI Chip Select pin. We'll be using CE0
RST connects to our Reset pin. We'll be using GPIO 24 but this can be changed later.
D/C connects to our SPI Chip Select pin. We'll be using GPIO 25, but this can be changed later as well.
https://learn.adafruit.com/adafruit-1-1 ... 3042525-12
ssd7789-1.1.4.jpg
ssd7789-1.1.4.jpg (106.13 KiB) Viewed 433 times
Can you post a photo of your wiring and any soldering you have done?

User avatar
55jr55
 
Posts: 4
Joined: Sun Nov 21, 2021 1:03 pm

Re: Adafruit 1.14" 240x135 Color TFT not working with Raspbe

Post by 55jr55 »

Hi Mikey,

Thanks for the reply. So I changed my wiring to match yours, ran the code from the guide and it works. So then I thought why was I using different pins and code and I remembered, I started using the code I posted on a generic display and thought I could use if on the 1.14 Adafruit display with some changes to match the pinouts. Sorry to waste your time with something that is pilot error.

I do have a question on the D/C pin. In most SPI references, they talk about the other pins, SLK, MOSI, MISO and CS. I haven't seen one that mentions D/C but I see that pin on all the SPI displays. What exactly is that pin used for?

Thanks,
John

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit 1.14" 240x135 Color TFT not working with Raspbe

Post by mikeysklar »

John,

Glad you got the wiring worked out.

The D/C pin is the TFT SPI data or command selector pin. It is used to differentiate whether a command is being sent or data. For example setting D/C low would indicate a command to the display is being sent and pulling D/C high would indicate data to be displayed is coming through.

User avatar
55jr55
 
Posts: 4
Joined: Sun Nov 21, 2021 1:03 pm

Re: Adafruit 1.14" 240x135 Color TFT not working with Raspbe

Post by 55jr55 »

Great info. Thanks for the help!

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”