3.2" TFT touch = white screen?

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Doug328
 
Posts: 10
Joined: Fri Aug 29, 2014 7:07 pm

3.2" TFT touch = white screen?

Post by Doug328 »

I have a 3.5" TFT 320x480 + Touchscreen Breakout Board w/MicroSD Socket (Adafruit) running an an Arduino Mega (Adafruit). I can't get the touch screen to work--the mega just shows a white screen on startup.

The screen is hooked up in 8-bit-parallel mode.
I changed some of the pins because I did not understand the instructions, plus the tutorial claims this works anyway. The parts changed are below. These are taken from the paint example sketch.

Code: Select all

#define YP A3  // must be an analog pin, use "An" notation!
#define XM A2  // must be an analog pin, use "An" notation!
//#define YM 9   // can be a digital pin
//#define XP 8   // can be a digital pin
#define YM 37   // this is changed
#define XP 36   // this is changed
Further onward:

Code: Select all

//#define LCD_CS A3
//#define LCD_CD A2
//#define LCD_WR A1
//#define LCD_RD A0
#define LCD_WR 33 // these are pins I changed the screen controls to
#define LCD_RD 32 // to get the digital control pins
#define LCD_CS 35 // off the analog pins, which are needed for the touch screen input ,,,,, I think?
#define LCD_CD 34 // 
Some of my confusion comes from the fact that A2 and A3 are assigned as two different screen pins.
In the Adafruit tutorial, when connecting the screen for display only----the screen control pins use A2 and A3.
Later on when connecting the touch screen jumpers, the screen touch controller also uses A2 and A3.....
Are there supposed to be two screen pins connected to both A2 and two more screen pins connected to A3? I did not try that as I had not seen that done before.

I can compile and upload the graphics display sketch and it runs normally. It is only the touch screen sketches that do not work. All I get is a white screen.

The only serial message I get is:

Code: Select all

Paint!
Unknown LCD driver chip: 8357
I have also tried using the cpp and h files off github and got the same thing.

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

Re: 3.2" TFT touch = white screen?

Post by adafruit_support_rick »

I just updated the example files for the library. Please download them again

User avatar
Doug328
 
Posts: 10
Joined: Fri Aug 29, 2014 7:07 pm

Re: 3.2" TFT touch = white screen?

Post by Doug328 »

It is working now, mostly...
1) I redid the wiring as the tutorial said. I didn't want to connect multiple display lines to one pin because of the hassle of that so I thought I could move them, but that doesn't work?
2) I can see from using the paint program that the X and Y of the touch input are flipped on the touch input. I have no idea how that would be fixed
3) it seems like it takes LOT of pressure to get the paint program to work..... like, I am pressing so hard that I am afraid of the screen breaking.

I bought two screens and have only tried one in parallel, I may try them each both ways.....

Is there any way to tell if a screen is capacitive or resistive just by inspecting the hardware? I have another I bought elsewhere and the pressure it requires is drastically lower. It appears to have the exact same kind of overlay that the Adafruit screen does. The manufactuer's site doesn't specify which type the touch sensor is.

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

Re: 3.2" TFT touch = white screen?

Post by adafruit_support_rick »

The capacitive touch screen doesn't have an overlay, so they're easy to tell apart.

Have you tried adjusting the pressure parameter in the example code?

User avatar
Doug328
 
Posts: 10
Joined: Fri Aug 29, 2014 7:07 pm

Re: 3.2" TFT touch = white screen?

Post by Doug328 »

I have tried setting the minimum pressure down to 1. It doesn't make much difference.

I have a similar screen I bought elsewhere, that also has a resistive overlay. That screen takes only a light touch, it works edge to edge, and it picks up exactly where you pressed.

The touch screen works but seems to be struggling. It's really only sensitive over about the center 1/3 area of the screen. Sometimes it will pick up contact all the way to the edge and other times it stops detecting 1/4" or more from the edges.

I did notice this in the paint example:

Code: Select all

digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
In the parallel wiring tutorial, there isn't anything connected to pin 13. What was this supposed to do? It is the clock in SPI mode.
The 8-bit touch screen tutorial connects the touch screen lines to A2 and A3, and pin 8 and pin 9.
I did edit the example to set #8 and #9 high then low here. Helps a lot but still not real good tho.

I also tried putting a delay condition inside the 'if' statement that checks for pressure, so that it waits at least 20ms between painting. That makes it respond somewhat smoother.

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

Re: 3.2" TFT touch = white screen?

Post by adafruit_support_rick »

We can try replacing the screen. Please email [email protected] with a link to this thread for a replacement
Doug328 wrote:I did notice this in the paint example:
I don't know why that's in there.

User avatar
Doug328
 
Posts: 10
Joined: Fri Aug 29, 2014 7:07 pm

Re: 3.2" TFT touch = white screen?

Post by Doug328 »

adafruit_support_rick wrote:We can try replacing the screen. Please email [email protected] with a link to this thread for a replacement
It isn't the hardware, it's the code.
I get a LOT better results changing the NUMSAMPLES in TouchScreen.cpp to 3.

Code: Select all

#define NUMSAMPLES 3 // changed from 2
Maybe the manufacturer hand-picked some cherries when they sent samples? ;)

Also if one has a number of serial lines printing for debugging, that slows the whole arduino down a lot. That is obvious if you are experienced with these things but maybe not if you are relatively new to it.
I don't know why that's in there.
I guess that was to blink the led when it was picking up contact? The TX light goes on anyway if you have the serial monitor on and the serial.print lines un-commented.

Part of the confusion is that the touchscreen coordinates seem to be different than the drawing coordinates. And th epressure value was inverted? (low pressure = high number)

Also I can't see a way to print text correctly in landscape mode? If you rotate the screen at all, any text is shown backwards.

The pin masking thing seems to be a speed issue, I am assuming: http://www.codeproject.com/Articles/732 ... or-Arduino

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

Re: 3.2" TFT touch = white screen?

Post by adafruit_support_rick »

Doug328 wrote:Also I can't see a way to print text correctly in landscape mode? If you rotate the screen at all, any text is shown backwards.
I seem to recall that is a known bug. I can't find the reference to it just now...
Doug328 wrote:Part of the confusion is that the touchscreen coordinates seem to be different than the drawing coordinates.
In the tftpaint example, the touch coordinates are rotated to the drawing coordinate system.
Doug328 wrote:And th epressure value was inverted? (low pressure = high number)
Yes, that's the way it comes from the device.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: 3.2" TFT touch = white screen?

Post by adafruit2 »

yah we have an outstanding bug in 8-bit parallel mode rotation, its on our list to fix! its in the setRotation() code, we have to adjust the MADCTL values

User avatar
Doug328
 
Posts: 10
Joined: Fri Aug 29, 2014 7:07 pm

Re: 3.2" TFT touch = white screen?

Post by Doug328 »

I wired the display in SPI mode and it works that way with no problems.

On a mega, the speed difference (between parallel and SPI) when using the paint example doesn't seem that significant.
And I intended to use it for a control panel with on-screen buttons, so showing animations or video isn't going to be an issue anyway.

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

Return to “Other Arduino products from Adafruit”