cancel
Showing results for 
Search instead for 
Did you mean: 

vTaskDelay(1000) = exactly 1 s?

antonius
Senior
Posted on April 07, 2017 at 03:39

Everyone,

Does    vTaskDelay(1000); = exactly 1 s ? 1000 ms ?

I feel more than that.

Thanks

7 REPLIES 7
Alan Chambers
Associate II
Posted on April 07, 2017 at 08:54

Have you checked it with a logic analyser? Toggle a GPIO before and after the delay. Since the delay is most likely based on SysTick, and you are most likely using an external crystal to drive the PLL, it will be quite accurate.

Rob.Riggs
Senior III
Posted on April 09, 2017 at 06:05

It will delay at least 1000ms.  It will be longer when there are higher priority threads or interrupts that need to be serviced.

Posted on April 09, 2017 at 07:37

But I have two tasks with the same priority, it should be exactly 1s,

doesn't it ?

Alan Chambers
Associate II
Posted on April 09, 2017 at 15:53

What are you trying to do? How close to exactly 1000ms do you have to be?

Posted on April 09, 2017 at 14:50

No.

Posted on April 09, 2017 at 18:25

Consider using a TIM to create a continuous/coherent time line, the latency at any given IRQ can't be guaranteed, but over the long term it should be consistently placed.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 09, 2017 at 21:21

vTaskDelay(1000);

will keep accumulating bias from one application to the next

http://www.freertos.org/vtaskdelayuntil.html

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..