2022-12-26 02: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.
2022-12-26 03:20 AM
@Community member
I got those dropped straight lines . I don't know what the problem is
2022-12-26 05: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
}
2022-12-27 12:34 AM
2022-12-27 12:37 AM
I just call this function... I can't use void in a class ...
2022-12-27 01:07 AM
Maybe my YouTube video will help you understand how to receive UART data
2022-12-30 01:35 AM
Thanks