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.

Touchscreen is too sensitive

I am using AM335x evm. I have a problem about the sensitivity of touchscreen - one press often generate 2 or more touch events. May I know if there is a way to overcome this problem?

  • Probably, it might be because of very few touch events generated. 

    Do you have an bitmap drawing application? You can try drawing an circle or a curve on your device and see whether its drawing proper circle or not. It might be too edgy, if the number of events are too less. The good number of touch events that should come is approximately 30 events/per sec.

  • Thank you for the reply.

    I think it generates too many events because I touch one time and it generates 2 touch events. Is there a way to adjust it? Can I edit /etc/ts.conf?

  • Lu,

    Generating 2 events is not too much. In fact its too less. As I suggested earlier could you please try to draw a curved image using any bitmap drawing application and send me the image? With that it will be very easy to understand the behavior.

  • Generating 2 events when pressing only once is not acceptable for any application. If you press "0" on the caculator, the caculator will show "00". It is not good.

    I run ts_test, it runs good, drawing perpect curve.

    Maybe I did not explain clearly the term "event". The event is the push button event, it is not the event the driver sends to the GUI middle layer.

  • Lu,

    I misunderstood the problem. If you press and hold the "0" it should send multiple events of hold. I your case the moment it gets an event "release" is detected and one or more event of "press" might be coming. That's why in your case its getting detected as '00'. So I guess, there might be a short timeout, because of which it has detected a release in between. 

    Which is the touch screen controller that is being used? Also which is the operating system that you are using? If you are using linux, you'll be able to see an input_report_event() function being called, could you please print the number of times the function is called per second? Also can you share the snapshot of the image that you could draw?

  • After reading your posts, I realized that linux kernel generates too many events -hundreds times per seconds (I use 'ts_test" to test). You said it should be 30 times per seconds. I found the driver source code - ti_tscadc.c, and made the following changes by adding 15 lines of udelay(1000). Re-compile the kernel and solved the problem. Thank you.

    -    udelay(315);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);
    +   udelay(1000);

        status = tscadc_readl(ts_dev, TSCADC_REG_RAWIRQSTATUS);
        if (status & TSCADC_IRQENB_PENUP) {
            /* Pen up event */
            fsm = tscadc_readl(ts_dev, TSCADC_REG_ADCFSM);
            if (fsm == 0x10) {
                pen = 1;
                bckup_x = 0;
                bckup_y = 0;
                input_report_key(input_dev, BTN_TOUCH, 0);
                input_report_abs(input_dev, ABS_PRESSURE, 0);
                input_sync(input_dev);
            } else {
                pen = 0;
            }
            irqclr |= TSCADC_IRQENB_PENUP;
        }
        irqclr |= TSCADC_IRQENB_HW_PEN;

        tscadc_writel(ts_dev, TSCADC_REG_IRQSTATUS, irqclr);

        /* check pending interrupts */
        tscadc_writel(ts_dev, TSCADC_REG_IRQEOI, 0x0);

        tscadc_writel(ts_dev, TSCADC_REG_SE, TSCADC_STPENB_STEPENB);
        return IRQ_HANDLED;

  • Lu,

    Using udelay() is not the right method to introduce delay or to do wait. ARM will be polling continuously, instead you have to use sleep or other wait functions, which will help you better.

    But I have a feeling that you are not clearing the interrupt inside the touchpanel controller properly. You shouldn't be getting so many interrupts if that's done properly. Can you mark this post as answered if you feel that the query is resolved.

  • FYI, I thought I'd toss in a note on this thread (2 years later!).  I posted some patches that apply to SDK 7.00 for updating the touchscreen driver here:

    http://e2e.ti.com/support/arm/sitara_arm/f/791/p/319613/1308705.aspx#1308705

    I was able to eliminate that udelay and give a hardware knob for adjusting that amount of time.  The touchscreen "sensitivity" (e.g. number of false pen-ups, etc.) is something that can vary substantially from one touchscreen to another.  With the original driver you needed to increase the udelay to "tune" the driver for a given board.  Now that same "tuning" is done in hardware through the TS_CHARGE_CONFIG register.  I hard coded the value to 0x400 in my patch which seemed to work well on the EVM.

    Another customer started out with the SDK 7.00 code (with the udelay) and made it large similar to this thread.  That did in fact reduce false pen-up events dramatically!  Though switching over to the new driver and increasing to a value of 0xB000 gave the same result without any udelay whatsoever in the driver.

    I'm clearly way too late for this thread, but thought I'd mention in case you're planning a software update for your product, or for other people that stumble across this thread...