Go Down

Topic: LCD Touch Display calibration problem (Read 3 times) previous topic - next topic

cowasaki

I'm having the same problem as this but I outputted the x y coordinates via serial.  It appears that every screen touch is recognised but the device thinks that it is always at the same point...

Were the first two calibration strings the same?

I am looking at the possibility that the connections are wrong on the CTE shield in relation to my 32 pin TFT.

leoguti

Hi all,

I had the same calibration problem but after a few tries I could solve it.

But I have another problem, just upload the program to the arduino this works perfectly, but when I restart arduino stops working screen, and behaves as before calibration.

I used the same code that is above.

Thanks in advance.

eclipsegst

Hello,

I got the same problem and I think it's related to too fast spi line settings, anyhow when I added 2us delay after setting lines - it seems to work OK... hopefully helps in your case too.

***** HW_AVR.inc *******
void UTouch::touch_WriteData(byte data)
{
   byte temp;

   temp=data;
   cbi(P_CLK, B_CLK);

   for(byte count=0; count<8; count++)
   {
      if(temp & 0x80)
         sbi(P_DIN, B_DIN);
      else
         cbi(P_DIN, B_DIN);
      temp = temp << 1;
      cbi(P_CLK, B_CLK);               
      sbi(P_CLK, B_CLK);
   }
}

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(2); //// added to get more stable readings???                 
      if (rbi(P_DOUT, B_DOUT))
         data++;
   }
   return(data);
}

elac

WOW!! This must be the "nobody learned how to post code properly" thread.  :smiley-eek:
It's all about the skills

eclipsegst

Sorry about that,
but the fix for touch screen calibration (reading) is working properly.
Next time also the code is sent proper way;)

Go Up