Skip to main content
antonius
Associate III
April 7, 2017
Question

vTaskDelay(1000) = exactly 1 s?

  • April 7, 2017
  • 4 replies
  • 1429 views
Posted on April 07, 2017 at 03:39

Everyone,

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

I feel more than that.

Thanks

    This topic has been closed for replies.

    4 replies

    Alan Chambers
    Associate III
    April 7, 2017
    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
    April 9, 2017
    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.

    antonius
    antoniusAuthor
    Associate III
    April 9, 2017
    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 ?

    Rob.Riggs
    Senior
    April 9, 2017
    Posted on April 09, 2017 at 14:50

    No.

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

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

    Tesla DeLorean
    Guru
    April 9, 2017
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    April 9, 2017
    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 VenmoUp vote any posts that you find helpful, it shows what's working..