BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: The meaning of REG_TOUCH_TRANSFORM_A-F touch transformation matrix  (Read 11093 times)

I.B.

  • Newbie
  • *
  • Posts: 3
    • View Profile

Hello,

I'm looking for the definition of the touch transform registers REG_TOUCH_TRANSFORM_A-F. What are the values in them mean and how do they transform the touch information?

I'm using the Matrix Orbital 480x272 EVE3 display with BT815 (capacitive touch). When I use the calibration command the values returned in these registers don't follow the screen correctly. The edges are slightly off. I get values from 0 to about 470 on the X and 0 to about 260 on the Y in REG_TOUCH_SCREEN_XY. I can calculate the transform myself (or at least adjust it), but I cannot find any information on what exactly the transform registers mean.

Also on EVE3 the values stored in these registers are now fixed point. The BRT_AN_033 is a bit vague on how the fixed point values are stored (e.g. 2s complement or not). Does anybody know this as well?

Thanks in advance

IB
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: The meaning of REG_TOUCH_TRANSFORM_A-F touch transformation matrix
« Reply #1 on: February 08, 2021, 10:26:29 AM »

Does it really help to know what these numbers mean?
This is a closed system, you need to calibrate the touch-screen because there is no way to tell it's alignment.
There is no way to tell where the screen has been touched in absolute terms in regards to the display.

I am using a stylus for capacitive screens when I am calibrating the screen in order to hit the spot indicated
by the blinking dot as precisely as possible.

If the touch has an offset I am re-calibrating it.
Okay, manually correcting by guessing the offset might result in a better calibration but it still involves guessing.

Anyways, Matrix Orbital added a Calibrate_Manual() to their https://github.com/MatrixOrbital/EVE2-Library/blob/master/Eve2_81x.c which does calculate the calibration values from the given coordinates for the dots and the raw input of the touch-screen.
They added this for their non standard panels that display the dots from the internal calibration function off-screen.
Logged

I.B.

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: The meaning of REG_TOUCH_TRANSFORM_A-F touch transformation matrix
« Reply #2 on: February 08, 2021, 03:12:25 PM »

Hi Rudolph,

Yes, it is important to know what the numbers mean in some circumstances. If there is an error it can come from various sources. It can be a bug in my code, it could be an error in the User's Guide, it can be a faulty display, etc. Everyone's problem is unique.

In any case, I am aware of the manual calibration code from Matrix Orbital. The code does show how the transform values are calculated, but it does not show how these values are used to transform the raw touch coordinates to screen coordinates. I guess I can spend the time to reverse engineer the code and figure it out, but if anybody has this information handy, it will sure be appreciated.

Thanks
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
« Last Edit: February 10, 2021, 04:28:16 PM by Rudolph »
Logged

darkjezter

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: The meaning of REG_TOUCH_TRANSFORM_A-F touch transformation matrix
« Reply #4 on: February 10, 2021, 03:55:02 PM »

The touch transform parameters are a 6-parameter transformation matrix, somewhat similar to the bitmap transform matrices.

The main difference is all 6 parameters appear to be Q15.16 (according to the bit positions shown in the programmers guide under Touch Screen Engine Registers), making them signed numbers with 16 fractional bits.

At it's most basic, parameters A,B,D,E provide an affine transformation of the raw touch values into pixel coordinates, allowing for arbitrary rotation, flip and skew.  Parameters C and F offset the coordinates along X and Y.  Thus the identity matrix with no offset is given by the parameters 0x10000,0,0,0,0x10000,0 for A through F, or 1.0, 0 , 0, 0, 1.0, 0 in their decimal equivalent.

This makes it a relatively standard 6-parameter transformation matrix.

Hope this helps.
Logged

I.B.

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: The meaning of REG_TOUCH_TRANSFORM_A-F touch transformation matrix
« Reply #5 on: February 11, 2021, 06:52:21 PM »

Thank you Rudolph and darkjezter for the information. Very helpful.

I got the problem resolved.
Logged