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.

AM335x LCD touch offset issue

Hi There,

We have a custom board using AM335x Processor with a resistive touch 7'' LCD running in kernel 3.2.

The 7'' lcd touch is working smoothly after the calibration, but after a reset, or power off there is a remarkable offset in touch sense like 5 or 6 mm and it is varying after rebooting. Literally, it is not sensing the point where we touch.

Kindly suggest a proper solution for this.

Thanks

Vishnu

  • Hi Vishnu,

    Please make sure that the "pointercal" file is missing from both of the following locations on your SD card:

    <root_partition>/etc/pointercal
    <boot_partition>/pointercal

    Best verify this on your host PC and use the "sync" command to write the changes you have made. Then boot your board again and see what happens.

    Best regards,
    Miroslav

  • Dear Miroslav,

      

                   Still we are facing offset after the reboot, as per your suggestion we deleted pointercal from root and boot partition. then recalibrated and touch is working perfectly, after power recycled the board, touch screen got offset.
     what is reason for this issues?


    Regards                                                                                                                                                                                                  Jithin

          

  • Dear Miroslav,


          One more information that there is no issue with 4.3Inch LCD Display.

    This will work after reboot or power recycle.

    My LCD info for 4.3

     [2] = {
                    .name = "LCD4.3",
                    .width = 480,
                    .height = 272,
                    .hfp = 2,
                    .hbp = 2,
                    .hsw = 41,
                    .vfp = 12,
                    .vbp = 2,
                    .vsw = 10,
                    .pxl_clk = 9000000,
                    .invert_pxl_clk = 0,
            },

    My LCD info for 7Inch

    [7] = {
                    .name = "LCD7",
                    .width = 800,
                    .height = 480,
                    .hfp = 39,
                    .hbp = 39,
                    .hsw = 47,
                    .vfp = 13,
                    .vbp = 29,
                    .vsw = 2,
                    .pxl_clk = 30000000,
                    .invert_pxl_clk = 0,
            },

    Regards

    Jithin.

  • Hi Jithin,

    Can you verify that the "fbset" command reports the same values before and after system reset.

    Best regards,
    Miroslav

  • Dear Miroslav,

    Calibrated data at fist time

    Calibrating touchscreen (first time only)xres = 800, yres = 480
    Took 13 samples...
    Top left : X = 3414 Y = 3741
    Took 18 samples...
    Top right : X = 3434 Y =  354
    Took 18 samples...
    Bot right : X =  467 Y =  340
    Took 7 samples...
    Bot left : X =  504 Y = 3752
    Took 12 samples...
    Center : X = 1968 Y = 2046
    821.194214 0.000113 -0.205910
    492.429474 -0.129304 0.000327
    Calibration constants: 53817784 7 -13494 32271858 -8474 21 65536

    FBSET after the calibration

    mode "800x480-62"
        # D: 30.000 MHz, H: 32.433 kHz, V: 61.895 Hz
        geometry 800 480 800 1024 16
        timings 33333 39 39 29 13 47 2
        rgba 5/11,6/5,5/0,0/0
    endmode

    FBSET after Power Recycle

    mode "800x480-62"
        # D: 30.000 MHz, H: 32.433 kHz, V: 61.895 Hz
        geometry 800 480 800 1024 16
        timings 33333 39 39 29 13 47 2
        rgba 5/11,6/5,5/0,0/0
    endmode

    I think there is no change.

     

    Regards

    Jithin

  • Have you tried the ts_print user-space tool? Is the offset reported by the application? Is it constant?

    Best regards,
    Miroslav

  • Dear Miroslav,

      I am using TI Filesystem from SDK which have MatrixGUI Desktop.

    As per your comment i try to recalibrate and the below follows the output, removed pointercal from boot and root partition

    Calibrating touchscreen (first time only)xres = 800, yres = 480
    Took 34 samples...
    Top left : X = 3546 Y = 3804
    Took 15 samples...
    Top right : X = 3578 Y =  407
    Took 11 samples...
    Bot right : X =  661 Y =  397
    Took 9 samples...
    Bot left : X =  644 Y = 3809
    Took 4 samples...
    Center : X = 2089 Y = 2083
    831.372742 0.000186 -0.205602
    516.696960 -0.130601 -0.000936
    Calibration constants: 54484844 12 -13474 33862252 -8559 -61 65536


    ts_print output after 2, 3 times

    root@am335x-evm:~# ts_print
    1324025672.084559:    600    151    176
    1324025672.088374:    599    151    162
    1324025672.090632:    598    151      0
    1324025675.624659:    605    266    229
    1324025675.626582:    605    266    229
    1324025675.628504:    605    266    228
    1324025675.630427:    605    266    228
    1324025675.645625:    605    267    228
    1324025675.653529:    605    267      0
    1324025679.125147:    593    139    208
    1324025679.127070:    592    139    208
    1324025679.128992:    592    140    209
    1324025679.140437:    593    140    210
    1324025679.142329:    593    140    211
    1324025679.149928:    595    140    212
    1324025679.153742:    594    141    213
    1324025679.168909:    594    141    212
    1324025679.174616:    594    141    211
    1324025679.182185:    594    141    204
    1324025679.186304:    596    141      0

    Reboot or power recycling the board.

    ts_print after reboot with offset.

    1324025780.782862:    654    267    219
    1324025780.792353:    655    268    233
    1324025780.796198:    657    268    237
    1324025780.804133:    660    268      0
    1324025783.824946:    654    266    215
    1324025783.826868:    656    267    218
    1324025783.828791:    655    267    223
    1324025783.830744:    656    267    225
    1324025783.832667:    657    267    230
    1324025783.844050:    656    267    238
    1324025783.845972:    657    267    242
    1324025783.849787:    657    267    246
    1324025783.857386:    657    267    249
    1324025783.859309:    657    267    249
    1324025783.863093:    657    267    249
    1324025783.866907:    657    267    249
    1324025783.880152:    657    267    250
    1324025783.883967:    656    267    250
    1324025783.885859:    656    267    250
    1324025783.889674:    656    267    250
    1324025783.891566:    655    266    250
    1324025783.893458:    655    266    250
    1324025783.895380:    656    267    249
    1324025783.897272:    656    267    249
    1324025783.899195:    657    267    248
    1324025783.901087:    657    267    246
    1324025783.904902:    658    267    233
    1324025783.905238:    660    266      0
    1324025784.921809:    647    252    245
    1324025784.925623:    645    252    248
    1324025784.933253:    645    252    247
    1324025784.935175:    645    252    246
    1324025784.937098:    645    252    247
    1324025784.939021:    644    252    247
    1324025784.940943:    644    252    246
    1324025784.952326:    645    252    247
    1324025784.954249:    646    253    249
    1324025784.959925:    647    253    249
    1324025784.961848:    646    253    250
    1324025784.963740:    646    253    249
    1324025784.965662:    645    253    248
    1324025784.967585:    645    252    248
    1324025784.980830:    644    253    248
    1324025784.982752:    643    252    248
    1324025784.994440:    641    251      0
    1324025785.758723:    767    334    255
    1324025785.760615:    768    334    255
    1324025785.764460:    768    334    255
    1324025785.773981:    768    334    255
    1324025785.781580:    767    335    256
    1324025785.791041:    767    334    256
    1324025785.792963:    768    334    256
    1324025785.796778:    767    334    256
    1324025785.804377:    768    334    257
    1324025785.806269:    769    334    257
    1324025785.813868:    768    335    257
    1324025785.815760:    768    334    254
    1324025785.819605:    767    334    255
    1324025785.823389:    767    334    255
    1324025785.827204:    766    334    256
    1324025785.829096:    767    334    257
    1324025785.832911:    767    334    256
    1324025785.846186:    768    334    256
    1324025785.855647:    768    335    255
    1324025785.857569:    768    335    254
    1324025785.861353:    768    335    251
    1324025785.867365:    767    334      0

    Regards

    Jithin

  • Dear Miroslav,

    Is there any solution for this?

    Thanks

    Vishnu

  • Try to disable this part of the /etc/init.d/matrix-gui-2.0 script, then remove the pointercal calibration files and reboot your system. Check how the touchscreen will behave and report back.


        # Do not try to calibrate the touchscreen if it doesn't exist.
        if [ -e /dev/input/touchscreen0 ]
        then
            export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0
            # Check if the SD card is mounted and the first partition is
            # vfat.  If so let's write the pointercal file there so that if
            # someone messes up calibration they can just delete the file from
            # any system and reboot the board.
            mount | grep /media/mmcblk0p1 | grep vfat > /dev/null 2>&1
            if [ "$?" = "0" ]
            then
                tsfile=/media/mmcblk0p1/pointercal
                export TSLIB_CALIBFILE=$tsfile
            fi

            if [ ! -f $tsfile ] ; then
                echo -n "Calibrating touchscreen (first time only)"
                ts_calibrate
                echo "."
                # If we create a pointercal file and it was not in /etc/pointercal
                # let's copy it there as well if it does not already exist.
                if [ ! -f /etc/pointercal -a -f $tsfile ]
                then
                    cp $tsfile /etc/pointercal
                fi
            fi
        fi

    Best regards,
    Miroslav