ConnectEve (Ready for Xmega)Touch calibration constants

General discussion on Visual TFT Software.
Post Reply
Author
Message
twenty
Posts: 71
Joined: 20 Oct 2010 11:44

ConnectEve (Ready for Xmega)Touch calibration constants

#1 Post by twenty » 13 Jul 2013 13:23

I have the hardware pattern setting for the touch panel set to "Manual" and would like to set it to "Preset". This would save me manually calibrating the screen every time after flashing the micro. I find manually calibrating the same screen every time quite time consuming and unnecessary.

1. How is the preset values (A, B, C, D, E, and F) calculated?
2. How can the values A, B, C, D, E and F be read after the screen has been manually calibrated?
3. Would you be able to give me preset values that are working for my EveConnect? The values in the preset fields appear to have a touch mirror offset affect with the objects.

Thank you

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#2 Post by dejan.odabasic » 15 Jul 2013 15:11

Hello,

You can use FT800_TouchTransform_GetConfig function in order to obtain the A,B,C,D,E and F values.
You should repeat manual calibrate procedure few times and then use average values that you received.

Create project in VisualTFT(leave calibration active) with six label positioned on screen.
Add the following code to _main file:

Code: Select all

char txt_tmp[9];
TFT800TouchTransform CalibrateConstants;

void refresh_coordinates()
{
  FT800_TouchTransform_GetConfig(&CalibrateConstants);
  LongWordToHex(CalibrateConstants.TransformA, txt_tmp);
  strcpy(Label1.Caption, txt_tmp);
  LongWordToHex(CalibrateConstants.TransformB, txt_tmp);
  strcpy(Label2.Caption, txt_tmp);
  LongWordToHex(CalibrateConstants.TransformC, txt_tmp);
  strcpy(Label3.Caption, txt_tmp);
  LongWordToHex(CalibrateConstants.TransformD, txt_tmp);
  strcpy(Label4.Caption, txt_tmp);
  LongWordToHex(CalibrateConstants.TransformE, txt_tmp);
  strcpy(Label5.Caption, txt_tmp);
  LongWordToHex(CalibrateConstants.TransformF, txt_tmp);
  strcpy(Label6.Caption, txt_tmp);
  DrawScreen(&Screen1);
}
And call refresh_coordinates after InitVTFTStack function.

Best regards.

twenty
Posts: 71
Joined: 20 Oct 2010 11:44

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#3 Post by twenty » 17 Jul 2013 10:49

Thanks Dejan. I have converted your code to Mikrobasic and it is working fine

Regards,

J.Ollig
Posts: 28
Joined: 01 Apr 2010 11:10

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#4 Post by J.Ollig » 26 Jul 2013 17:04

Hello,

i don't know why, but I can't convert that issue to Mikropascal for ARM(Stellaris).
I always get fault messages.
Can someone please give me a hint how to change the above Example to Mikropascal for ARM.
I still have my problems understanding this pointer stuff to 100%.

many thanks

Jürgen

J.Ollig
Posts: 28
Joined: 01 Apr 2010 11:10

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#5 Post by J.Ollig » 28 Jul 2013 09:58

Code: Select all

procedure EveButton1OnClick();
var Txt : array[8] of char;
var pTTransformConfig: TFT800TouchTransform;

begin
   FT800_TouchTransform_GetConfig(@pTTransformConfig);
   LongWordToHex(pTTransformConfig.TransformA, txt);
   strcpy(LabelA.Caption, txt);
   LongWordToHex(pTTransformConfig.TransformB, txt);
   strcpy(LabelB.Caption, txt);
   LongWordToHex(pTTransformConfig.TransformC, txt);
   strcpy(LabelC.Caption, txt);
   LongWordToHex(pTTransformConfig.TransformD, txt);
   strcpy(LabelD.Caption, txt);
   LongWordToHex(pTTransformConfig.TransformE, txt);
   strcpy(LabelE.Caption, txt);
   LongWordToHex(pTTransformConfig.TransformF, txt);
   strcpy(LabelF.Caption, txt);
   DrawScreen(@Screen1);
end;
I got it working.
Must have been the heat. :oops:

Jürgen

Dimmer
Posts: 4
Joined: 11 Jun 2014 22:00
Location: Holland

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#6 Post by Dimmer » 11 Jun 2014 22:07

twenty wrote:Thanks Dejan. I have converted your code to Mikrobasic and it is working fine

Regards,

Dear
Can you please help me out with converting above to Mikrobasic with some code?
I don't understand how to declare these.

Many thanks in advance,

Donald

Dimmer
Posts: 4
Joined: 11 Jun 2014 22:00
Location: Holland

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#7 Post by Dimmer » 11 Jun 2014 22:17

Dear All,

I'm still struggling to get the 'FT800_TouchTransform_GetConfig' routine working in Mikrobasic for AVR.
I see samples in C and Pascal but can anyone post some code in Mikrobasic, or convert above Pascal code into Mikrobasic for AVR?
The problem is how to determine all declaration...

Many thanks in advance!

Donald

twenty
Posts: 71
Joined: 20 Oct 2010 11:44

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#8 Post by twenty » 26 Jul 2014 13:20

Hi,

Try the following code (copy into user code VTFT):

Code: Select all

include Calibration_constants_types
include Calibration_constants_resources

#I Calibration_constants_driver.inc
#I Calibration_constants_objects.inc

sub procedure button1_ondown()

'-------------- User code declarations ---------------'
  dim calibrateconstants as tft800touchtransform
  dim txt_tmp as char[9]
  sub procedure refresh_coordinates()

'-------------- End of User code declarations --------'

implements
'--------------------- User code ---------------------'
 sub procedure refresh_coordinates()
  FT800_TouchTransform_GetConfig(@CalibrateConstants)
  LongWordToHex(CalibrateConstants.TransformA, txt_tmp)
  strcpy(Label1.Caption, txt_tmp)
  LongWordToHex(CalibrateConstants.TransformB, txt_tmp)
  strcpy(Label2.Caption, txt_tmp)
  LongWordToHex(CalibrateConstants.TransformC, txt_tmp)
  strcpy(Label3.Caption, txt_tmp)
  LongWordToHex(CalibrateConstants.TransformD, txt_tmp)
  strcpy(Label4.Caption, txt_tmp)
  LongWordToHex(CalibrateConstants.TransformE, txt_tmp)
  strcpy(Label5.Caption, txt_tmp)
  LongWordToHex(CalibrateConstants.TransformF, txt_tmp)
  strcpy(Label6.Caption, txt_tmp)
  DrawScreen(@Screen1)
  end sub
'----------------- End of User code ------------------'

' Event Handlers
sub procedure button1_ondown()
refresh_coordinates()
end sub
end.
Regards,

signalflow
Posts: 6
Joined: 27 Jul 2017 00:17

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#9 Post by signalflow » 28 Jul 2017 16:45

I am using the supplied code. It does print to the screen to each label. I was expecting each TransformA, TransformB, etc. to be 32 bits long. But I am not getting that.

Code: Select all

void refresh_coordinates()
{
  FT812_TouchTransform_GetConfig(&CalibrateConstants);
  LongWordToHex(CalibrateConstants.TransformA, txt_tmpA);
  strcpy(LabelA.Caption, txt_tmpA);
  LongWordToHex(CalibrateConstants.TransformB, txt_tmpB);
  strcpy(LabelB.Caption, txt_tmpB);
  LongWordToHex(CalibrateConstants.TransformC, txt_tmpC);
  strcpy(LabelC.Caption, txt_tmpC);
  LongWordToHex(CalibrateConstants.TransformD, txt_tmpD);
  strcpy(LabelD.Caption, txt_tmpD);
  LongWordToHex(CalibrateConstants.TransformE, txt_tmpE);
  strcpy(LabelE.Caption, txt_tmpE);
  LongWordToHex(CalibrateConstants.TransformF, txt_tmpF);
  strcpy(LabelF.Caption, txt_tmpF);
  DrawScreen(&Screen1);
}
Mine prints this to the screen. It is like F is tacked onto E so E is really EF. Then D is really DEF. Then C is CDEF, etc. How can txt_tmpA contain all of the other txt_tmpX where X = B, C, D, E and F?
00007FFFFFFFFb4FFFFF00007FFF65b52
FFFFFFFFB4FFFFF00007FFF65B52
FFFB4FFFFF00007FFF65B52
FFFFF00007FFF65B52
00007FFF65B52
FFF65B52

So I tried to split it up into this below, but it does not work. Any ideas?
CalibrateConstants.TransformA=0x00007;
CalibrateConstants.TransformB=0xFFFFF;
CalibrateConstants.TransformC=0xFFFB4;
CalibrateConstants.TransformD=0xFFFFF;
CalibrateConstants.TransformE=0x00007;
CalibrateConstants.TransformF=0xFFF65B52;

FT812_TouchTransform_SetConfig(&CalibrateConstants);

User avatar
darko.ilijevski
Posts: 581
Joined: 21 Mar 2017 16:57

Re: ConnectEve (Ready for Xmega)Touch calibration constants

#10 Post by darko.ilijevski » 31 Jul 2017 14:29

Hello,

Those fields are actually members of a structure, not all are of the same size. You can find more about it, if you read the help (right click on the library in the library manager panel and then HELP)

For correct readings, you need to define a type of TFT812TouchTransform Also, read this article HERE in the knowledgebase, it might help you understand what's going on inside that function.

Other than that, try to allocate enough space for your labels (max expected length + 1 char), do not leave them at 0 as it might mess up the pointers - a most common error when updating labels.

Best regards
BR,
Darko

Post Reply

Return to “Visual TFT General”