This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Freertos in data acquisition is not consistent sampling rate .

Hello

    i am a newbie in Freertos. i have a practice project about two threads. one thread for data acquisition from AD7606 , another thread  for data transmission by uart  in LabVIEW . Unfortunately, when i display data in LabVIEW which get from thread 2  , i found it will lose data or sampling rate is not consistent . How can i slove this problem?  

Up to now , i don't know whether the solution is timer interrupt in freertos or not .

Please give me the hint or some tutorial i could reference.  Please advise as necessary. Thank you very much.

    

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void StartDefaultTask(void const * argument)
{
/* USER CODE BEGIN 5 */
/* Infinite loop */
for(;;)
{
xSemaphoreTake(DeliverHandle,portMAX_DELAY);
// START read AD7607
Read_AI();
float value = (float)aio_data.c2_values_in[0];
// END read AD7607
// Send data in MyQueue
xQueueSendToBack(MyQueue, (void*)&value, (TickType_t)1);
xSemaphoreGive(DeliverHandle);
osDelay(20);
}
}
void StartTask02(void const * argument)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0