Skip to main content
April 11, 2021
Question

handleTickEvent() - what is the period? And how to change it?

  • April 11, 2021
  • 2 replies
  • 3397 views

handleTickEvent() - what is the period? And how to change it?

Thanks

This topic has been closed for replies.

2 replies

Alexandre RENOUX
Visitor II
April 12, 2021

Hello EEuge,

The period of handleTickEvent is not set like setTickPeriod(4). handleTickEvent is called once every TouchGFX loop.

In other words, the period is driven by the display. For instance, if your display has a refresh rate of 60 Hz, it means it notifies the MCU of a new frame every 16.6 ms.

In this case, the period of handleTickEvent is 16.6 ms.

To change it, you need to change the refresh rate of your display.

Otherwise, depending on what you want to do, only doing as follows might be enough :

void Screen1View::handleTickEvent()
{
 cnt++;
 if(cnt % 10 == 0)
 {
 cnt = 0;
 // Do whatever you want
 }
}

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

Associate III
December 7, 2023

Hii @Alexandre RENOUX ,

How to change the refresh rate of the display?

 

MM..1
Chief III
December 7, 2023

Exist many types of display, but if you asked video mode based LTDC RGB displays, then in clock config you set LTDC or better say dot clock. For example you set 35MHz here.

Then refresh calc is 35M / horizontal+porchs / verticals+porchs = for example 35M / 867 / 650 = 62,10 Hz refresh rate. If you use HSI tolerance is thermal based and bigger as for HSE...

Associate III
December 8, 2023

Hii @MM..1 ,

I am using STM32F746G Discovery Board. And the LTDC clock is 9.5 Mhz and the total width and total height is 565 and 285.

HorizontalSync = 40
VerticalSync = 9
AccumulatedHBP = 53
AccumulatedVBP = 11
AccumulatedActiveW = 533
AccumulatedActiveH = 283
TotalWidth = 565
TotalHeigh = 285

According to the refresh calc that you have mentioned is 58. But what is the refresh rate?
Where I need to change the refresh rate in code?