Announcement

Collapse
No announcement yet.

Touch Enable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Touch Enable

    Hi,

    I think i need a little clarification about touch function of u32LCD touch screen feature.

    Firstly, to enable touch screen i m sending display control with mode 0x05 and value 0x00. (0x59, 0x05, 0x00) this returns with ack 0x06.

    So display touch feature is being enabled.

    Second, i m issueing get touch coordinate firstly with mode 0x04 (0x6F, 0x04) to catch touch and waitng one byte response 0x01. A clarification is needed here. When i call get touch coordinate with mode 0x04 does it responds 1 byte, 2 bytes or 4 bytes? application stops here and i should not need to wait answer when i call this function, instead i think i continously call this function until a touch is catched, rigth?

    Third, for other modes (0x00, 0x01, 0x02,0x03 and 0x05) it returns 4 bytes which includes final touch coordinates, rigth?

    Could you please explain usage of this command more in detail?
    Serkan

  • #2


    All touch commands return 4 bytes.

    The modes 0, 1, 2 and 3 are very rudimentary and are not intended to be used for 'real' applications, that doesn't mean they don't sometimes com in handy.

    A 'real' application would normally use mode 4 until such time as it needs to know the coordinates and then call mode 5 to get them
    Mark

    Comment


    • #3


      Ok Thanks,

      Regards,
      Serkan

      Comment


      • #4


        I m using mode 4 to be able to catch a touch. But it does not work as i expected.

        I m sending 0x6F, 0x04 and comparing returns val with 0x01 (touch press) to enter a loop. it is not successed yet. Just a few times catched but when i checked the value i saw 0x45 as returned value.

        Could you please give me an example of touch usage of picasso sgc? i cant see any problem.

        By the way, for mode 0x04 which bytes of 4 bytes response involves touch status?

        Regards,
        Serkan

        Comment


        • #5


          The full return for a touch press will be

          0x00 0x01 0x00 0x00

          Are you, perhaps, looking at the first byte for the touch status?
          Mark

          Comment


          • #6


            I diffenetly check the correct point. i changed the code and set breakpoint when return value is not equal to 0x0000. I m touching the screen a few times and and one of them hits the break point. when i run code again again it hits the breakpoint again asif LCD module collected to the my touch count. I really dont understand why this status is used. it should be better only sending the touch area back. user can not touch 0,0 point and this should be used. if return value is not zero then touch detected. this status return confisues the usage.

            I think after touch detect with mode 0x04 immediatly get touch shoud be called with 0x05 to read x and y val.

            I just wonder what happens if i call get touch with 0x05 directly without mode 0x04. does it return with touch area?

            Regards,
            Serkan

            Comment


            • #7


              The status says a lot more than just touched and not touched, if you are polling the status regularly you will also see quite a few 'moving' statuses, as it is almost impossible to touch exaclty one spot and release it.

              Also, you can touch point 0,0.

              As per the manual the value returned with 0x05 is the x and y values current at the last status command. If you just call 0x05 its returned values will never change.
              Mark

              Comment


              • #8


                Please say me how to use youch feature then. Give me a sequence of example. As far as i understand from manual and explanation here,

                I firstly need to catch a touch (mode 0x04 with return of 0x00,0x01,0x00,0x00)
                Second i need to call get coordinates with mode 0x05 with return of x and y val.

                But i have already done this without success.

                By the way, wait until touch senses touch almost well as well as sleep untill touch.

                Regards,
                Serkan

                Comment


                • #9


                  It works that way just fine.

                  Use FATController to exercise it and see how it works with the test software
                  Mark

                  Comment


                  • #10


                    I m not able to use FAT controller due to lack of usb to serial interface. We already offered it but hasnt came yet.

                    One more question; Get Touch Coordinates allways answers with 4 bytes rigth when it is called whether it s touched or not is not important.

                    By the way do i need to enable anything else? i enabled it by display control function and i m using screen as landspace plus i used Detect Region 0,0,320,240

                    Regards,
                    Serkan

                    Comment


                    • #11


                      One more thing;

                      one touch will be read only once with touch status command rigth? For example;

                      Screen saver works
                      a touch status detected with touch pressed (without reading x and y with mode 0x05)
                      i entered main menà and will check a touch status again. This shouldnt be the first one!

                      When touch status cleared by picasso? is it the time it is read ?

                      regards,
                      Serkan

                      Comment


                      • #12


                        It all revolves around the status of touch at the time you do the status call.

                        If touch was previously not touched and is now touched you will get a touch Press.

                        If touch was previously touched and is now touched you will get a touch moving.

                        If touch was previously touched and is now not touched you will get a touch release.
                        Mark

                        Comment


                        • #13


                          I think i clarified the issue. I was running a screen saver which was replacing background colour per second and on of the point across the code was calling get touch status. I think, during this heavy lcd driving time picosso can not catch every touch. That is why i could not catch every touch. I just use while loop and called get touch status frequently with keeping the screen as it is untill a touch is detected and it worked.

                          By the way; i put 100 ms delay between every picosso serial command. Module works more stable now.

                          Regards,
                          Serkan

                          Comment


                          • #14


                            I forgot to say that i called the get touch coordinates when any touch detected. This clears the touch flag of picosso i think. Otherwise; it does not work as expected.

                            Regards,
                            Serkan

                            Comment

                            Working...
                            X