Go Down

Topic: [FIXED] 3.2" touchscreen strange behaviour, sometimes works, sometimes doesn't (Read 1 time) previous topic - next topic


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,




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))


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,


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



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!


Go Up