HXD8357D Display & Raspberry Pi

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.
User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: HXD8357D Display & Raspberry Pi

Post by adafruit_support_rick »

voyager99 wrote:Thanks, yeah, I get that!
I also understand the need for different screen designs with different physical
pin locations to match specific hardware (for the variety of Arduino's / Pi's, etc
that are available), but given that the wiring changes are accounted for,
I'm a little surprised that the drivers would be written for specific devices only.
It should have been possible to write generic drivers and include *.h files
for the specific hardware.
Pi and Arduino are completely, totally, entirely, 100% different. It is not simply a matter of pin locations. Processor architecture is different, peripheral architecture is different, Pi runs linux, Arduino has no operating system, etc.

That said, it is not particularly difficult to port an Arduino library to python, and then run the python on a Pi. However, a python port of the HX8357 Arduino library would not be able to function as a console display on a Pi. It could only operate as an application display. Console display functionality requires a kernel-mode driver in linux. That's what is in the PiTFT fork of raspbian

-----------------

intensivex: That looks right to me!

User avatar
voyager99
 
Posts: 6
Joined: Thu Oct 04, 2012 1:00 pm

Re: HXD8357D Display & Raspberry Pi

Post by voyager99 »

Hello Rick or Intensivex:

Sorry, I may not have explained my earlier inquiry correctly.
So, I'm not looking to use the PiTFT as a framebuffer device to run any
version of XWindows or the Raspbian GUI using startx.

All I would like to do is use this display:

PiTFT Plus Assembled 320x240 2.8" TFT + Resistive Touchscreen
link: https://www.adafruit.com/product/2298

to display simple graphics, like lines, rectangles, text, etc.
I would like to use the Adafruit Python ILI9341 library with the example
listed below.

Code: Select all

import Image
import ImageDraw
import ImageFont

import Adafruit_ILI9341 as TFT
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.SPI as SPI


# Raspberry Pi configuration.
DC = 18
RST = 23
SPI_PORT = 0
SPI_DEVICE = 0

# BeagleBone Black configuration.
# DC = 'P9_15'
# RST = 'P9_12'
# SPI_PORT = 1
# SPI_DEVICE = 0

# Create TFT LCD display class.
disp = TFT.ILI9341(DC, rst=RST, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=64000000))

# Initialize display.
disp.begin()

# Clear the display to a red background.
# Can pass any tuple of red, green, blue values (from 0 to 255 each).
disp.clear((255, 0, 0))

# Alternatively can clear to a black screen by calling:
# disp.clear()

# Get a PIL Draw object to start drawing on the display buffer.
draw = disp.draw()

# Draw some shapes.
# Draw a blue ellipse with a green outline.
draw.ellipse((10, 10, 110, 80), outline=(0,255,0), fill=(0,0,255))

# Draw a purple rectangle with yellow outline.
draw.rectangle((10, 90, 110, 160), outline=(255,255,0), fill=(255,0,255))

disp.display()
The description for the 2.8" PiTFT lists that:
"The display and touchscreen uses the hardware SPI pins
(SCK, MOSI, MISO, CE0, CE1) as well as GPIO #25 and #24. All other GPIO are unused."

Can you please tell me what the pin numbers are to modify the example above
(i.e.):
DC = 18
RST = 23
SPI_PORT = 0
SPI_DEVICE = 0

A pinout for the 3.5" PiTFT Plus is:
tft3.5Pinouts.png
tft3.5Pinouts.png (948.83 KiB) Viewed 484 times
Thanks for your help.
Danny

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: HXD8357D Display & Raspberry Pi

Post by adafruit_support_rick »

I believe you would change DC to 25. There is no reset line on the PiTFT. You can leave that set to 23, or set it to any other unused GPIO.

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

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