Announcement

Collapse
No announcement yet.

uLCD-43 calibration.

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

  • uLCD-43 calibration.

    So I read this post and one of my uLCD-43s is definitely off. This code

    HTML Code:
    #platform "uLCD-43PT_GFX2"
    
    func main()
    
    //Variables to hold the touch coordinates.
    var TouchX;
    var TouchY;
    
    gfx_ObjectColour(0xF800);
    
    //Enable touch function.
    touch_Set(0);
    
    repeat
    
    if(touch_Get(TOUCH_STATUS) == TOUCH_PRESSED)
    
    gfx_Cls();
    
    //Get the touch coordinates.
    TouchX := touch_Get(TOUCH_GETX);
    TouchY := touch_Get(TOUCH_GETY);
    
    gfx_Origin(TouchX, TouchY);
    gfx_Bullet(5);
    
    endif
    
    forever
    
    endfunc
    shows bullets that are above and to the right of the touched point by about 1/4 inch. I've read the calibration procedure in the AR1020 datasheet but I'm not sure if the picasso would interfere with my trying to calibrate it using I2C commands in a 4dgl program. Also I know 4d had to add an extra 0x00 I2C frame to one of the commands. I wonder if that is necessary for all commands.

  • #2


    It's sad that the touch needs calibrating.



    Picaso should not interfere with your trying to calibrate it in 4DGL (Just make sure touch is disabled first).



    Let us know how you get on and share your results so others can use it.
    Mark

    Comment


    • #3


      Ok, I've got a calibration routine working. It's set to use a 12.5% inset as per the example in the microchip datasheet. I'm assuming you guys use the same values for your factory calibration. If I touch the four points dead center with a blunt pencil, I still get the same ~1/4" offset with the test routine. If I touch the points just outside, toward the edge, I can get better tracking however. The program I'm developing has a keypad with small buttons so the closer the better. Hope others can play around with these routines and gain some more info about this microchip product. Forgetting to mention the extra 0x00 frame needed after a 0x9A frame in the datasheet was a pretty big oversight on their part.
      Attached files 43TouchCal.4dg (7.3 KB) 43TouchTest.4dg (525 B)

      Comment


      • #4
        You will find that you are having a bit of a fight with the internal scaling and calibration values.

        If you run this bit of code, you will see these internal values

        print("\nTOUCH_XMINCAL=", peekW(TOUCH_XMINCAL));
        print("\nTOUCH_YMINCAL=", peekW(TOUCH_YMINCAL));
        print("\nTOUCH_XMAXCAL=", peekW(TOUCH_XMAXCAL));
        print("\nTOUCH_YMAXCAL=", peekW(TOUCH_YMAXCAL));

        In order to 'overide' these values so you can calibrate directly using the AR1020 you need to kill the internal settings

        pokeW(TOUCH_XMINCAL, 0);
        pokeW(TOUCH_YMINCAL, 0);
        pokeW(TOUCH_XMAXCAL, 1024);
        pokeW(TOUCH_YMAXCAL, 1024);

        Unfortunately, these values will not stick so you will need to set them at the start of your first program.

        In future PmmC release, these values will be removed so the AR1020 calibration will work correctly.



        Regards,
        Dave

        Comment


        • #5


          Here's my latest version of the calibration routine. I added I2C_Idle() calls and a delay to allow the calibration values time to be written to the EEPROM. Also, I'm using the maximum inset value but displaying the target points at 12.5% This seems to overcome the calibration values in the Picasso and results in a fairly accurate calibration.

          EDIT: Also, to eliminate the picasso calibration the MAXCAL values should be 4096 instead of 1024.
          Attached files 43TouchCal.4dg (7.9 KB)

          Comment


          • #6


            glad you found a solution,

            The calibration methods for the 4.3" screens is under review for next PmmC release.
            In future PmmC's a better calibration method will be provided.
            Thanks for your valid input.
            Regards,
            Dave

            Comment


            • #7


              Hello,

              I find I need to calibrate my 4.3" screen as well. Not sure what the PMMC version was when this thread was started.....

              Does the R30 PMMC take care of overwriting the values?
              _______________
              Best Regards,
              Howard

              Comment


              • #8


                Nevermind, found the updated calibration program, worked great....

                http://4d.websitetoolbox.com/post/PICASOGFX2-Related-Display-modules-and-Softwares-5149859?highlight=ar1020&trail=50

                _______________
                Best Regards,
                Howard

                Comment

                Working...
                X