New PJRC TFT ILI9341 Sanity Check

Status
Not open for further replies.

Matadormac

Well-known member
I have just received my first set of Teensy 3.2's and companion 2.8 TFT SPI 240*320 V1.1 boards. Wired up the TFT and the Teensy 3.2 as per the wiring diagram on the PJRC website.

The graphics work just fine but I can only get the touchscreen to work when using the XPT2046_Touchscreen library. None of the ILI9341 touch screen examples work including those from the PJRC modified ILI9341_t3 library. The Adafruit ILI9341 libraries give the same results, great graphics but no TFT.

Give that the XPT2046 Touchscreen library works as it should that ought to indicate my wiring is correct.

No error messages.

I have checked wiring assigns but am at a stand still now. Are the touch screen examples in the existing ILI9341 libraries supposed to work with this PJRC lcd? I am using Arduino 1.6.6 on Windows 10 and the latest Teensyduino beta.

Suggestions?

Thank you in advance.
 
You need the library for the touch controller used on the display which is the XPT2046. Adafruit resistive touch displays use the STMPE610 chip (see https://learn.adafruit.com/adafruit-2-8-tft-touch-shield-v2/touchscreen-paint-demo) and capacitive touch use the FT6206. I have both these displays plus the PJRC/eBay with XPT2046.

Not all the demos in the examples folder of the XPT2046_Touchscreen (which ships with the ILI9341_t3 library Paul has optimized) work - touch paint needs to be rotated and then it works OK.

The ILI9341Test works well and gives you touch X Y and Z in realtime. I have tweaked it a bit to display Z and also a rolling delta of max-min for all three parameters. I can post that to Github though I am still clawing up that learning curve...
 
I have just received my first set of Teensy 3.2's and companion 2.8 TFT SPI 240*320 V1.1 boards. Wired up the TFT and the Teensy 3.2 as per the wiring diagram on the PJRC website.

The graphics work just fine but I can only get the touchscreen to work when using the XPT2046_Touchscreen library. None of the ILI9341 touch screen examples work including those from the PJRC modified ILI9341_t3 library. The Adafruit ILI9341 libraries give the same results, great graphics but no TFT.

You are seeing expected behavior, and the correct solution. The ILI9341_t3 is Display Only. It works for those displays using that controller - two of which are in the PJRC store. And the "_t3" library runs rings around the stock Adafruit version.

... the XPT2046 Touchscreen library works as it should that ought to indicate my wiring is correct.

I have checked wiring assigns but am at a stand still now. Are the touch screen examples in the existing ILI9341 libraries supposed to work with this PJRC lcd? I am using Arduino 1.6.6 on Windows 10 and the latest Teensyduino beta.

The "XPT2046 Touchscreen library' is a new development that extends/maps support for that touch controller present on some ILI9341 boards, like the one you got. To use TOUCH hardware and features you need the additional library code. The two are independent - in fact you could ignore the display and just use the touch feedback to create a special input device.

You should find the samples cartere pointed out to work as they include both device libraries.
 
Github though I am still clawing up that learning curve...

GitHub is real treat - harder to figure out than the Teensy . . .

As linked above I've dropped some samples and updates on that thread. I should start a new thread and link to my GitHub samples. I did a button scheme to allow TouchPaint to have the rotation issue resolved and some other button type samples that are specified and handled in 'common code' that may become a library rather than 'one off' in user code. But I'm distracted making it work using the interrupt pin so the user code doesn't POLL the SPI channel to detect a Touch. it works really well - but I just discovered an anomaly that has me back debugging that.

For now what I have shared is on this thread: ILI9341-restive-touch-miso-not-connected

https://github.com/Defragster/XPT2046_Touch_Examples/blob/master/IntTouchPaintDeb/IntTouchPaintDeb.ino

and : https://forum.pjrc.com/threads/30559-2-8-ILI9341-restive-touch-miso-not-connected?p=87357&viewfull=1#post87357

https://github.com/Defragster/XPT2046_Touchscreen/blob/25c3054e13397a18e4299d24387d643de2f683bd/examples/onoffbutton/onoffbutton.ino
 
Thank you one and all for your replies. When I get home tonight I will complete reviewing your links. I already see several demo sketches making use of the new touch screen controller that will help me greatly.

So, I was sane (at least at the time) and it was the new touch library working separately from the graphic display library. And I agree from my short exposure that the new PJRC touchscreen library is miles and awyay faster than Adafruit's. I just need to understand better how to map buttons for my project.

Best

Matadormac
 
As noted - I'm working on a generic handler for buttons declared in a 'struct' array as in my samples - I did it on the TouchPaint - simple swap but odd and not very developed. I did a mapping of the touch to pixel - and then made that work under rotation to any screen orientation. [of course the dimensions change {i.e. 240x320 or 320x240} so the user defined buttons have to fit - this just gives rise to more button descriptors that can have dual locations depending on the orientation so they auto re-locate ... not done yet]

The onoffbutton sample I did was more advanced and has buttons, toggles, and detects sliding buttons (one half of toggle to the other). But I put that on hold to get an interrupt detector working so the code could never poll without expecting a touch to be present. The struct needs to be expanded and the code updated to account for it as the button types keep evolving and expanding. Once those were done Frank asked for a slider/pot type button - which I can see easily done - but not back to it yet.
 
Hello.

Thank you Cartere, bboyes and defragster, et al. Well I have been working through the examples mentioned and anything else I could research that was gerund. I have begun bringing over from a DUE deployment a current project. I have stripped it down to its first button component. So far it is working BUT when I touch the button I get hundreds' of returns. I think I haven't got the loop properly constructed but after some hours I am failing to see what to correct.

I have moved the substance of this post to a new post in the forum for more clarity and adherence to subject headings.

Thank you

Matadormac
 
Last edited:
Status
Not open for further replies.
Back
Top