Sainsmart Due + 7" TFT Touch

Greetings,

I've bought the KIT as said on Subject and am experiencing issues with the Touch.

SainSmart sent me the libraries with the Demos. The UTFT_Demo_800x480 works perfectly fine. I just had to change the CTE50 to CTE70. I use Landscape on this Demo.

Then I have made the calibration, using portrait on UTouch and "Default" on UTft (which means Landscape I think). The calibration returns the following values:

#define CAL_X 0x03A8C122UL
#define CAL_Y 0x03CB00D4UL
#define CAL_S 0x001DF31FUL

I am using the following sketch to test, it draws pixels where I touch (It is Portrait/Portrait as you can see):

#include <UTFT.h>
#include <UTouch.h>

UTFT    myGLCD(CTE70,25,26,27,28);
UTouch  myTouch(6,5,4,3,2);

void setup()
{
  myGLCD.InitLCD(PORTRAIT);
  myGLCD.clrScr();

  myTouch.InitTouch(PORTRAIT);
  myTouch.setPrecision(PREC_MEDIUM);
}

void loop()
{
    while (myTouch.dataAvailable() == true)
    {
      myTouch.read();
      myGLCD.drawPixel (myTouch.getX(), myTouch.getY());
    }
}

It is almost fine, except the Right Side of the Display doesn't work. I mean, when I touch the right edge of the display it doesn't draw anything... then I slowly move left until it starts to draw something. There is this "blank area" of 25mm/1".

Does anyone knows what is going on?

Thank you!
Raphael

Oh, and there is one more thing I need your help.

When I keep the Due with the 7" on USB for some time the screen fades out a little bit and then starts blinking, and the COM port disconnects (I can't see the Due connected on PC anymore). And if I keep it connected for a long time the uploaded program somehow corrupts, so the screen keeps all white.

Does anyone knows something about it?

Thanks!

Raphael

Sorry for the UP guys, but not even a clue? :roll_eyes:

The only comment I would make, those 7" displays use some serious juice, so you will NEED a separate plug in power supply!

USB is not enough, I have the 5" and nobody ever said the 5" requires extra power, but the screen is brighter and less 'ghosted' when using one, it is well known the 7" will not function without extra power.

Hope this helps.

Regards,

Graham

It is enough to plug a DC Power to Arduino Board while it's on USB?

The power will go trough the Arduino board as well, is it a problem?

Yes, connect the DC power and USB at the same time, there will not be any damage.

Regards,

Graham

Edit: I use a 9V 300mA supply in addition to USB , but do NOT exceed 12v, you will generate quite a bit of unwanted heat in the voltage regulator.

I'd be will to bet there is a better than 50-50 chance that your touchscreen issues will disappear when you provide additional power. With the supply voltage sagging below normal levels, an analog resistive touchscreen is not a stable device!

Thanks for the replies!

I've provided a decent power source for the Arduino and it doesn't crashes and corrupts the program anymore. Stays smooth, rolling my program as plugged to USB and Power Source at the same time.

But the main problem persists, I still can't manage to draw pixels with that sketch on the right side of the Display.

I've tried to change the CAL_X, CAL_Y and CAL_S and see what happens. It just gets crazy as it doesn't draw a pixel where I touch, but it managed to draw something on the display when I touch the right corner, but it draws on a different place of course. I made a sketch that blinks a round rectangle whenever I touch anywhere on the screen and it blinks when I touch the right side, so it's still working.

I've made a sketch that prints the coordinates of where I touch. The right side of the display prints "X: -1 / Y: -1".

Maybe there is an "offset" on the X axis pulling the "touchable area" to the left... or something.

Any thoughts on this please?

Thank! :slight_smile:

Hi Raphael,

I am having a similar problem to you........ I have a 20 pixel border down the left edge that just doesn't register touch at all, and about 15 pixels on the bottom edge when looking at the display in landscape orientation. It is a little disappointing when my old 3.2" unit was very good with touch accuracy over the full display area!

I guess we have Apple and Samsung's rejects!! =(

Regards,

Graham

Edit, just a thought, have you done the touch calibration again since applying additional power? Also have you edited your Cal values in UTouchCD.h ? I am trying to get to the bottom of this problem myself, and I just noticed in the UTouch_Supported_display_modules.pdf the 'correct' TOUCH_ORIENTATION mode for your CTE 7" display is LANDSCAPE worth a try changing it maybe?

This will be my last comment on this problem, I am annoyed now!

So I used a cocktail stick with a decent thin point to perform the calibration. Entered my new figures, ran the draw sketch, used a ruler to draw straight lines across both diagonals then vertical and horizontal lines.......... still a border all around the display that is not capable of detecting touch.

I have not measured actual pixels but just to show how much I am talking about, to the left of the ruler is not detectable, the image is drawn top left corner origin (0,0). The ruler is not straight because in the bottom left corner, the non detectable margin is wider!!

I think if you are still having issues of the order of 25mm, you should return your display as faulty, that is not acceptable really, but I think for my display I just need to grin and bear it.

Good luck,

Graham

Thanks for the reply!

I've done the touch calibration after the power source and got almost the same result, and I've modified the UtouchCD.h as well.

After you told me to, I've done the calibration with TOUCH_ORIENTATION = LANDSCAPE. Returned this:
CAL_X 0x01F3C7A8UL
CAL_Y 0x01FB880AUL
CAL_S 0x8031F1DFUL

And the result is crazyness. It appears to return a few of coordinates, considering all the touch area. They are 0/0, 799/0, 0/479, -1/-19, -1/-1, 799/479, 799/088... I think it's very worng. =P

The better calibration for my display is with LCD default (myGLCD.InitLCD();) and Touch Portrait, (myTouch.InitTouch(LANDSCAPE);).

I hope you get your problem solved. And mine too. :stuck_out_tongue:

RaphaelAmin:
CAL_X 0x01F3C7A8UL
CAL_Y 0x01FB880AUL
CAL_S 0x8031F1DFUL

I hope you get your problem solved. And mine too. :stuck_out_tongue:

I appreciate you have a 7" panel, whereas mine is only a 5", however, I am quite certain the PORTRAIT setting is wrong!! Check for yourself, the PDF in the UTOUCH folder......UTouch_Supported_display_modules.pdf !!

But for reference my figures are :-

#define CAL_X 0x000BCFC7UL
#define CAL_Y 0x03B700B9UL
#define CAL_S 0x8031F1DFUL

Worth a shot? But those figures are calculated in landscape mode which my display DEFINITELY is!!

Just out of curiosity? When you look at your display in Landscape orientation............. Where are your touch screen wires? (The 4 way ribbon!) Top or bottom? If so............. DEFINITELY landscape for yours too!! If they are left or right..............then yes you would be correct in your PORTRAIT assertion....

My problem is now sorted thank you, however the fact remains there is a useless border of about 20 pixels all the way round that will not detect touch =(. Good luck with yours!

Regards,

Graham

I've read that document and tried all the combinations. The best one is LCD Default and Touch Portrait. With the returned values of the calibration using that configuration (Default/Portrait) I have only that issue.

On Landscape the flat cable coming out of the LCD Display is at bottom side, but the connecor of the LCD Board is on the right side.

The 20 pixels area is a "non detecting area" or it is detecting something but returning wrong values? (like mine: -1/-1)

RaphaelAmin:
On Landscape the flat cable coming out of the LCD Display is at bottom side, but the connecor of the LCD Board is on the right side.

That should mean then that your touch is LANDSCAPE, same as mine!

RaphaelAmin:
The 20 pixels area is a "non detecting area" or it is detecting something but returning wrong values? (like mine: -1/-1)

It literally does nothing....

I am only so niggled by all of this because of an already existing sketch, written for a smaller display that I wished to 'transplant' with minimal effort, but also maintain interoperability.... Now I am aware of the dead zone, my sketch can be written to take it into account, but I still feel it is not unreasonable to expect the touch screen to operate over the whole display!!

Regards,

Graham

Yes, I think it's Landscape indeed.

If it does nothing, I think you have a broken display. Don't you think? I think you should replace it.

I've sent the problem to SainSmart. That 140 pixel that returns -1/-1 coordinates will be filled with graphics with no buttons, unfortunately.

Thanks!

Hello again,

There is another issue: When I apply little pressure on the Touch it doesn't detect right the coordinates and it gets more precise as I apply more and more pressure. Maybe it sounds just logical, but the thing is... the "unprecision" goes to the center of the display.

I mean: When I slowly press the finger on the screen it starts to draw pixels from the center of the display towards the place where I am pressing.

This is so true that if I start the touch with my finger nail it is very precise and this issue almost don't happen.

This is bad because when I intend to press with my finger a buttom that is on the right border, it press a buttom more on the inside... Is there a parameter to solve this?

Hi Raphael,

MMMMMM When you say

apply more and more pressure

that worries me a little...... We are doing well that the touch sensitive display works.......... I didn't realise we had to worry about pressure sensitive touch!! :astonished: :open_mouth:

I cannot say I have noticed the symptoms you describe in any repeatable sort of way, but ..... when i was trying to diagnose my display and I had the ruler on there drawing straight lines.............. I was getting what I would describe as 'splatter' in some areas...... what I mean........ generally neat well defined lines but then some dots randomly not on the lines...... I was using a wooden home made stylus with maybe 2mm wide point........ pressure even but not hard.............. if I lifted pressure at all, there was just a blank section on my line.........but not what you describe......

I adjusted mytouch.setPrecision() to PREC_HI, maybe you could try that? You should be aware however, the higher you set the precision, the SLOWER the response you will get from touch................as I am guessing it does several iterations of averaging.....

Regards,

Graham

Hi, Graham.

Yeah, my Nexus 4 works well with little/almost none pressure. I think sometimes it predicts with the camera where I intend to touch before I touch it. :roll_eyes:

I think I know what you mean by splatter. I think it's pretty predictable tough. It happens with mine too. I will post a picture of the issue later.

Thanks one more time!

Raphael

Hi RaphaelAmin,

I'm having the exact same problems you have with calibration

RaphaelAmin:
I've done the touch calibration after the power source and got almost the same result, and I've modified the UtouchCD.h as well.

After you told me to, I've done the calibration with TOUCH_ORIENTATION = LANDSCAPE. Returned this:
CAL_X 0x01F3C7A8UL
CAL_Y 0x01FB880AUL
CAL_S 0x8031F1DFUL

And the result is crazyness. It appears to return a few of coordinates, considering all the touch area. They are 0/0, 799/0, 0/479, -1/-19, -1/-1, 799/479, 799/088... I think it's very worng. =P

I've try to contact Sainsmart, but they are unresponsive and when thy do they don't understand what I'm talking about (BAD SERVICE)

Did you find any solution to the problem?

Thanks

Out of curiosity, are you using the Sainsmart 'special' drivers? UTFT_7 ?

Regards,

Graham