cancel
Showing results for 
Search instead for 
Did you mean: 

Resistive touch calibration

sanjeev majumdar
Associate III

HI,

I have a stm32f769 custom board having 800*480 resolution RGB LCD. i am using tsc2003 touchscreen driver. i am able to port touchgfx and coulkd generate screens which are getting displayed without any issue. now i am trying to configure the touchscreen driver. i am getting the raw adc values using my driver and able to poll them in sampletouch(). Now i need to calibrate the touch and i used the touchcalibration class methods namely setCalibrationMatrix(). I provided the necessary lcd calib points and raw touch values to set the matrix but i could see the y axis values are coming reverse after calling translatePoint(). Can you please assist me to resolve the same. i have provided proper lcd calib points as well as touch points as per the general rule of /* 10%, 10% */ - /* 90%, 50% */ - /* 50%, 90% */ but always the y axis has issue.

i am using 4.12.3 version of touchgfx came with stm32cubemx 5.5 ()

10 REPLIES 10
Romain DIELEMAN
ST Employee

Hi,

I personally am just starting learning porting therefor my question might be totally irrelevant: wouldn't those reversed values be due to the fact that the Y axis is also reverted on Designer? The Origin (0,0) is the top/left of the screen and not the bottom/left, with the Y axis oriented downwards.

sanjeev majumdar
Associate III

yes the origin is at top/left but the same calibration works properly in case of emWin with the same procedure and i dint need to swap the yaxis. can you please share any touch calibration example for touchgfx where RGB LCD having 4 axis touch driver is used?

sanjeev majumdar
Associate III

i reversed the Y axis while calibration and its working now but still i couldn't find the relation between LCD calib points and supplied ADC values as per the given example here coz the reference LCD points are not the same as given in the comment. (https://community.st.com/s/question/0D50X0000AU2li8/how-to-use-touchscreencalibrationhpp-)

  1. static touchgfx::Point lcdCalibPoints[3] = /* Display size is 800x480 */
  2. {
  3. { 20, 20 }, /* 10%, 10% */
  4. { 780, 20 }, /* 90%, 50% */
  5. { 780, 460 }, /* 50%, 90% */
  6. };
  7. //calibration ADC 12 bit values
  8. static touchgfx::Point touchCalibPoints[3] =
  9. {
  10. { 200, 370 }, /* ADC values read when clicking in 80,48 */
  11. { 3927, 341 }, /* ADC values read when clicking in 720,240 */
  12. { 3919, 3807 }, /* ADC values read when clicking in 400,432 */
  13. };

jimmii
Senior II

I have the same problem.

I'm using the Touchscreen in Portrait mode with 272x480px.

Do I have to reverse some axis? Before or after the calibration?

Maybe @Martin KJELDSEN​  has some answers to the coordinate system requirements...

/jimmii

Anyone? @Martin KJELDSEN​ @Romain DIELEMAN​ 

Hi Jimmii,

you should swap X & Y axis before calibration. Also in touchghgfx designer -> Config - > try display orientation as portrait in order to register the touches appropriately.

Yes, the display orientation is already in portrait mode...

Thanks, I'll give it a try.

Didn't work.

I opened a new topic because I have a few more questions: https://community.st.com/s/question/0D53W000000YVhjSAG/touch-calibration

@Roman Schläpfer​  When you set portrait mode, TouchGFX main loop will translate the points to PORTRAIT for you - No action required.

/Martin