Pages: [1]   Go Down
Author Topic: [FIXED] 3.2" touchscreen strange behaviour, sometimes works, sometimes doesn't  (Read 985 times)
0 Members and 1 Guest are viewing this topic.
Hungary
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear Builders,

Recently I've got my SainSmart 2560 Rev 3 board + LCD shield + 3.2" LCD Touch panel from SainSmart. It was a hard work to get it into work properly, and I've reached a good milestone. At this point, I'm a bit frustrated. In short:
-- pinout is good,
-- LCD works good with other (not touch) examples,
-- all libraries are up to date and included (UTFT, UTouch, as well as calibration).

As soon as I plug in the USB cable, and upload a sketch (for example, QuickDraw, as seen on the YouTube vid below), everything is working fine. After I unplug the cable and start use the board with externap power source (or by the same USB cable as I've used to upload the sketch), touch starts to work improperly (see video). 8 out of 10 attempts are bringing into this situation. I found out, that resetting the board may help this (7 out of 10 attempts are going to bring good results). If I upload the sketch again, it's always working fine (10 out of 10 attempts).

Every sketchs are exactly the same as provided in UTouch.rar from http://www.henningkarlsen.com/electronics/ .

See YouTube video:
.

How can I fix this problem?

Thanks for all the replies.

Best wishes,

Tamas
« Last Edit: November 06, 2013, 02:05:48 pm by Timtomm » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

maybe you can solve this with adding some delay to HW_AVR.inc
=====================================================================================
word UTouch::touch_ReadData()
{
   word data = 0;

   for(byte count=0; count<12; count++)
   {
      data <<= 1;
      sbi(P_CLK, B_CLK);
      cbi(P_CLK, B_CLK);
               delayMicroseconds(1); //// added to get more stable readings?   
      if (rbi(P_DOUT, B_DOUT))
         data++;
   }
   return(data);
}
=======================================================================================
Logged

Hungary
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Thank you very much for the fast help. I was a chellenging task to find the right file and the right place, but it fixed the issue.
Have a nice day,
Tom
Logged

Bavaria
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you very much. I had the same problem, and this fixed my problems.

antonius
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you!!

I have used the last 3 days trying to solve this problem, but this solution seems solid!

We need to spread this to the forums, we are not the only one who have this issue, and it seems like the support at Sainsmart.com are completely mute on this.

Again, thank you!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks.  I had the same problem, and this fixed it.
Logged

Pages: [1]   Go Up
Jump to: