How can I tell if a TFT LCD screen is compatible with Teensy3.6

Status
Not open for further replies.

bossredman

Well-known member
Hi,

Apologies for what might sound like a stupid question - but ...

How can I tell if a TFT LCD screen is compatible with Teensy3.6?

A while ago, I bought a 3.5" TFT LCD touch screen for a Raspberry Pi project (so I know the screen works).

Kuman 3.5 inch 320*480 Resolution Touch Screen TFT LCD Display With Protective Case + 3 x Heat sinks+ Touch Pen for Raspberry Pi 3 Model B, Pi 2 Model B & Pi Model B+ SC11
https://www.amazon.co.uk/dp/B01FX7909Q/ref=pe_385721_149135791_TE_item

But I'm now wondering if I can use it in a Teensy (3.6) based project I have.
I don't need the 'touch' screen functionality - it's literally just for displaying text.

I have no real knowledge of TFT screens & how they work & what makes them compatible etc.

This is the only other info I have on it:

Type :TFT
Interface :SPI
Touch panel control chip : XPT2046
The color index : 65536
Backlight: LED
resolving power: 320×480 (Pixel)
Size proportion: 8:5
power waste: TBD
Back facet current: TBD
Working temperature (c): TBD

Interface definition:

TFT Pin number/ identification/ description

1、17 3.3V ------ Power supply positive (3.3V power input)
2、4 5V -- ---- Power supply positive (5V power input)
3、5、7、8、10、12、13、15、16 NC --- --- NC
6、9、14、20、25 GND ------- Power GND
11 TP_IRQ ------ Touch panel interrupt, detect the touch panel is pressed down to a low level
18 LCD_RS ------- Instruction / data register selection
19 LCD_SI / TP_SI ------ LCD display / touch panel SPI data input
21 TP_SO ----- SPI data output of touch panel
22 RST ----- reset
23 LCD_SCK / TP_SCK LCD -------- SPI clock signal for display / touch panel
24 LCD_CS -------- LCD chip select signal, low level LCD
26 TP_CS --------- The touch panel chip select signal, low level selection of touch panel

If by any chance the answer is yes. Any idea what the corresponding Teensy pins would be pls.
 
Edit - my initial post is pretty much completely wrong - see bmilliers post below for a more useful answer

Original post:
________________________________________________________________
The key bit of info is the control chip - XPT2046

So google that + 'arduino library' is the key

In fact I just googled the name along and the first hit I get is https://github.com/PaulStoffregen/XPT2046_Touchscreen

So going to suggest that is a place to start, do double check all the pins since while the controller is the same whoever built the display may have swaped physical positions around, and it's also not impossible for there to be different resolutions etc you need to tweak if the chip is using different physical displays but in this case suspect you are good to go.
 
Last edited:
@ bossredman- The XPT2046 is actually the touchscreen controller, not the TFT display controller. You say you don't care about touch. The existing Teensy/Adafruit TFT display library is written for the ILI9341 TFT controller. This controller is capable of 320 X 240 max resolution. Your display is twice this. I strongly suspect it uses a different controller, so the existing library won't work. That said, there is no reason the Teensy couldn't drive your display if you can find a suitable driver. I have not personally seen other, higher resolution driver libraries mentioned in this forum, but others may have info that might help in this respect.
 
Thanks both of you for your thoughts.

I managed to find some more info on the display:
TFT-info.JPG

So based on what you've said previously, do I need to try & find a driver/library for ILI9486/ILI9488L??

Are drivers/libraries also specific to the mico-controller?

ie is it possible there is an ILI9486 driver/library specifically for Arduino boards say & also a different driver/library for Teensy boards?

At the end of the day, it's only becasue I have this screen already that I'm trying to get it to work with my Teensy project.
Can anyone recommend any other screens than the ones on the PJRC Store that will definately work with the Teensy 3.6 that have drivers/libraries available.
I'd prefer larger than the 2.2"/2.8" if possible as the screen will be viewed from the floor from a standing position.
It willmainly be for displaying just text & numbers.
[edit] Touch functionality is NOT required.

Thanks
 
There are RA8875 based 5" and 7" TFT displays, and sumotoy has written a library for those. I've also used one and wrote my own driver (for ugfx) so that display family might be an option.

They are also available with other controllers which have been reported to work better than the 8875, but I have no experience with those.
 
Yes, that combo would work. You can also buy a display module from China that includes a controller (iirc I bought one from buydisplay.com)
 
Yes, that combo would work. You can also buy a display module from China that includes a controller (iirc I bought one from buydisplay.com)

Thanks again.

Looks like buydisplay.com is US based & the China suppliers usually take about a month to deliver.
I'm in the UK & want the display ASAP while I have some time to work with it.

I'll keep looking - anyone know any UK base suppliers for these things pls?

Thanks again.
 
@bossredman: Since you are in the UK, you should take a look at the FT800 controller-based displays from FTDI, the UK firm that makes them. They have a very high performance TFT driver/graphics engine and you can get 3.5- 5" displays for less than the combo you listed above. FTDI supplies Arduino drivers for these displays- which I have used with the AVR chips found on Arduino boards in the past.
I took one of my spare FT800 4.3" TFT modules and wired it up to a spare Teensy LC I had on hand. The FTDI demo programs worked fine when compiled for Teensy LC- no changes needed. Should work OK on T3.6 as well. When I get a chance I'll try it on my Kickstarter T3.5 module- I don't have the T3.6 though.
here is a link to FTDI on line store page with several modules you could use:
http://shop.clickandbuild.com/cnb/s...oryID=330&title=EVE+Basic+Modules+-+Resistive

The module I had on hand (which I tested with Teensy) was very similar to the FTDI ones, but comes from MikroElektronika in Serbia:
http://www.mikroe.com/add-on-boards/display/connecteve/

I wrote several magazine articles centred around these FTDI FT800 displays a few years back, and I was impressed with them. The library routines are a bit harder to understand than the Teensy ILI9341 library, but this controller is MUCH more powerful.
 
Hi,

Following on from these discussions on TFT screens.
I've been searching on mounting options and can't seen to find anywhere to order a bezel for these screens.

Anyone know of a UK based supplier for a bezel for a 5" adafruit TFT screen pls?
 
I'm not sure if you have solved your problem yet with the 3.5" RPi screen.

I have one and have it working.

The chip is an ILI9486
The interface is 16 bit serial - it resembles notro's circuit at https://github.com/notro/fbtft/wiki/spi-interface-circuit

My 9486 driver based on Steve Strong's (https://github.com/stevstrong/Adafruit_ILI9486_STM32)

It is available at https://github.com/palmerr23/ILI9486_Teensy_Library

**** "_Teensy" version @96 MHz on a Teensy 3.2 *********

Code:
Benchmark                Time (microseconds)
Screen fill              833998
Text                     58792
Lines                    641303
Horiz/Vert Lines         70196
Rectangles (outline)     41054
Rectangles (filled)      2033791
Circles (filled)         419035
Circles (outline)        526319
Triangles (outline)      129835
Triangles (filled)       731887
Rounded rects (outline)  173153
Rounded rects (filled)   2254039



I also played with an update to the ILI9341_t3 library for this display.

After disabling the _CS and _DC lines from SPI direct control (to avoid timing issues with the 16 bit serial interface) there was < 20% benefit and the code is nearly 3 times as long.

The code for this _t3 library is at (not tidied up at all).

https://github.com/palmerr23/ILI9486_t3

The font files and other extras for the ILI9341_t3 library should work, but I haven't tested them yet. https://github.com/PaulStoffregen/ILI9341_t3

**** "_t3" version @96 MHz on a Teensy 3.2 *******
Code:
Benchmark                Time (microseconds)
Screen fill              833998
Text                     58792
Lines                    641303
Horiz/Vert Lines         70196
Rectangles (outline)     41054
Rectangles (filled)      2033791
Circles (filled)         419035
Circles (outline)        526319
Triangles (outline)      129835
Triangles (filled)       731887
Rounded rects (outline)  173153
Rounded rects (filled)   2254039
 
Last edited:
Hi - thanks for responding but I moved to a 5" RA8875 TFT display & managed to get that working fine.

Appreciate your response though.
 
Question on the palerr version of the ili9486 driver

I'm not sure if you have solved your problem yet with the 3.5" RPi screen.

I have one and have it working.

The chip is an ILI9486
The interface is 16 bit serial - it resembles notro's circuit at https://github.com/notro/fbtft/wiki/spi-interface-circuit

My 9486 driver based on Steve Strong's (https://github.com/stevstrong/Adafruit_ILI9486_STM32)

It is available at https://github.com/palmerr23/ILI9486_Teensy_Library

**** "_Teensy" version @96 MHz on a Teensy 3.2 *********

Code:
Benchmark                Time (microseconds)
Screen fill              833998
Text                     58792
Lines                    641303
Horiz/Vert Lines         70196
Rectangles (outline)     41054
Rectangles (filled)      2033791
Circles (filled)         419035
Circles (outline)        526319
Triangles (outline)      129835
Triangles (filled)       731887
Rounded rects (outline)  173153
Rounded rects (filled)   2254039



I also played with an update to the ILI9341_t3 library for this display.

After disabling the _CS and _DC lines from SPI direct control (to avoid timing issues with the 16 bit serial interface) there was < 20% benefit and the code is nearly 3 times as long.

The code for this _t3 library is at (not tidied up at all).

https://github.com/palmerr23/ILI9486_t3

The font files and other extras for the ILI9341_t3 library should work, but I haven't tested them yet. https://github.com/PaulStoffregen/ILI9341_t3

**** "_t3" version @96 MHz on a Teensy 3.2 *******
Code:
Benchmark                Time (microseconds)
Screen fill              833998
Text                     58792
Lines                    641303
Horiz/Vert Lines         70196
Rectangles (outline)     41054
Rectangles (filled)      2033791
Circles (filled)         419035
Circles (outline)        526319
Triangles (outline)      129835
Triangles (filled)       731887
Rounded rects (outline)  173153
Rounded rects (filled)   2254039

Downloaded the https://github.com/palmerr23/ILI9486_Teensy_Library version of this library and added to my environment; compiled the example to test it out, and It compiled fine but I am curious as to where the drawCirlce(), drawTriangle() and a few other functions are located? They are not in the .cpp file, not referenced in the .h file yet the code compiles fine. What am I missing here? I don't see any other included code that account for these routines. These functions are all referenced in the example code but I cannot find the source.

Update:My Bad, seems they are in the Adafruit_gfx library and I missed the include.
 
Last edited:
Replying to dslocum's post - that I can't see in this chain.

The pin assignments are in the Adafruit_ILI9486_STM32.h file

//Control pins |RS |CS |RST|
#define TFT_CNTRL GPIOA
#define TFT_RST PA1
#define TFT_RS PA0
#define TFT_CS PA4

#define TFT_CS_MASK BIT4
#define TFT_RS_MASK BIT0

The Pinouts for the R-PI board are standard and are listen in bossredman's original post in this thread.

Hope that helps
 
THanks for the super quick reply! Not sure what happened to my post. POOF! :-(

Actually, I was looking for the wiring for a Teensy 3.2, not an STM. I saw your #defines in the code, they didn't relate to the Teensy and my display which has different pin descriptions

Anyway if it helps someone else, I managed to get it working using:

Teensy 3.2 Display
------------------------------------
13 SCLK
12 MISO
11 MOSI
10 LCD_CS
9 LCD_DC
8 LCD_RST

Cheers!
 
THanks for the super quick reply! Not sure what happened to my post. POOF! :-(

Actually, I was looking for the wiring for a Teensy 3.2, not an STM. I saw your #defines in the code, they didn't relate to the Teensy and my display which has different pin descriptions

Anyway if it helps someone else, I managed to get it working using:

Teensy 3.2 Display
------------------------------------
13 SCLK
12 MISO
11 MOSI
10 LCD_CS
9 LCD_DC
8 LCD_RST

Cheers!

hey

I'm pretty new to all this, so forgive the noobness...
I'm trying to get my 3.5 TFT screen working.
I connected all the pins you mention (except for the SCLK, MISO and MOSI which relate to the SD card if I'm correct).
But it doesn't work.
My screen has TFTREAD and TFTWRITE pins, which I believe are the ones sending the data to display. Where am I supposed to connect them?
I don't see any reference to them in the ILI9486_Teensy_Library
 
Most probably, TFTREAD = MISO, TFTWRITE = MOSI.
MISO, MOSI and SCLK are necessary for the TFT to work. They are not exclusive of the SD card. The SPI interface is a bus: you connect the same SCK, MISO and MOSI to all the pertinent devices, then each device has its own CS=chip select.
 
Hi

Total Noob here, so please be gentle. Just got a Teensy 4.1 up and running - amazing board love it!

I would like to use a ILI9486 TFT and TP with it. They both work fine with a Mega2560 and when I wire it up as per the declarations in https://github.com/palmerr23/ILI9486_Teensy_Library .h file and run the graphictest program in the examples folder, the screen lights up, but doesn't reset or show any data. I'm wiring as follows;
13 SCLK
12 MISO
11 MOSI
10 LCD_CS
9 LCD_DC
8 LCD_RST

Any help would be appreciated.
Thanks
 
Hi

Total Noob here, so please be gentle. Just got a Teensy 4.1 up and running - amazing board love it!
Hi and welcome.

Might help to know which display you are trying. It worked with which library on Mega? Test sketch? Is it setup for +5v or 3.3v?

it also might help to see picture of your setup, to maybe catch anything maybe obvious. Thing like are the IO pins soldered on the Teensy. Or is power and ground hooked up.
 
Hi,

My two ILI9486 libraries are modifications of the Adafruit ILI9341 code - one generic and one based on the ILI9341_t3 Teensy-optimised code. From memory, the only changes I made were in the initialisation, so that the appropriate registers were written.

https://github.com/palmerr23/ILI9486_t3

Good to hear that you have a Mega2560 version running.

As Kurt says, it's important to know exactly what TFT hardware you have, and particularly if you have any other hardware or (particularly) SPI-related libraries used. Uninitialised SPI hardware can sometimes transmit on the bus, if the CS pin hasn't been intentionally driven HIGH.

I had the library working with a T3.6, and no trouble driving the inputs with 3.3v, and 5v to VCC and LED.
Code:
#include <Adafruit_ILI9486_Teensy.h>
#include <XPT2046_Touchscreen.h>
#include <SPI.h>
#define SPI_SS 10  // standard SPI pinouts, simply asserting the SS pin
Adafruit_ILI9486_Teensy MYTFT;

Here's a snip from my documentation:

tft pins.jpg

I hope that helps.

Also, can you cut and paste the relevant parts of your definitions and setup() code if you need further assistance in getting it working?
 
Thanks Palmerr.

Can't id the hardware beyond knowing its an ILI9486 controller - apart from that, its anonymous!

Turns out the board is SPIO for touchscreen and parallel for LCD. My mistake. I bought it on the basis it was SPIO for both. As a shield, it just plugs into a UNO/Mega. It's only by going via a breakout board and wiring every pin and seeing when it breaks, I was able to confirm that the LCD is using the parallel interface.

Might try using the breakout board to wire the parallel interface to Teensy and test that or more likely, I'll use this as an excuse to buy a larger (7") TFT which is definitely SPIO :)

Thanks again for your advice and attention. The Teensy 4.1 board is just ridiculously powerful. The only possible 'improvement' I could ask for is a version with the RJ45 on board, but that would require an extra square centimetre of real estate - madness!
 
Status
Not open for further replies.
Back
Top