cancel
Showing results for 
Search instead for 
Did you mean: 

speed up refreshing dynamic graph in TouchGFX

Jj.21
Associate II

According to Dynamic Graph | TouchGFX Documentation  ,I used handleTickEvent() to refresh the dynamic graph that is representing a sensor data, despite of refreshing the graph in per tick (if (tickCounter % 1 == 0)) but it's still slow to show a precise graph. How can I accelerate adding data points more than a tick (<16ms) ?  

1 ACCEPTED SOLUTION

Accepted Solutions
GaetanGodart
ST Employee

Hello @Jj.21 ,

 

Your display most likely refresh at 60 frames per second, so you cannot refresh the graph widget more that the screen refresh itself. Even if you did, you would not see the difference. Also, a refresh rate above 60 fps is barely noticeable by the human eye.

Did you mean that you want to have more that 60 new data point every second?
For instance, maybe you want to have one data point every ms.
In that case, the simplest way to do it would be to do it outside of TouchGFX, either in the main directly or by using the RTOS.
For instance, if you get an interrupt every ms with a new data, you can store that in an array in the main that is accessible by TouchGFX and every tick you add the new data.
Another way would be to add the data to a queue from the RTOS and every tick to empty that queue of new data to add them to your graph.

 

I hope this helps! :smiling_face_with_smiling_eyes:
If this comment helps you, I invite you to select it as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

3 REPLIES 3
GaetanGodart
ST Employee

Hello @Jj.21 ,

 

Your display most likely refresh at 60 frames per second, so you cannot refresh the graph widget more that the screen refresh itself. Even if you did, you would not see the difference. Also, a refresh rate above 60 fps is barely noticeable by the human eye.

Did you mean that you want to have more that 60 new data point every second?
For instance, maybe you want to have one data point every ms.
In that case, the simplest way to do it would be to do it outside of TouchGFX, either in the main directly or by using the RTOS.
For instance, if you get an interrupt every ms with a new data, you can store that in an array in the main that is accessible by TouchGFX and every tick you add the new data.
Another way would be to add the data to a queue from the RTOS and every tick to empty that queue of new data to add them to your graph.

 

I hope this helps! :smiling_face_with_smiling_eyes:
If this comment helps you, I invite you to select it as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

I really appreciate you. I tried your first solution, and it worked.

I am glad it helped you! :smiling_face_with_smiling_eyes:

Gaetan Godart
Software engineer at ST (TouchGFX)