Graph is not displaying correctly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-26 2:59 AM
Receiving data by UART and display it by TOUCHGFX cause some lost data in my screen, graph is not displayed correctly.
There are 2 boards one which is been receiving the signals by sensors and the second one is LCD board which has been configured by TOUCHGFX.
I want to receive data by UART from the first board and show them in LCD.
But some graph is not shown correctly.
Here is the code:
```
HAL_UART_Receive_IT(&huart1,(uint8_t*)RxBuf,20);
HAL_UART_RxCpltCallback(&huart1);
HAL_Delay(1);
```
I put ```HAL_Delay(1); ``` in order to receive data correctly but it does not make sense.
And the data shown by graph:
```
if(i<123){
dynamicGraph1.addDataPoint(RxBuf[1]+25);
}else
i=0;
```
Note : in image, the first graph is displaying by UART and as you see suddenly a drop appears... and I don't know how to solve it, and the second graph (from above) is the correct signal.
How can I solve it?
Thanks again.
- Labels:
-
LCD-LTDC
-
TouchGFX
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-26 3:20 AM
@Community member​
I got those dropped straight lines . I don't know what the problem is
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-26 5:25 AM
You need to copy and paste your code exactly how you've written it as i have asked in the other post. I'm not sure why you've started a new post? You've pasted the same question.
Then there is this problem below
HAL_UART_Receive_IT(&huart1,(uint8_t*)RxBuf,20);
HAL_UART_RxCpltCallback(&huart1); // This is wrong, you don't make this call, the HAL driver does.
HAL_Delay(1);
And where is this code at? It has to be in some function.
if(i<123){
dynamicGraph1.addDataPoint(RxBuf[1]+25);
}else
i=0;
what code do you have in HAL_UART_RxCpltCallback?
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
// show your code
}
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-27 12:34 AM
@Community member​
Hi, Karl. sorry for my bad English.
- void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
- {
- // show your code
- }
Karl where should I use this function?
you mean I put the add data point in UartCALLBACK?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-27 12:37 AM
I just call this function... I can't use void in a class ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-27 1:07 AM
Maybe my YouTube video will help you understand how to receive UART data
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-30 1:35 AM
Thanks
