cancel
Showing results for 
Search instead for 
Did you mean: 

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

EEuge
Senior

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

Thanks

5 REPLIES 5
Alexandre RENOUX
Principal

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

Shivani
Senior

Hii @Alexandre RENOUX ,

How to change the refresh rate of the display?

 

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...

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?

9,5 is regulator, but maybe you ask logical refresh rate aka speed off gui.

58 is physical refresh rate of display screen from memory.

Logical is based on your code and MCU power ...