This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TSC2017 Touch screen invalid Data in Windows embedded compact 7

Other Parts Discussed in Thread: TSC2017

Hi,

We are using TSC2017 touch screen controller with IMX6 processor.

We are using windows embedded compact7 OS for development.

We are using following debug prints in tchstreampdd.cpp as shown in below sample code

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------PDDTouchIST--------------------------------------------------------------------------------

PDDTouchPanelGetPoint( &SampleFlags, &RawX, &RawY)  

//convert x-y coordination to one sample set before sending it to touch MDD.  

if(ConvertTouchPanelToTouchInput(SampleFlags, RawX, RawY, &input))

  {          

//send this 1 sample to mdd

            g_pfnMddReportSampleSet(g_mddContext, 1, &input);

RETAILMSG(1,(TEXT("Touch screen data   (%d, %d)\r\n" ), RawX, RawY ) );

 }

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

When we touch on the screen, got number of touch samples in the serial window.

For example when touch at the center of the screen(for a simple touch in center of screen) got value like this

Touchscreen data (150,150)

Touchscreen data (151,150)

Touchscreen data (151,150)

Touchscreen data (18,150) (Mismatch data)

In the above case,we got four samples for a simple touch. But there is error in the x coordinate of last sample which is highlighted in red colour.It is eighteen.

Similarly we got mismatch data at the end of every touch samples.

What is the reason behind this issue. Please reply

  • Hi Aju,

    I couldn't find any similar issue in my office with my TSC2017 bench platform.

    Could you show me the circuits around the TSC2017? Besides, it is better to show me more code from your windows driver, such as how you send commands to the TSC2017, read coordinates back from the TSC20017 and the interrupt handling routine.

    Andy

  • Hi Andy,

    Thanks for the reply.

    Please find the zip file which contain the touch circuits and wince touch driver code.1651.Code_Schematics.rar

    In driver code,bsptouch.c is the lower level driver which contain the i2c read from touch controller.

    tchstreampdd.cpp contain the PDDTouchIST which read the xy coordinates and convert the coordinates to samples and pass to mdd

    Please give the solution for the issue

  • Hi Aju,

    I just took a look at the schematic and I don't think I can find any issue. I will continue to review the driver code.

    Andy

  • Hi Aju,

    If you put your finger on the touch screen (for example, in the center of the touch screen) and hold steady, can you find this similar mismatch data very often? Does this mismatch data only happen on the last coordinates?

    Andy
  • Hi Andy,

    Thanks for your support.

    If put finger on the touch screen and hold steady,we cannot find a mismatch data.

    When release the finger,got mismatch data.

    This mismatch data only happen at last coordinates

    Please help to get  a solve issue

  • Hi Aju,

    I think this issue happens when the finger is almost off but your Windows driver is still trying to read coordinates from tsc2017.  

    How do you determine that the finger is still on or off in your driver? I didn't find any related code in the source files you sent to me.  

    Basically, two method are available in the Linux / Windows driver.  a) Pressure value;  b) /PENIRQ. When /PENIRQ becomes high from low, it means the finger is off. I recommend the second method, which is more reliable.    

    Andy

  • Hi Andy,

    Thanks for the quick response.

    From the TSC2017 datasheet, Our understanding that when finger is touched,PENIRQ goes HIGH to LOW.And PENIRQ is low state when finger is hold steady on the touch screen. When the finger is removed PENIRQ goes to LOW to HIGH

    But from  your point,PENIRQ becomes HIGH to LOW when finger is off.

    Can you please give a clarification on this point?

    One more point,Our touch screen are less sensitive especially at the corners of the screen.How we can improve the sensitivity

    Please reply

  • Hi Aju,

    I mentioned in my last post that "When /PENIRQ becomes high from low, it means the finger is off.". That is exactly the same as your understanding: When a finger is off, the /PENIRQ will change from low to high.

    As for your second question, it is a very common issue for a touch screen panel due to its mechanical design. The touch controller is not able to fix that. One solution is that you switch to a light touch screen, which requires less pressure both in the center area and the corners.

    Andy
  • Hi Andy,

    Thanks for the communication.

    As you say, data mismatch issue happen when the finger is almost off but your Windows driver is still trying to read coordinates from tsc2017.  

    Going through the windows driver driver code(already sent), the coordinates from touch controller are passed to MDD layer along with flag information.

    When finger is touched ,winCE touch driver update touchsamplevalidflag=1 and Touchsampledownflag =1(in bsptouch.c) and this info is passed to MDD along with coordinates.

    When finger is removed(in this case,got mismatch data coordinate from touch controller), winCE touch driver update touchsamplevalidflag=1 and Touchsampledownflag =0 and this info is passed to MDD along with coordinates.

    Our doubt is that is this flag information is enough for MDD layer to remove the mismatch coordinate data from touch controller(When the finger is off)

    Or we need to clear touchsamplevalidflag along with Touchsampledownflag.

    Please help to solve the issue

     

  • Hi Aju,

    I took a close look at the code you sent to me. I don't have right hardware to run this code, so I have to guess what might be the cause.

    Below is some code I found inside the function BSPTouchGetSample() in bsptouch.c.
    I think this code is used to determine whether the finger is still on or just off.
    DDKGpioReadDataPin(DDK_GPIO_PORT1, 0, &isTouchUp);
    if (isTouchUp)
    {
    StateFlags &= ~(TouchSampleDownFlag);
    }

    // Tell upper layers that this attempt was valid
    StateFlags |= TouchSampleValidFlag;

    Just before this code, both x&y coordinates are read from TSC2017 via i2c.

    I suggest you implement the code this way:
    a) Put the code above at the beginning of BSPTouchGetSample(). So, first you have to double check whether the finger is still on or not.
    b) If the finger is still on, then read x&y coordinates are read from TSC2017. If not, set the correct flags and tell the MDD to do the right thing.

    To further prove my idea, here is some code from the TSC2017 Linux driver. The code below first tries to determine whether the finger is off. If not, then now it is OK to read the coordinates.

    if (ts->get_pendown_state) {
    if (unlikely(!ts->get_pendown_state())) {
    tsc2017_send_up_event(ts);
    ts->pendown = false;
    goto out;
    }

    dev_dbg(&ts->client->dev, "pen is still down\n");
    }

    tsc2017_read_values(ts, &tc);



    Andy