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: FT810 touch calibration problem  (Read 7396 times)

EnsAltun

  • Newbie
  • *
  • Posts: 2
    • View Profile
FT810 touch calibration problem
« on: February 23, 2022, 12:29:24 PM »

Hi,
I am using FT810 with 7" TFT. But i use it on portrait orientation. But i have a problem with touch orientation. It doesnt happen always but touch orientation of some devices change.  Seems you see TFT screen on portrait orientation but touch system changes to landscape. Thats why you cant use touch screen. Also i calibrate system once after programming process. Flowchart of algorithm is like below;
Run system first time after programming  -> (System goes to calibration mode because calibration values are zero on mcu eeprom) -> Calibrate screen -> read REG_TOUCH_TRANSFORM_X values and save to mcu eeprom -> reboot system
After rebooting system, mcu will see values on eeprom and FT810 wont be calibrated again. I read calibration values and write to REG_TOUCH_TRANSFORM_X again same values. This system was running without problem. But a few devices get this problem. My calibration code is below. Do you have any idea why i have this problem?


ft800memWrite32(RAM_CMD + cmdOffset, (CMD_DLSTART));                                                                                                                                             
cmdOffset = incCMDOffset(cmdOffset, 4);     
ft800memWrite32(RAM_CMD + cmdOffset, CLEAR_COLOR_RGB(0,255,0));
cmdOffset = incCMDOffset(cmdOffset, 4);       
ft800memWrite32(RAM_CMD + cmdOffset, CLEAR(1,1,1));
cmdOffset = incCMDOffset(cmdOffset, 4);       
   
ft800memWrite32(RAM_CMD + cmdOffset, (CMD_SETROTATE));                                                   
cmdOffset = incCMDOffset(cmdOffset, 4);       
ft800memWrite32(RAM_CMD + cmdOffset, (0));   //rotate screen portrait orientation                                 
cmdOffset = incCMDOffset(cmdOffset, 4);       
   
   
ft800memWrite32(RAM_CMD + cmdOffset,CMD_CALIBRATE); // calibrate screen
cmdOffset = incCMDOffset(cmdOffset, 4);   
ft800memWrite32(RAM_CMD + cmdOffset, DISPLAY());
cmdOffset = incCMDOffset(cmdOffset, 4);       
ft800memWrite32(RAM_CMD + cmdOffset, (CMD_SWAP));
cmdOffset = incCMDOffset(cmdOffset, 4);       
ft800memWrite16(REG_CMD_WRITE, (cmdOffset));
do
{
cmdBufferRd = ft800memRead16(REG_CMD_READ);       
cmdBufferWr = ft800memRead16(REG_CMD_WRITE);
}while (cmdBufferWr != cmdBufferRd);

DEVICE_TRANSFORM_A=ft800memRead32(REG_TOUCH_TRANSFORM_A);  // read calibration values
DEVICE_TRANSFORM_B=ft800memRead32(REG_TOUCH_TRANSFORM_B);
DEVICE_TRANSFORM_C=ft800memRead32(REG_TOUCH_TRANSFORM_C);
DEVICE_TRANSFORM_D=ft800memRead32(REG_TOUCH_TRANSFORM_D);
DEVICE_TRANSFORM_E=ft800memRead32(REG_TOUCH_TRANSFORM_E);
DEVICE_TRANSFORM_F=ft800memRead32(REG_TOUCH_TRANSFORM_F);
           
save_eeprom_transform_values();   // save calibration values to eeprom
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: FT810 touch calibration problem
« Reply #1 on: February 23, 2022, 04:41:08 PM »

It does not work like this, the programming guide has this for CMD_SETROTATE:

„CMD_SETROTATE sets REG_ROTATE to the given value, causing the screen to rotate.
It also appropriately adjusts the touch transform matrix so that coordinates of touch points are
adjusted to rotated coordinate system.”

So the correct sequence would be to calibrate and then use CMD_SETROTATE.
Or you could try to manually set REG_ROTATE.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 743
    • View Profile
Re: FT810 touch calibration problem
« Reply #2 on: February 23, 2022, 05:49:24 PM »

Hi,

Yes, you could do the calibration with the default orientation and store the values. Then in your main user program, you can load the touch registers with your saved values and then set the rotate. CMD_SETROTATE will rotate both the screen content and also the touch.

Best Regards, BRT Community
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: FT810 touch calibration problem
« Reply #3 on: February 24, 2022, 04:14:52 PM »

Annother thing, you seem to be using my EVE library but in a very outdated version, this looks like my 2.x from 2016, or it is something that was derived from my 2.x.

This is the latest version: https://github.com/RudolphRiedel/FT800-FT813
Logged