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: [FT813] Disconnect between objects drawn and their tag detection region  (Read 9252 times)

jshoemaker

  • Newbie
  • *
  • Posts: 4
    • View Profile

Hello all,

I am currently working with the FT813 EVE chip on the ME813A-WH50C development board. I am interfacing to it with the ATSAMV71 processor. I have had a great time using the chip for drawing basic shapes, and using the co-processor to draw widgets. There have been no issues in drawing objects. However when attempting to assign tags to these objects, I start running into issues.

My problem is that all tag regions are completely inverted with respect to their drawing position. What I mean by this is if I draw, let us say a slider widget, near the bottom right of the screen, its corresponding tag region will actually be in the top right of the screen. Therefore objects in the middle of the screen are not affected and work correctly.

The X touch location of the objects are not an issue. Only the Y.

I am generally using the TAG command in the following way:

EVE_CoprocessorWrite32(TAG_MASK(1))
EVE_CoprocessorWrite32(TAG(*tag number*))
EVE_CoprocessorWrite32(*EVE_objects to become encapsulated in tag*)
EVE_CoprocessorWrite32(TAG_MASK(0))

If the object is pressed in its now inverted position, everything involving the tag works as expected.

I would also like to note that I used the emulator version of this chip provided by Bridgetek and everything worked fine. There was no inversion in the touch tags.

Another interesting note is according to the FT81X programmer's guide, the bottom right of the screen should be the max in terms of pixel dimensions (2047, 2047). Looking at the raw coordinates of the touch engine, the chip I am using puts this location in the TOP right of the screen.

Things I have tried:
 - The CMD_COLDSTART command to reset to default values in the co processor
 - The CMD_SETROTATE command to rotate the screen. (Option 5 makes the drawn object line up with the tag! But this is unusuable as all the graphical objects are not in the desired rotation)
 - Writing to the display rotation register manually

The FT81X programmers guide says that the CMD_SETROTATE command should rotate the touch matrix as well, but this has not been the case for me. I have tried CMD_SETROTATE(0) for default position. This makes the visually drawn objects in the right position but not the touch locations.
If anyone has any insight into this problem it would be much appreciated.

Thank you
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 745
    • View Profile

Hi,

Could you advise what your start-up code is doing up until you render the first screen, and also an example of a co processor list which draws the slider and check for the touch position?

Do you see the raw coordinates work in reverse from what you expect, even if you make no write to the REG_ROTATE and no call to the SETROTATE command?

Also, which way up is the image currently showing relative to the module?

Best Regards, BRT Community

Logged

jshoemaker

  • Newbie
  • *
  • Posts: 4
    • View Profile

Thank you for the reply.

>Could you advise what your start-up code is doing up until you render the first screen?

1. Send activate command to EVE chip
2. Wait until device ID is read to be 0x7c
3. Write timing characteristic to EVE chip (REG_HCYCLE, HOFFSET, HSYNC, SWIZZLE, CSPREAD, PCLK_POL, etc)
4. Clear screen, enable GPIO display bit, and write to REG_PCLK

I got these from the FT81X programmer's guide.

>An example of a co processor list which draws the slider and check for the touch position

//draw the slider and assign a tag
...
EVE_CoCmdWrite32( TAG_MASK(1));
EVE_CoCmdWrite32( TAG(12));
EVE_CoCmdWrite32(CMD_TOGGLE); //toggle button
EVE_CoCmdWrite16(x);
EVE_CoCmdWrite16(y);
EVE_CoCmdWrite16(w);
EVE_CoCmdWrite16(font);
EVE_CoCmdWrite16(options);
EVE_CoCmdWrite16(state);
writePaddedString(s); //ensures multiple of 4 bytes are written
EVE_CoCmdWrite32(TAG_MASK(0));
...
//check if tag was touched
uint8_t tag = EVE_read8(REG_TOUCH_TAG);
if (tag != 255 && tag != 0) //a tag was touched
{
//find out which tag it was, application code
}
...

> Do you see the raw coordinates work in reverse from what you expect, even if you make no write to the REG_ROTATE and no call to the SETROTATE command?

Yes. At the default state the top of the screen is considered the maximum y for touch, but the minimum for drawing.

> Which way up is the image currently showing relative to the module?

At the default state, coprocessor text shows up in the correct position when the power LED indicator is closer to the bottom of the module.

Hope this helps
« Last Edit: May 27, 2021, 02:19:19 PM by jshoemaker »
Logged

jshoemaker

  • Newbie
  • *
  • Posts: 4
    • View Profile

If it helps: I have another version of the dev board with a USB to SPI converter onboard. This board has the exact same issue when I target my code from a windows environment instead of a microcontroller.
Logged

jshoemaker

  • Newbie
  • *
  • Posts: 4
    • View Profile

I was able to solve this issue. Basically you can use the CMD_CALIBRATE command after initialization to get the correct orientation. If you want to avoid having to touch three points on the beginning of every startup, you can record those values and write them directly those to registers REG_TOUCH_TRANSFORM_A through REG_TOUCH_TRANSFORM_F.

Not sure why the default state of the board is like this but this was the fix for me.

The exact command list you can use for the calibration command:
                                EVE_LIB_BeginCoProList();
                                EVE_CMD_DLSTART();
                                EVE_CLEAR_COLOR_RGB(0, 0, 0);
                                EVE_CLEAR(1,1,1);
                                EVE_COLOR_RGB(255, 255, 255);
                                EVE_CMD_TEXT(EVE_DISP_WIDTH/2, EVE_DISP_HEIGHT/2, 28, EVE_OPT_CENTERX | EVE_OPT_CENTERY,"Please tap on the dots");
                                EVE_CMD_CALIBRATE(0);
                                EVE_LIB_EndCoProList();
                                EVE_LIB_AwaitCoProEmpty();
Logged