Strange Touch Screen Issue with SainSmart 3.2 TFT Touch + UTFT_Touch

I'm having some strange issues with the SainSmart Mega 2560 R3 + Adapter Shield +3.2 TFT Touch that I bought from SainSmart, and wanted to see if anyone else has experienced the same thing:

http://www.sainsmart.com/sainsmart-mega2560-r3-adaptor-shield-3-2-tft-lcd-touch-panel-for-arduino-atmel-atmega-avr-16au-atmega8u2.html

I am using the latest versions of UTFT, UTFT_Touch, UTFT_Buttons, etc.

I can successfully compile and load any of the example files that come with those libraries and they seem to work OK...until I unplug and restart. When I plug back into the USB cable or to a 12V wall wart, the program runs, and the uC and LCD work OK, but the touch screen is all messed up. I have to recompile and program the board again to get it to work correctly. I've tried all of the UTFT examples that use the touch screen and they all do the same thing.

For example, if I compile and load the UTouch_QuickDraw example code, it works OK; I can touch any part of the screen and it draws pixels in the corresponding LCD location. But, if I unplug and restart the uC board the touch screen then only responds to touches to the bottom-right quadrant. And, the data is not correct. As I touch in the bottom-right quadrant, the LCD draws in the top-left quadrant. I did a quick mod to the code to spit out the X/Y values that were being read and, sure enough, in the bottom-right quadrant it would read x = 0 to ~150 and Y = 0 to ~125. Pressing in any other quadrant gave x and y values of -1. If I then recompiled and programmed the board again the everything would work OK; I would get x = 0 to 320 and y = 0 to 240.

Has anybody experienced anything like this? I've spent many frustrating hours looking for clues, but have found none.

Thanks for your help,
Mark

I have had similar issues. It is caused by a boot loader problem in the arduino. Try to refresh and update the arduino's boot loader and it should work fine. This is a great resource on boot loaders.
Here is a tutorial on burning the latest boot loader.

2007jingz, thank you for the reply and for your suggestions. I will try burning the boot loader tonight and see if that helps.

NO!!! Take no notice of jingz suggestion!!!

This is a long standing problem.......

Using IDE v 1.0.6 used to fix it............ but that is now a poor fix, IDE 1.5.x+ is MUCH better than IDE 1.0.6.....

Henning Karlsen....... the UTFT author is not prepared to help with Sainsmart related problems for obvious reasons...

However.............. I now have a friend with a GENUINE Coldtears display AND shield, and still experiencing the same problems.

Queer thing is this....... I have a shitty Sainsmart Mega shield..............which doesn't have any problems....

So I am on the case of trying to resolve this............ But, do not start altering bootloaders and shit or listen to newbies that have no idea what they are talking about!!!!

Once I have resolved this issue, I will post the solution.

Regards,

Graham

I have some new data regarding this issue:

The SainSmart website lists the input voltage as

Input Voltage (recommended): 7-12V
Input Voltage (limits): 6-20V

I was using a 12V wall wart to power the unit when not connected to the USB cable. I found that the voltage regulator next to the power entry connector was getting quite hot. I tried powering it up with a 5V wall wart and presto, it worked OK...until I tried reconnecting the USB cable, and I had the same probs. Unplug USB and it worked.

I'll need to hook up a scope and look at the voltages on the board to see what's going on at various input voltage levels.

Any news ln this issue?
I experience the same with recently bought 2560+3,2"

If you are using a 3.2" TFT as is stated in the Topic Title, you do NOT need any additional power supply.

If you wish to enlighten us to the EXACT hardware and software permutations you are using, I may be in a better position to help you.

Regards,

Graham

Thanks for quick reply.
HW is exactly as stated in the first post.
In the mean time I found another thread addressing this issue, root cause seem to be the Libraries; I will check and report. 8)

Edit: yes it is the lib (sorry German)

If you are the owner of that 'single package' I would have expected you to ask me if you could include MY UTFT_SdRaw library and image files!!!! Kindly remove them and link to the correct location!!

!Important. Transferred to Github. GitHub - ghlawrence2000/UTFT_SdRaw: Hi speed image loading from SD/Serial for UTFT. UTFT_tinyFAT replacement.

Thanks for downloading my UTFT_SdRaw library, please give me some 'Karma' on the forum if you appreciate my efforts.

Graham

I suspect Henning would say the same thing about HIS UTFT library!! And the CORRECT download link for the UTFT libraries is Rinky-Dink Electronics

Henning no longer offers ANY form of support for Saincrap products as they ignore him and believe it is acceptable to use his libraries commercially for free and refuse to get licensed! So if you insist on continuing to support these thieving pieces of sh*t then don't be surprised if stuff don't work properly and you don't get the help you need from the people that can!!!!

You might buy Sainshit hardware but it is not recommended you go down the path of supplying other peoples libraries WITHOUT permission!!!! If I could give you NEGATIVE karma I would have done!!!

Graham!

Your problem is the orientation of the display :

For the calibration you must have :

UTFT myGLCD(ITDB32S,38,39,40,41);

UTouch myTouch( 6, 5, 4, 3, 2);

#define TOUCH_ORIENTATION PORTRAIT

myTouch.InitTouch(TOUCH_ORIENTATION);

myGLCD.InitLCD(TOUCH_ORIENTATION);

after to use you can be in LANDSCAPE

I have smartmain also

Spoken like a true newbie.....

It has nothing to do with orientation. That is correctly taken care of by the libraries ( if you are using the genuine versions of Henning's libraries! ) .

Regards,

Graham

Perhaps he was stating that both the display orientation and the touch orientation, must be the same.

If not then yes, he would be a newb or have a fake version of the UTFT library.

HazardsMind:
Perhaps he was stating that both the display orientation and the touch orientation, must be the same.

That is not even true, for SOME models of display it happens to be the case, but it is incorrect to assume so. Specifically, since we are SUPPOSED to be talking about the SSD1289 display, calibration is performed in LCD orientation LANDSCAPE while touch orientation is PORTRAIT as defined by the orientation of the touchscreen, this stuff is not plucked out the air at random!! I would have expected you to know that HazardsMind.

Unlisted display modules:
If your display module isn't listed here it might still work fine. To find the
TOUCH_ORIENTATION for your module you must look for the Flat Flex Cable (FFC) from the
touch screen. It is usually a 4 wire FFC. If the FFC is on one of the short sides it
is highly likely that the TOUCH_ORIENTATION should be PORTRAIT. If it is on one of the
long sides you should probably use LANDSCAPE as TOUCH_ORIENTATION.

Taken directly from the UTOUCH manual, in that same manual it is clearly stated the TOUCH_ORIENTATION for the SSD1289 module is PORTRAIT!!

Regards,

Graham

To be honest, I've never given any thought about the location of the flex cable and its influence to whether the touch orientation should be Portrait or Landscape. I just always made them both the same, because it just makes sense that way. Why see the screen in one orientation but touch it in another?

Come to think of (even though its been about 4 years now) I think when I first got my display, I had issues with the touchscreen until I made them both the same orientation when calibrating it. Since then i've been using the same sketch and the only thing I change is the model number and maybe the pin numbers, depending on which display I use, but that's about it, everything else stays the same.

That just from my experience from over the years.

And no, I never once read any of the manuals, I learn what I need from the library files themselves.

The reason being you have not had any problems, maybe that UtouchCD.h has the touch orientation built into the cal_s figure, perhaps lucky for you Henning is top of his game!! :wink:

Still, it is not you I have the grievance with, it is Saincrap and newbies that buy Saincrap....

Regards,

Graham

PS. Done properly and calibrated correctly, you can just init your touch instance without even specifying orientation for reasons previously stated, and yet touch works properly whichever orientation you may choose for your LCD, I currently have in my possession 3 different displays and I only need to stipulate the LCD orientation I require, touch is handled magnificently by Henning!! 8) :smiley: :wink:

I'm having the same problem as stated by jebebara on - on both of the units I received from SainSmart through Amazon (listed below):

  1. "SainSmart 3.2" TFT LCD Display+Touch Panel+PCB adapter SD Slot for Arduino 2560"
  2. "SainSmart TFT LCD Adjustable Shield for Arduino Mega 2560 R3 1280 A082 Plug"
  3. "SainSmart MEGA 2560 R3 Board ATmega2560 ATMEGA16U2 + USB Cable Compatible With Arduino"

Did anyone find a solution to share?

Thanks in advance.

I found the solution: [FIXED] 3.2" touchscreen strange behaviour, sometimes works, sometimes doesn't - Displays - Arduino Forum

i find a solution. i change 3 X 10k resistor on D_BUSY, D_OUT and D_IRQ for 3 X 1k. the voltage is to low with 10k resistor. work great :slight_smile: