FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:



Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


Author Topic: ME813A-WH50C Display - Skipping touch screen calibration at startup  (Read 70 times)

jberkhout

  • Newbie
  • *
  • Posts: 12
    • View Profile

I would like to calibrate the touch screen once (via a setup menu function) and store calibration values, so they can be used at start-up, without the need to perform calibration at start-up.
Is it possible to skip or disable the touch screen calibration at startup?

Thank you very much for helping me out.

Regards from the Netherlands.
Logged

FTDI Community

  • Administrator
  • Jr. Member
  • *****
  • Posts: 94
    • View Profile
Re: ME813A-WH50C Display - Skipping touch screen calibration at startup
« Reply #1 on: June 14, 2018, 11:54:38 AM »

Hello,

Thanks for your question.

Screen calibration is achieved with the CMD_CALIBRATE() function. Please see section 5.52 of the FT81x programmers guide:
http://brtchip.com/wp-content/uploads/Support/Documentation/Programming_Guides/ICs/EVE/FT81X_Series_Programmer_Guide.pdf

Normally this function is call during the main initialization loop of a EVE program.

From the 'SampleLayout' project in EVE Screen Designer (as you have previously mentioned that you are using ESD in another forum topic), within the 'Ft_Esd_App.c' file. The 'Ft_Gpu_CoCmd_Calibrate()' function sends the CMD_CALIBRATE command to the FIFO:
Code: [Select]
/* API to demonstrate calibrate widget/functionality */
ft_void_t App_CoPro_Widget_Calibrate()
{
ft_uint32_t NumBytesGen = 0, TransMatrix[6];
ft_uint16_t CurrWriteOffset = 0;
Ft_Gpu_CoCmd_Dlstart(&s_Host);
Ft_Gpu_Hal_WrCmd32(&s_Host, CLEAR_COLOR_RGB(64, 64, 64));
Ft_Gpu_Hal_WrCmd32(&s_Host, CLEAR(1, 1, 1));
Ft_Gpu_Hal_WrCmd32(&s_Host, COLOR_RGB(0xff, 0xff, 0xff));
/* Draw number at 0,0 location */
//Ft_App_WrCoCmd_Buffer(&s_Host, COLOR_A(30));
Ft_Gpu_CoCmd_Text(&s_Host, (FT_DispWidth / 2), (FT_DispHeight / 2), 27, OPT_CENTER, "Please Tap on the dot");
#if defined(FT_801_ENABLE) || defined(FT_811_ENABLE) || defined(FT_813_ENABLE)
Ft_Gpu_Hal_Wr8(&s_Host, REG_CTOUCH_EXTENDED, CTOUCH_MODE_COMPATIBILITY);
#endif
Ft_Gpu_CoCmd_Calibrate(&s_Host, 0);
/* Wait till coprocessor completes the operation */
Ft_Gpu_Hal_WaitCmdfifo_empty(&s_Host);
/* Print the configured values */
Ft_Gpu_Hal_RdMem(&s_Host, REG_TOUCH_TRANSFORM_A, (ft_uint8_t *)TransMatrix, 4 * 6); //read all the 6 coefficients
#ifdef MSVC_PLATFORM
ESD_print("Touch screen transform values are A 0x%x,B 0x%x,C 0x%x,D 0x%x,E 0x%x, F 0x%x",
TransMatrix[0], TransMatrix[1], TransMatrix[2], TransMatrix[3], TransMatrix[4], TransMatrix[5]);
#endif
}

If you export the ESD code to the FT9XX tool chain you can make the appropriate edits and recompile to upload to you FT9XX.

Best Regards,
FTDI Community
Logged

jberkhout

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: ME813A-WH50C Display - Skipping touch screen calibration at startup
« Reply #2 on: June 14, 2018, 02:24:21 PM »

Thank you very much!
Without calibration, the touchscreen has reversed (mirrored) Y values, i.e. bottom is top and top is bottom, while the X values are fine.
Is this a little bug?
Could I easily correct this without calibrating?
Logged

FTDI Community

  • Administrator
  • Jr. Member
  • *****
  • Posts: 94
    • View Profile
Re: ME813A-WH50C Display - Skipping touch screen calibration at startup
« Reply #3 on: June 14, 2018, 02:58:38 PM »

Hello,

It is not a bug, the calibration values just need to be set.
The calibration routine writes values into the REG_TOUCH_TRANSFORM_A - REG_TOUCH_TRANSFORM_F registers. you could run the calibration routine and once this has completed read the values in the applicable registers. You can use these values you write the REG_TOUCH_TRANSFORM_A - REG_TOUCH_TRANSFORM_F registers at the start of your program and your screen should be roughly calibrated. If it requires fine tuning after you can then call the calibration routine from your menu option.

Best Regards,
FTDI Community
Logged