cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX - Frame rate for SPI interface

SOtte.602
Associate II

I have a software project that interfaces an STM32F4 to an external display via SPI. The frame rate is set by the time between periodic executions of TouchGFX_TickHandler() and MX_TouchGFX_Process(). The period is currently set at 17 ms, which gives a frame rate of ~60 Hz.

Is increasing the time between calls to the TouchGFX functions sufficient to decrease the frame rate, or do I need to configure TouchGFX to make it aware of the new frame rate? I don't see a frame rate setting in TouchGFX Designer.

One thing to mention is that while the update period is defined in code as 17 ms, that's only true for partial screen updates. A full screen update SPI transfer takes 34 ms, plus an additional 10 ms of overhead to flip the endianess of words since the MCU doesn't have DMA2D or MDMA. (https://community.st.com/s/question/0D50X0000C9dxj6SQA/how-to-change-touchgfx-framebuffer-to-big-endian).

Thanks!

2 REPLIES 2
Martin KJELDSEN
Chief III

There is no frame-rate functionality in the designer, no. If you check out the demos, maybe you can find how we did the framerate there. We usually display it in order to showcase with and without DMA2D. I'm not sure what you mean by "configure TouchGFX to make it aware of the new frame rate?"

Your theoretical 60 Hz becomes 30 Hz (34ms) once the load increases - Not uncommon. We actually expose a GPIO::FRAME_RATE signal that you may be able to hook into in the GPIO class.

/Martin

SOtte.602
Associate II

Thanks for the response - It sounds like I'm free to decrease frame rate without any changes to TouchGFX code. I'll likely set it <=20 Hz to give time for application code to execute between frames since screen updates are blocking.

By 'make TouchGFX aware' of the frame rate I was thinking specifically about animations like a screen transition. Is that implemented as a fixed number of frames such that the time it takes is dependent on frame rate?

I thought frame rate may be used to instead implement the transition as a fixed amount of time.