2024-09-27 04:00 AM
Dear STMicroelectronics Support Team,
I am currently working on a project using an STM32 microcontroller where I need to display a 12-lead ECG waveform. The display layout is configured in a 3x4 grid format, along with an R-1 waveform shrink. I have implemented an RTOS for managing the GUI rendering and data handling efficiently.
For the GUI, I am using the TouchGFX framework and have integrated dynamic graphs to plot the 12-lead ECG waveforms in real-time. The ECG module communicates with the STM32 via UART using interrupts to handle data reception.
However, I am facing issues with accurately plotting the ECG waveforms on the screen. The waveform representation seems to shrink or misalign, particularly in the R-1 section. Despite configuring tasks with adequate priorities and stack sizes for the GUI and ECG data, and ensuring the refresh rate is set to 4 ms, I am unable to achieve a stable display.
Could you please provide guidance on optimizing the dynamic graph display using TouchGFX or recommend any specific configurations in the STM32 settings that could resolve this issue? Any advice on fine-tuning the integration between the RTOS, UART, and TouchGFX would also be highly appreciated.
Your support and insights would be greatly valued.
Thank you.
2024-09-27 07:17 AM
Hello @smj-11 ,
When you say R-1, do you mean R1 or "R minus 1"?
From what I have seen, ECG goes from R1 to R5.
But I do not think that is relevant for the question, because in the end it is always just data being displayed.
Can you share with me what you expect to see and what you actually have?
Can you also share your project maybe?
You say "refresh rate is set to 4 ms", which refresh rate is that? The ECG Data?
Why is it 4ms?
Regards,
2024-09-27 07:32 AM - edited 2024-09-27 07:33 AM
@GaetanGodart wrote:You say "refresh rate is set to 4 ms", which refresh rate is that? The ECG Data?
Why is it 4ms?
Indeed.
A human heart rate isn't going to be over 220 beats per minute - so under 4 per second.
So a refresh rate of 4ms is going to be over 1000 "refreshes" (whatever they may be) per beat!
Seems a tad excessive?
2024-09-27 07:37 AM
@smj-11 wrote:The ECG module communicates with the STM32 via UART using interrupts to handle data reception.
However, I am facing issues with accurately plotting the ECG waveforms on the screen. The waveform representation seems to shrink or misalign
Are you sure that the display problems aren't down to problems in the comms link ... ?
ie, data is getting corrupted before reaching the display - and the display is accurately showing what it receives?
2024-09-27 07:47 AM
Ok but most TouchGFX screens refresh rate is 60 ticks per second so 16,6 ms.
I do not know what smj is using to display the framebuffer rendered by TouchGFX.
2024-09-27 08:25 PM
Hi Gaetan,
Thank you for the clarification.
The display I’m using is a 10.1-inch RGB panel connected to the STM32H753 microcontroller. The frame buffer is managed using external SDRAM with a stride width of 1280 to match the display resolution.
Regarding the refresh rate, I’m aware that most TouchGFX displays operate at 60 frames per second, corresponding to 16.6 ms per frame. However, for the ECG application, I aimed for a higher GUI update rate of 4 ms to match the UART data reception rate and avoid latency in displaying rapidly changing waveforms. This is where the inconsistency might be occurring, as the graph might not be able to keep up with the rapid updates.
Framebuffer Configuration:
The framebuffer is updated dynamically using a dedicated DMA transfer triggered by VSYNC interrupts. This is configured to avoid tearing or misalignment. However, I suspect the current refresh rate mismatch could be causing the shrinking or compression of the ECG waveforms.
Could you suggest a better way to handle this, such as a method to buffer data temporarily and update the screen at a more stable rate (e.g., every 16.6 ms) while maintaining smooth waveform visualization?
Let me know if I should provide further technical details or share the project setup.
Thank you for your continued support!
2024-09-28 01:33 AM
@smj-11 wrote:I aimed for a higher GUI update rate of 4 ms to match the UART data reception rate and avoid latency in displaying rapidly changing waveforms.
But, surely, ECG waveforms don't change that rapidly?
(see previous post)
2024-09-28 02:27 AM
Image seems clean, but dont show refresh method. Medical or any other time data can use two method A continuos scroll = bad readability B reprint from left over = more better and you see old and new info in parallel.
Simple marker is moving vertical line on edge refreshed info...
And for your 4ms info, when this is dat input speed ok, but how UART speed and data amount?
But when you realy say about display refresh , then back to basic math school. Primary human eye dont see it, secondary refresh 1280x720 every 4ms result to display clock 230MHz = not realy possible on STM or LCD.
If you only say about memory data for frame changing speed , you can call invalidate , but real refresh speed on LCD not changed. And last 4ms is refresh of all 12 point info???
2024-09-28 03:34 AM
I am currently working on an ECG monitoring project using an STM32H7 microcontroller with TouchGFX for the graphical interface. I need to visualize ECG waveforms at a 4 ms interval, and I use the Dynamic Graph Widget in TouchGFX to achieve this. However, I require some guidance on the optimal way to handle the data refresh rate and synchronization with my system.
2024-09-28 04:51 AM